Repository: kubernetes-sigs/external-dns
Pull request #5297: fix(helm): update helm schema
Author: login: semnell
Labels: name: cncf-cla: yes
description: Indicates the PR's author has signed the CNCF CLA.
name: lgtm
description: "Looks good to me", indicates that a PR is ready to be merged.
name: size/L
description: Denotes a PR that changes 100-499 lines, ignoring generated files.
name: approved
description: Indicates a PR has been approved by an approver from all required OWNERS files.
name: tide/merge-method-squash
description: Denotes a PR that should be squashed by tide when it merges.
name: ok-to-test
description: Indicates a non-member PR verified by an org member that is safe to test.
Created: 2025-04-15T13:49:45Z | Merged: 2025-04-17T11:49:14Z

Description

Add helm schema changes so liveness and readiness can be int's or strings again.

Fixes https://github.com/kubernetes-sigs/external-dns/issues/5295


Diff:
diff --git a/charts/external-dns/CHANGELOG.md b/charts/external-dns/CHANGELOG.md
index f21a35f7c4..a08aa17583 100644
--- a/charts/external-dns/CHANGELOG.md
+++ b/charts/external-dns/CHANGELOG.md
@@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [UNRELEASED]
 
+### Fixed
+
+- Fixed wrong type definitions for webhook probes. ([#5297](https://github.com/kubernetes-sigs/external-dns/pull/5297)) _@semnell_
+
 ## [v1.16.1] - 2025-04-10
 
 ### Changed
diff --git a/charts/external-dns/tests/json-schema_test.yaml b/charts/external-dns/tests/json-schema_test.yaml
index 694e59d5cc..68b9b6ba3d 100644
--- a/charts/external-dns/tests/json-schema_test.yaml
+++ b/charts/external-dns/tests/json-schema_test.yaml
@@ -50,3 +50,15 @@ tests:
       labelFilter: "mydomain.io/enable-dns-record in (true)"
     asserts:
       - notFailedTemplate: {}
+
+  - it: should not fail when livenessProbe is null
+    set:
+      livenessProbe: null
+    asserts:
+      - notFailedTemplate: {}
+
+  - it: should not fail when readinessProbe is null
+    set:
+      readinessProbe: null
+    asserts:
+      - notFailedTemplate: {}
diff --git a/charts/external-dns/values.schema.json b/charts/external-dns/values.schema.json
index d5e64143e9..bbd36ada8a 100644
--- a/charts/external-dns/values.schema.json
+++ b/charts/external-dns/values.schema.json
@@ -308,30 +308,51 @@
             "livenessProbe": {
               "properties": {
                 "failureThreshold": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 },
                 "httpGet": {
                   "properties": {
                     "path": {
-                      "type": "string"
+                      "type": [
+                        "string",
+                        "null"
+                      ]
                     },
                     "port": {
-                      "type": "string"
+                      "type": [
+                        "integer",
+                        "string"
+                      ]
                     }
                   },
                   "type": "object"
                 },
                 "initialDelaySeconds": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 },
                 "periodSeconds": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 },
                 "successThreshold": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 },
                 "timeoutSeconds": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 }
               },
               "type": "object"
@@ -339,30 +360,51 @@
             "readinessProbe": {
               "properties": {
                 "failureThreshold": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 },
                 "httpGet": {
                   "properties": {
                     "path": {
-                      "type": "string"
+                      "type": [
+                        "string",
+                        "null"
+                      ]
                     },
                     "port": {
-                      "type": "string"
+                      "type": [
+                        "integer",
+                        "string"
+                      ]
                     }
                   },
                   "type": "object"
                 },
                 "initialDelaySeconds": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 },
                 "periodSeconds": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 },
                 "successThreshold": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 },
                 "timeoutSeconds": {
-                  "type": "integer"
+                  "type": [
+                    "integer",
+                    "null"
+                  ]
                 }
               },
               "type": "object"
diff --git a/charts/external-dns/values.yaml b/charts/external-dns/values.yaml
index c1acf0c4c7..c1d9be879c 100644
--- a/charts/external-dns/values.yaml
+++ b/charts/external-dns/values.yaml
@@ -263,24 +263,24 @@ provider:  # @schema type: [object, string];
     # @default -- See _values.yaml_
     livenessProbe:
       httpGet:
