Skip to content

fix: CRS generated CA Deployment has extra quotes #867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 19, 2024

Conversation

dkoshkin
Copy link
Contributor

@dkoshkin dkoshkin commented Aug 15, 2024

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 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?:

Special notes for your reviewer:

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

WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{

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

@dkoshkin dkoshkin requested a review from jimmidyson August 15, 2024 21:45
@github-actions github-actions bot added fix and removed fix labels Aug 15, 2024
@jimmidyson
Copy link
Member

@dkoshkin So with this error the deployment shows as ready but it's not working properly so we should check the status configmap too?

@dkoshkin
Copy link
Contributor Author

dkoshkin commented Aug 16, 2024

@dkoshkin So with this error the deployment shows as ready but it's not working properly so we should check the status configmap too?

Yep! Attempt on the check here f203f8a.

@dkoshkin dkoshkin force-pushed the dkoshkin/fix-crs-fix-extra-quotes branch 2 times, most recently from 8b58d09 to 4aa91d8 Compare August 16, 2024 02:09
@dkoshkin dkoshkin force-pushed the dkoshkin/fix-crs-fix-extra-quotes branch from 4aa91d8 to f203f8a Compare August 16, 2024 02:48
@dkoshkin
Copy link
Contributor Author

The new ConfigMap test failed as expected without this fix #868 (comment)

Copy link
Member

@jimmidyson jimmidyson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing it and improving the tests!

@jimmidyson jimmidyson enabled auto-merge (squash) August 19, 2024 14:55
@jimmidyson jimmidyson merged commit b796e7d into main Aug 19, 2024
15 checks passed
@jimmidyson jimmidyson deleted the dkoshkin/fix-crs-fix-extra-quotes branch August 19, 2024 15:00
dlipovetsky pushed a commit that referenced this pull request Aug 20, 2024
🤖 I have created a release *beep* *boop*
---


## 0.14.3 (2024-08-20)

<!-- Release notes generated using configuration in .github/release.yaml
at main -->

## What's Changed
### Fixes 🔧
* fix: CRS generated CA Deployment has extra quotes by @dkoshkin in
#867
* fix: Use same security context & priority class for helm-repository
pod by @jimmidyson in
#871
### Other Changes
* build: Include debug symbols in release image executable by
@dlipovetsky in
#873
* build: Use new clusterctl-aws name for clusterawsadm by @jimmidyson in
#863


**Full Changelog**:
v0.14.2...v0.14.3

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants