You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: CRS generated CA Deployment has extra quotes (#867)
**What problem does this PR solve?**:
Fixes an issue with CRS genertated CA Deployment not working because of
extra quotes.
```
I0815 20:12:58.376871 1 reflector.go:332] Listing and watching cluster.x-k8s.io/v1beta1, Resource=machines from k8s.io/client-go/dynamic/dynamicinformer/informer.go:108
W0815 20:12:58.379140 1 reflector.go:547] k8s.io/client-go/dynamic/dynamicinformer/informer.go:108: failed to list cluster.x-k8s.io/v1beta1, Resource=machines: machines.cluster.x-k8s.io is forbidden: User "system:serviceaccount:default:cluster-autoscaler-0191579a-2104-7ace-a5a2-ceae4590d7fe" cannot list resource "machines" in API group "cluster.x-k8s.io" in the namespace "'default'"
E0815 20:12:58.379170 1 reflector.go:150] k8s.io/client-go/dynamic/dynamicinformer/informer.go:108: Failed to watch cluster.x-k8s.io/v1beta1, Resource=machines: failed to list cluster.x-k8s.io/v1beta1, Resource=machines: machines.cluster.x-k8s.io is forbidden: User "system:serviceaccount:default:cluster-autoscaler-0191579a-2104-7ace-a5a2-ceae4590d7fe" cannot list resource "machines" in API group "cluster.x-k8s.io" in the namespace "'default'"
```
The extra quotes are only an issue in `--node-group-auto-discovery=`,
but the [same
script](https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/blob/f632224257cb159b04abc2c6c6eb6874c503bb1c/hack/addons/update-cluster-autoscaler.sh#L28)
replaces all occurrences. It should be safe to drop the single quotes
everywhere though because the name and namespace will be strings and
won't be interpreted as numbers by yaml.
**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.
-->
~I think we can improve the e2e tests by checking that all Deployments
are Ready on the self-managed clusters, but I did not do that as part of
this PR.~ The tests already do that
https://github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/blob/f632224257cb159b04abc2c6c6eb6874c503bb1c/test/e2e/clusterautoscaler_helpers.go#L115
Instead we can also wait for the status ConfigMap to be `Running`
This is what the data will contain for a working Deployment:
```
data:
status: |+
time: 2024-05-22 19:33:34.074058252 +0000 UTC
autoscalerStatus: Running
```
And for non working:
```
data:
status: |+
time: 2024-08-15 20:07:37.204175116 +0000 UTC
autoscalerStatus: Initializing
```
Copy file name to clipboardExpand all lines: charts/cluster-api-runtime-extensions-nutanix/templates/cluster-autoscaler/manifests/cluster-autoscaler-configmap.yaml
+28-28Lines changed: 28 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -12,41 +12,41 @@ data:
12
12
kind: PodDisruptionBudget
13
13
metadata:
14
14
labels:
15
-
app.kubernetes.io/instance: 'ca-{{ `{{ index .Cluster.Annotations "caren.nutanix.com/cluster-uuid" }}` }}'
15
+
app.kubernetes.io/instance: ca-{{ `{{ index .Cluster.Annotations "caren.nutanix.com/cluster-uuid" }}` }}
0 commit comments