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

"server" apply strategy fails to apply with conflicts when Flux in use #852

Open
iainlane opened this issue May 2, 2023 · 3 comments
Open

Comments

@iainlane
Copy link
Member

iainlane commented May 2, 2023

We have Flux (v2) managing our deployments.

We wanted to try server-side applies which are supported by tanka. Since my environment here is an inline environment I added tanka.environment.withApplyStrategy('server') to its tanka.environment.new() call. Then running tk apply failed like this:

Please type 'yes' to confirm: yes
error: Apply failed with 1 conflict: conflict with "kustomize-controller": .spec
Please review the fields above--they currently have other managers. Here
are the ways you can resolve this warning:
* If you intend to manage all of these fields, please re-run the apply
  command with the `--force-conflicts` flag.
* If you do not intend to manage all of the fields, please edit your
  manifest to remove references to the fields that should keep their
  current managers.
* You may co-own fields by updating your manifest to match the existing
  value; in this case, you'll become the manager if the other manager(s)
  stop managing the field (remove it from their configuration).
See https://kubernetes.io/docs/reference/using-api/server-side-apply/#conflicts
Error: exit status 1

Same would probably happen in the spec.json instead.

I didn't try but tk apply --force would probably have worked. Maybe an extra field on the spec to set force would do it? Not sure if that would mess with Flux and stop it reconciling. The expectation would be these updates are overwritten by Flux unless you have suspended the Kustomization.

@frimik
Copy link

frimik commented Dec 12, 2023

argv = append(argv, "--force-conflicts")

--force is mapped inside of tanka to mean --force-conflicts when used along with the server-side apply strategy 👍

@zerok
Copy link
Contributor

zerok commented May 28, 2024

So basically the outcome of that issue should be an additional to the environment spec that controls the force flag?

@iainlane
Copy link
Member Author

Not sure. Could server imply using --force all the time and then you don't need to set two flags to use server in this configuration (with flux)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In discussion
Development

No branches or pull requests

3 participants