-        path: /healthz
-        port: http-webhook
-      initialDelaySeconds: 10
-      periodSeconds: 10
-      timeoutSeconds: 5
-      failureThreshold: 2
-      successThreshold: 1
+        path: /healthz  # @schema type:[string, null]; default: null
+        port: http-webhook  # @schema type:[integer,string]; default: string
+      initialDelaySeconds: 10  # @schema type:[integer, null]; default: null
+      periodSeconds: 10  # @schema type:[integer, null]; default: null
+      timeoutSeconds: 5  # @schema type:[integer, null]; default: null
+      failureThreshold: 2  # @schema type:[integer, null]; default: null
+      successThreshold: 1  # @schema type:[integer, null]; default: null
     # -- [Readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) configuration for the `webhook` container.
     # @default -- See _values.yaml_
     readinessProbe:
       httpGet:
-        path: /healthz
-        port: http-webhook
-      initialDelaySeconds: 5
-      periodSeconds: 10
-      timeoutSeconds: 5
-      failureThreshold: 6
-      successThreshold: 1
+        path: /healthz  # @schema type:[string, null]; default: null
+        port: http-webhook  # @schema type:[integer,string]; default: string
+      initialDelaySeconds: 5  # @schema type:[integer, null]; default: null
+      periodSeconds: 10  # @schema type:[integer, null]; default: null
+      timeoutSeconds: 5  # @schema type:[integer, null]; default: null
+      failureThreshold: 6  # @schema type:[integer, null]; default: null
+      successThreshold: 1  # @schema type:[integer, null]; default: null
     service:
       # -- Webhook exposed HTTP port for the service.
       port: 8080


Reviews:
user: login: stevehipwell
body: @semnell thanks for the PR, please could you also add an entry to the chart CHANGELOG.

RE your issue and based on the existing chart it looks like the schema inline comments need to be double spaced `key: value  # BLA` not `key: value # BLA`.
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T10:34:39Z
user: login: stevehipwell
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T11:13:39Z
user: login: stevehipwell
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T11:14:05Z
user: login: semnell
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T11:19:24Z
user: login: stevehipwell
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T11:24:32Z
user: login: stevehipwell
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T11:25:29Z
user: login: semnell
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T11:26:08Z
user: login: semnell
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-17T11:27:49Z
user: login: ivankatliarchuk
body: /lgtm
state: APPROVED
author_association: MEMBER
submitted_at: 2025-04-17T11:34:23Z

Review comments:
diff_hunk: @@ -28,7 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 - Correctly handles 'txtPrefix' and 'txtSuffix' arguments when both are provided. ([#5250](https://github.com/kubernetes-sigs/external-dns/pull/5250)) _@ivankatliarchuk_
 - Add missing types in the schema for empty values. ([#5228](https://github.com/kubernetes-sigs/external-dns/pull/5228)) _@ivankatliarchuk_
-- Add missing types in the schema for empty values. ([#5207](https://github.com/kubernetes-sigs/external-dns/pull/5207)) _@t3mi_
+- Add missing types in the schema for empty values. ([#5207](https://github.com/kubernetes-sigs/external-dns/pull/5207)) _@t3mi _
+- Fixed wrong type definitions for webhook probes. ([#5297](https://github.com/kubernetes-sigs/external-dns/pull/5297)) _@semnell
path: charts/external-dns/CHANGELOG.md
user: login: stevehipwell
body: ```suggestion
- Fixed wrong type definitions for webhook probes. ([#5297](https://github.com/kubernetes-sigs/external-dns/pull/5297)) _@semnell_
```
created_at: 2025-04-17T11:13:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -28,7 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 - Correctly handles 'txtPrefix' and 'txtSuffix' arguments when both are provided. ([#5250](https://github.com/kubernetes-sigs/external-dns/pull/5250)) _@ivankatliarchuk_
 - Add missing types in the schema for empty values. ([#5228](https://github.com/kubernetes-sigs/external-dns/pull/5228)) _@ivankatliarchuk_
-- Add missing types in the schema for empty values. ([#5207](https://github.com/kubernetes-sigs/external-dns/pull/5207)) _@t3mi_
+- Add missing types in the schema for empty values. ([#5207](https://github.com/kubernetes-sigs/external-dns/pull/5207)) _@t3mi _
+- Fixed wrong type definitions for webhook probes. ([#5297](https://github.com/kubernetes-sigs/external-dns/pull/5297)) _@semnell
path: charts/external-dns/CHANGELOG.md
user: login: stevehipwell
body: @semnell this is likely why the markdown linting is failing.
created_at: 2025-04-17T11:14:05Z
author_association: CONTRIBUTOR
diff_hunk: @@ -28,7 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 - Correctly handles 'txtPrefix' and 'txtSuffix' arguments when both are provided. ([#5250](https://github.com/kubernetes-sigs/external-dns/pull/5250)) _@ivankatliarchuk_
 - Add missing types in the schema for empty values. ([#5228](https://github.com/kubernetes-sigs/external-dns/pull/5228)) _@ivankatliarchuk_
-- Add missing types in the schema for empty values. ([#5207](https://github.com/kubernetes-sigs/external-dns/pull/5207)) _@t3mi_
+- Add missing types in the schema for empty values. ([#5207](https://github.com/kubernetes-sigs/external-dns/pull/5207)) _@t3mi _
+- Fixed wrong type definitions for webhook probes. ([#5297](https://github.com/kubernetes-sigs/external-dns/pull/5297)) _@semnell
path: charts/external-dns/CHANGELOG.md
user: login: semnell
body: Resolved! Thanks.
created_at: 2025-04-17T11:19:24Z
author_association: CONTRIBUTOR
diff_hunk: @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Correctly handles 'txtPrefix' and 'txtSuffix' arguments when both are provided. ([#5250](https://github.com/kubernetes-sigs/external-dns/pull/5250)) _@ivankatliarchuk_
 - Add missing types in the schema for empty values. ([#5228](https://github.com/kubernetes-sigs/external-dns/pull/5228)) _@ivankatliarchuk_
 - Add missing types in the schema for empty values. ([#5207](https://github.com/kubernetes-sigs/external-dns/pull/5207)) _@t3mi_
+- Fixed wrong type definitions for webhook probes. ([#5297](https://github.com/kubernetes-sigs/external-dns/pull/5297)) _@semnell_
path: charts/external-dns/CHANGELOG.md
user: login: stevehipwell
body: @semnell this needs adding under `[UNRELEASED]`.

```markdown
## [UNRELEASED]

### Fixed

- Fixed wrong type definitions for webhook probes. ([#5297](https://github.com/kubernetes-sigs/external-dns/pull/5297)) _@semnell_
```
created_at: 2025-04-17T11:24:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -263,24 +263,23 @@ provider:  # @schema type: [object, string];
     # @default -- See _values.yaml_
     livenessProbe:
       httpGet:
-        path: /healthz
-        port: http-webhook
-      initialDelaySeconds: 10
-      periodSeconds: 10
-      timeoutSeconds: 5
-      failureThreshold: 2
-      successThreshold: 1
+        path: /healthz  # @schema type:[string, null]; default: null
+        port: http-webhook  # @schema type:[integer,string]; default: string
+      initialDelaySeconds: 10  # @schema type:[integer, null]; default: null
+      periodSeconds: 10  # @schema type:[integer, null]; default: null
+      timeoutSeconds: 5  # @schema type:[integer, null]; default: null
+      failureThreshold: 2  # @schema type:[integer, null]; default: null
+      successThreshold: 1  # @schema type:[integer, null]; default: null
     # -- [Readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) configuration for the `webhook` container.
-    # @default -- See _values.yaml_
path: charts/external-dns/values.yaml
user: login: stevehipwell
body: I think this needs putting back or it also needs removing from the liveness probe.
created_at: 2025-04-17T11:25:29Z
author_association: CONTRIBUTOR
diff_hunk: @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Correctly handles 'txtPrefix' and 'txtSuffix' arguments when both are provided. ([#5250](https://github.com/kubernetes-sigs/external-dns/pull/5250)) _@ivankatliarchuk_
 - Add missing types in the schema for empty values. ([#5228](https://github.com/kubernetes-sigs/external-dns/pull/5228)) _@ivankatliarchuk_
 - Add missing types in the schema for empty values. ([#5207](https://github.com/kubernetes-sigs/external-dns/pull/5207)) _@t3mi_
+- Fixed wrong type definitions for webhook probes. ([#5297](https://github.com/kubernetes-sigs/external-dns/pull/5297)) _@semnell_
path: charts/external-dns/CHANGELOG.md
user: login: semnell
body: I was just fixing that, i was too late to be unnoticed :) 
created_at: 2025-04-17T11:26:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -263,24 +263,23 @@ provider:  # @schema type: [object, string];
     # @default -- See _values.yaml_
     livenessProbe:
       httpGet:
-        path: /healthz
-        port: http-webhook
-      initialDelaySeconds: 10
-      periodSeconds: 10
-      timeoutSeconds: 5
-      failureThreshold: 2
-      successThreshold: 1
+        path: /healthz  # @schema type:[string, null]; default: null
+        port: http-webhook  # @schema type:[integer,string]; default: string
+      initialDelaySeconds: 10  # @schema type:[integer, null]; default: null
+      periodSeconds: 10  # @schema type:[integer, null]; default: null
+      timeoutSeconds: 5  # @schema type:[integer, null]; default: null
+      failureThreshold: 2  # @schema type:[integer, null]; default: null
+      successThreshold: 1  # @schema type:[integer, null]; default: null
     # -- [Readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) configuration for the `webhook` container.
-    # @default -- See _values.yaml_
path: charts/external-dns/values.yaml
user: login: semnell
body: You're right, fixed.
created_at: 2025-04-17T11:27:49Z
author_association: CONTRIBUTOR

PR comments:
user: login: k8s-ci-robot
created_at: 2025-04-15T13:49:56Z
body: Hi @semnell. Thanks for your PR.

I'm waiting for a [kubernetes-sigs](https://github.com/orgs/kubernetes-sigs/people) member to verify that this patch is reasonable to test. If it is, they should reply with `/ok-to-test` on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should [join the org](https://git.k8s.io/community/community-membership.md#member) to skip this step.

Once the patch is verified, the new status will be reflected by the `ok-to-test` label.

I understand the commands that are listed [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fexternal-dns).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
</details>

author_association: CONTRIBUTOR
user: login: stevehipwell
created_at: 2025-04-15T14:33:12Z
body: CC @ivankatliarchuk 
author_association: CONTRIBUTOR
user: login: ivankatliarchuk
created_at: 2025-04-15T18:28:33Z
body: /ok-to-test
author_association: MEMBER
user: login: semnell
created_at: 2025-04-15T20:42:35Z
body: The tests seem to fail with 'race detected', i don't believe this change should/could cause that? 

If im mistaken please let me know and i'll check it out.
author_association: CONTRIBUTOR
user: login: semnell
created_at: 2025-04-15T20:49:57Z
body: Running `make test` locally seems fine..

```bash
ok      sigs.k8s.io/external-dns/provider/aws   28.205s coverage: 85.4% of statements
ok      sigs.k8s.io/external-dns/provider/awssd 2.427s  coverage: 85.9% of statements
ok      sigs.k8s.io/external-dns/provider/azure 2.440s  coverage: 79.5% of statements
ok      sigs.k8s.io/external-dns/provider/civo  2.454s  coverage: 84.3% of statements
ok      sigs.k8s.io/external-dns/provider/cloudflare    2.042s  coverage: 80.6% of statements
ok      sigs.k8s.io/external-dns/provider/coredns       2.508s  coverage: 53.9% of statements
ok      sigs.k8s.io/external-dns/provider/digitalocean  2.142s  coverage: 81.8% of statements
ok      sigs.k8s.io/external-dns/provider/dnsimple      3.488s  coverage: 81.4% of statements
ok      sigs.k8s.io/external-dns/provider/exoscale      2.800s  coverage: 68.1% of statements
ok      sigs.k8s.io/external-dns/provider/gandi 3.335s  coverage: 83.9% of statements
ok      sigs.k8s.io/external-dns/provider/godaddy       3.447s  coverage: 61.5% of statements
ok      sigs.k8s.io/external-dns/provider/google        3.417s  coverage: 80.6% of statements
ok      sigs.k8s.io/external-dns/provider/ibmcloud      2.686s  coverage: 75.7% of statements
ok      sigs.k8s.io/external-dns/provider/inmemory      2.929s  coverage: 82.6% of statements
ok      sigs.k8s.io/external-dns/provider/linode        2.039s  coverage: 84.7% of statements
ok      sigs.k8s.io/external-dns/provider/ns1   2.852s  coverage: 81.6% of statements
ok      sigs.k8s.io/external-dns/provider/oci   3.012s  coverage: 75.9% of statements
ok      sigs.k8s.io/external-dns/provider/ovh   9.373s  coverage: 95.7% of statements
ok      sigs.k8s.io/external-dns/provider/pdns  3.109s  coverage: 65.9% of statements
ok      sigs.k8s.io/external-dns/provider/pihole        2.821s  coverage: 89.4% of statements
ok      sigs.k8s.io/external-dns/provider/plural        3.008s  coverage: 31.5% of statements
ok      sigs.k8s.io/external-dns/provider/rfc2136       3.017s  coverage: 56.5% of statements
ok      sigs.k8s.io/external-dns/provider/scaleway      3.055s  coverage: 69.6% of statements
ok      sigs.k8s.io/external-dns/provider/tencentcloud  2.980s  coverage: 84.3% of statements
        sigs.k8s.io/external-dns/provider/tencentcloud/cloudapi         coverage: 0.0% of statements
ok      sigs.k8s.io/external-dns/provider/transip       2.399s  coverage: 40.7% of statements
ok      sigs.k8s.io/external-dns/provider/ultradns      2.570s  coverage: 81.8% of statements
ok      sigs.k8s.io/external-dns/provider/webhook       2.597s  coverage: 65.9% of statements
ok      sigs.k8s.io/external-dns/provider/webhook/api   2.732s  coverage: 89.7% of statements
ok      sigs.k8s.io/external-dns/registry       2.403s  coverage: 89.9% of statements
ok      sigs.k8s.io/external-dns/source 8.533s  coverage: 76.2% of statements
42.80s user 13.43s system 148% cpu 37.787s total
```
author_association: CONTRIBUTOR
user: login: semnell
created_at: 2025-04-15T21:06:31Z
body: /retest

author_association: CONTRIBUTOR
user: login: ivankatliarchuk
created_at: 2025-04-16T07:12:15Z
body: Any chance you add a test to json schema validator here https://github.com/kubernetes-sigs/external-dns/blob/master/charts/external-dns/tests/json-schema_test.yaml with livenessProbe and readinessProbe values set to null. The schema is going to support nulls, not a problem, the helm templates itself may panic or smth.
author_association: MEMBER
user: login: semnell
created_at: 2025-04-17T08:51:58Z
body: I've added some tests, im not familiar with this type of testing so i hope this is sufficient. 
author_association: CONTRIBUTOR
user: login: semnell
created_at: 2025-04-17T09:55:34Z
body: The linting issue is something i can't recreate locally:

```bash
❯ ct lint --target-branch=master --check-version-increment=false
Linting charts...

------------------------------------------------------------------------------------------------------------------------
No chart changes detected.
------------------------------------------------------------------------------------------------------------------------
All charts linted successfully
```
author_association: CONTRIBUTOR
user: login: ivankatliarchuk
created_at: 2025-04-17T10:13:38Z
body: The ci is still failing. 
![Screenshot 2025-04-17 at 11 13 08](https://github.com/user-attachments/assets/4ba93502-fee9-45fa-931f-181e6b0be909)

author_association: MEMBER
user: login: stevehipwell
created_at: 2025-04-17T11:22:38Z
body: /label tide/merge-method-squash
author_association: CONTRIBUTOR
user: login: stevehipwell
created_at: 2025-04-17T11:33:05Z
body: @ivankatliarchuk do you want to add the LGTM?

/approve
author_association: CONTRIBUTOR
user: login: k8s-ci-robot
created_at: 2025-04-17T11:34:28Z
body: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/external-dns/pull/5297#pullrequestreview-2775432464" title="LGTM">ivankatliarchuk</a>*, *<a href="https://github.com/kubernetes-sigs/external-dns/pull/5297#issuecomment-2812579020" title="Approved">stevehipwell</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fexternal-dns).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[charts/OWNERS](https://github.com/kubernetes-sigs/external-dns/blob/master/charts/OWNERS)~~ [stevehipwell]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
author_association: CONTRIBUTOR