Skip to content

Commit

Permalink
fix: Filter out control plane endpoint from Nutanix node IPs (#881)
Browse files Browse the repository at this point in the history
**What problem does this PR solve?**:

**Which issue(s) this PR fixes**:
Fixes #

**How Has This Been Tested?**:
<!--
Please describe the tests that you ran to verify your changes.
Provide output from the tests and any manual steps needed to replicate
the tests.
-->

**Special notes for your reviewer**:
<!--
Use this to provide any additional information to the reviewers.
This may include:
- Best way to review the PR.
- Where the author wants the most review attention on.
- etc.
-->
  • Loading branch information
jimmidyson authored Aug 25, 2024
1 parent d49bc03 commit 710e9e1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ data:
{{ `{{- with .PrismCentralAdditionalTrustBundle }}` }}
prismCentralAdditionalTrustBundle: {{ `{{ printf "%q" . }}` }}
{{ `{{- end }}` }}
{{ `{{- with .ControlPlaneEndpointHost }}` }}
ignoredNodeIPs: [ {{ `{{ printf "%q" . }}` }} ]
{{ `{{- end }}` }}
# The Secret containing the credentials will be created by the handler.
createSecret: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data:
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes-sigs.github.io/node-feature-discovery/charts{{ end }}
nutanix-ccm: |
ChartName: nutanix-cloud-provider
ChartVersion: 0.4.0
ChartVersion: 0.4.1
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://nutanix.github.io/helm/{{ end }}
nutanix-storage-csi: |
ChartName: nutanix-csi-storage
Expand Down
2 changes: 1 addition & 1 deletion hack/addons/mindthegap-helm-registry/repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ repositories:
repoURL: https://nutanix.github.io/helm/
charts:
nutanix-cloud-provider:
- 0.4.0
- 0.4.1
nutanix-csi-storage:
repoURL: https://nutanix.github.io/helm-releases/
charts:
Expand Down
2 changes: 1 addition & 1 deletion make/addons.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export AWS_CCM_VERSION_128 := v1.28.6
export AWS_CCM_VERSION_129 := v1.29.3
export AWS_CCM_VERSION_130 := v1.30.1

export NUTANIX_CCM_CHART_VERSION := 0.4.0
export NUTANIX_CCM_CHART_VERSION := 0.4.1

export KUBE_VIP_VERSION := v0.8.1

Expand Down
2 changes: 2 additions & 0 deletions pkg/handlers/generic/lifecycle/ccm/nutanix/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func templateValuesFunc(
PrismCentralPort int32
PrismCentralInsecure bool
PrismCentralAdditionalTrustBundle string
ControlPlaneEndpointHost string
}

address, port, err := nutanixConfig.PrismCentralEndpoint.ParseURL()
Expand All @@ -160,6 +161,7 @@ func templateValuesFunc(
PrismCentralPort: port,
PrismCentralInsecure: nutanixConfig.PrismCentralEndpoint.Insecure,
PrismCentralAdditionalTrustBundle: nutanixConfig.PrismCentralEndpoint.AdditionalTrustBundle,
ControlPlaneEndpointHost: nutanixConfig.ControlPlaneEndpoint.Host,
}

var b bytes.Buffer
Expand Down
8 changes: 8 additions & 0 deletions pkg/handlers/generic/lifecycle/ccm/nutanix/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ prismCentralEndPoint: prism-central.nutanix.com
prismCentralPort: 9440
prismCentralInsecure: false
prismCentralAdditionalTrustBundle: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVjekNDQTF1Z0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRUUZBRC4uQWtHQTFVRUJoTUNSMEl4CkV6QVJCZ05WQkFnVENsTnZiV1V0VTNSaGRHVXhGREFTQmdOVkJBb1RDMC4uMEVnVEhSa01UY3dOUVlEClZRUUxFeTVEYkdGemN5QXhJRkIxWW14cFl5QlFjbWx0WVhKNUlFTmxjbi4uWFJwYj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UmtNVGN3TlFZRFZRUUxFeTVEYkdGemN5QXhJRkIxWW14cFl5QlFjbS4uRU5sY25ScFptbGpZWFJwCmIyNGdRWFYwYUc5eWFYUjVNUlF3RWdZRFZRUURFd3RDWlhOMElFTkJJRS4uREFNQmdOVkhSTUVCVEFECkFRSC9NQTBHQ1NxR1NJYjNEUUVCQkFVQUE0SUJBUUMxdVlCY3NTbmN3QS4uRENzUWVyNzcyQzJ1Y3BYCnhRVUUvQzBwV1dtNmdEa3dkNUQwRFNNREpScVYvd2VvWjR3QzZCNzNmNS4uYkxoR1lIYVhKZVNENktyClhjb093TGRTYUdtSllzbExLWkIzWklERXAwd1lUR2hndGViNkpGaVR0bi4uc2YyeGRyWWZQQ2lJQjdnCkJNQVY3R3pkYzRWc3BTNmxqckFoYmlpYXdkQmlRbFFtc0JlRno5SmtGNC4uYjNsOEJvR04rcU1hNTZZCkl0OHVuYTJnWTRsMk8vL29uODhyNUlXSmxtMUwwb0E4ZTRmUjJ5ckJIWC4uYWRzR2VGS2t5TnJ3R2kvCjd2UU1mWGRHc1JyWE5HUkduWCt2V0RaMy96V0kwam9EdENrTm5xRXBWbi4uSG9YCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0="
ignoredNodeIPs: [ "1.2.3.4" ]
# The Secret containing the credentials will be created by the handler.
createSecret: false
Expand All @@ -40,6 +41,7 @@ secretName: nutanix-ccm-credentials`
prismCentralEndPoint: prism-central.nutanix.com
prismCentralPort: 9440
prismCentralInsecure: true
ignoredNodeIPs: [ "1.2.3.4" ]
# The Secret containing the credentials will be created by the handler.
createSecret: false
Expand Down Expand Up @@ -91,6 +93,9 @@ func Test_templateValues(t *testing.T) {
),
AdditionalTrustBundle: testCertBundle,
},
ControlPlaneEndpoint: v1alpha1.ControlPlaneEndpointSpec{
Host: "1.2.3.4",
},
},
},
in: valuesTemplate,
Expand Down Expand Up @@ -118,6 +123,9 @@ func Test_templateValues(t *testing.T) {
),
Insecure: true,
},
ControlPlaneEndpoint: v1alpha1.ControlPlaneEndpointSpec{
Host: "1.2.3.4",
},
},
},
in: valuesTemplate,
Expand Down

0 comments on commit 710e9e1

Please sign in to comment.