pipe-cd/pipecd

Support `--force-conflicts` option for kubectl Server-Side Apply

Open

#4,639 opened on Oct 30, 2023

View on GitHub
 (5 comments) (0 reactions) (1 assignee)Go (319 forks)auto 404
good first issue

Repository metrics

Stars
 (1,329 stars)
PR merge metrics
 (PR metrics pending)

Description

What would you like to be added: Support --force-conflicts option for kubectl Server-Side Apply.

Why is this needed: When use a KubernetesApp, with PipeCD Server-Side Apply, a piped gets the error, Failed to apply manifest, for a resource that has applied with Client-Side Apply and has been modified.

Failed to apply manifest: name="XXX", kind="XXX", namespace="XXX", apiVersion="XXX" (%!w(*fmt.wrapError=&{failed to apply: error: Operation cannot be fulfilled on XXX "XXX": the object has been modified; please apply your changes to the latest version and try again
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 http://k8s.io/docs/reference/using-api/api-concepts/#conflicts
 (exit status 1) 0xc0260e7160}))

Contributor guide