Skip to content
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

Replace deprecated patchesStrategicMerge with patches in flux kustomization #7207

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

jiayiwang7
Copy link
Member

Issue #, if available:

When EKS-A executing flux bootstrap failed with error:

❌ Error when installing GitOps toolkits on workload cluster; EKS-A will continue with cluster creation, but GitOps will not be enabled {"error": "installing GitHub gitops: executing flux bootstrap github: ► connecting to github.com\n► cloning branch \"main\" from Git repository \"https://github.com/tatlat/testGitopsRepo-.git\"\n✔ cloned repository\n► generating component manifests\n✔ generated component manifests\n✔ component manifests are up to date\n✔ reconciled components\n► determining if source secret \"default/flux-system\" exists\n✔ source secret up to date\n► generating sync manifests\n✔ generated sync manifests\n✔ sync manifests are up to date\n► applying sync manifests\n# Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.\n✔ reconciled sync configuration\n◎ waiting for Kustomization \"default/default\" to be reconciled\n✔ Kustomization reconciled successfully\n► confirming components are healthy\n✗ helm-controller: deployment not ready\n✔ kustomize-controller: deployment ready\n✔ notification-controller: deployment ready\n✔ source-controller: deployment ready\n✗ bootstrap failed with 1 health check failure(s)\n"}

The helm controller is in crashing loop with error stating not able to find helm.toolkit.fluxcd.io/v2beta2 API resource:

{"level":"error","ts":"2023-12-19T16:41:31.504Z","logger":"setup","msg":"unable to create controller","controller":"HelmRelease","error":"failed to get API group resources: unable to retrieve the complete list of server APIs: helm.toolkit.fluxcd.io/v2beta2: the server could not find the requested resource"}

This is caused by EKS-A dev build uses Flux CLI v2.1.x which is not compatible with the helm controller image v0.37.x: the Flux v2.1.x does not install helm.toolkit.fluxcd.io/v2beta2 API version CRD which is required in the helm controller v0.37.x.

Description of changes:

In order to solve the problem, we need to bump the Flux CLI version to v2.2.x and make sure all the Flux controllers version are compatible with it based of: https://github.com/fluxcd/flux2/releases. @abhay-krishna will follow up a PR in build tooling repo to bump the versions.

This PR only solves the warning message in the CLI Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically. We replace the deprecated patchesStrategicMerge with patches in flux system kustomization.

Testing (if applicable):

--- PASS: TestDockerKubernetes128GithubFlux (961.03s)

Documentation added/planned (if applicable):

N/A

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@eks-distro-bot eks-distro-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 19, 2023
@jiayiwang7 jiayiwang7 requested a review from tatlat December 19, 2023 20:07
@tatlat
Copy link
Member

tatlat commented Dec 19, 2023

/lgtm

Copy link

codecov bot commented Dec 19, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (724268d) 71.59% compared to head (5651fcd) 71.59%.

Files Patch % Lines
pkg/gitops/flux/upgrader.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7207      +/-   ##
==========================================
- Coverage   71.59%   71.59%   -0.01%     
==========================================
  Files         548      548              
  Lines       42532    42521      -11     
==========================================
- Hits        30452    30441      -11     
  Misses      10386    10386              
  Partials     1694     1694              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jiayiwang7
Copy link
Member Author

/approve

@eks-distro-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jiayiwang7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tatlat
Copy link
Member

tatlat commented Dec 20, 2023

/lgtm

@jiayiwang7
Copy link
Member Author

/retest

@eks-distro-bot eks-distro-bot merged commit 444d9ad into aws:main Dec 20, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants