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

Update Kustomize to the ArgoCD Kustomize version #268

Closed
alexisbel1 opened this issue Oct 2, 2021 · 4 comments · Fixed by #274
Closed

Update Kustomize to the ArgoCD Kustomize version #268

alexisbel1 opened this issue Oct 2, 2021 · 4 comments · Fixed by #274
Labels
enhancement New feature or request

Comments

@alexisbel1
Copy link

Is your feature request related to a problem? Please describe.
When the Image Updater updates the image tag in the kustomization.yaml, it can fail because some Kustomize v4.2 (the latest version used in ArgoCD) features are not supported in Kustomize v2.0 (current version used in Image Updater).

Example of error with the following kustomization.yaml which work with ArgoCD:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../kustomize/internal-api

configurations:
- kustomizeconfig/application.yaml

images:
- name: registry/configuration-data-api
  newTag: v1.5.0

patches:
- path: patch.yaml
  target:
    group: core.oam.dev
    kind: Application
    name: configuration-data-api
    namespace: internal-api
    version: v1beta1

Error:

level=error msg="Could not update application spec: error unmarshaling JSON: json: cannot unmarshal object into Go struct field Kustomization.patchesStrategicMerge of type patch.StrategicMerge" application=internal-api-dev

Describe the solution you'd like
Update the Kustomize go library to the latest used by ArgoCD.

Describe alternatives you've considered
Don't update the kustomization.yaml but the .argocd-source-<appName>.yaml.

@jannfis
Copy link
Contributor

jannfis commented Oct 8, 2021

I've looked into this, and it's not as simple as it looks like.

The 4.2.0 version of Kustomize uses a version of github.com/go-openapi which is incompatible with the current Argo CD Open API spec used in v2.1.x.

So most likely, we'll also need a change in Argo CD for this.

@jannfis
Copy link
Contributor

jannfis commented Oct 8, 2021

Thinking a little further, maybe we should rather use fork/exec of the Kustomize binary like Argo CD does, instead of using the Kustomize API directly.

@ghost
Copy link

ghost commented Oct 12, 2021

Hi! Is there an ETA for this issue?

@j3r3my
Copy link

j3r3my commented Oct 18, 2021

+1 for an update on this. Currently writebacks for our cluster are broken with this issue.

jannfis pushed a commit that referenced this issue Oct 21, 2021
* fix: use kyaml to preserve kustomization

fixes #250
fixes #268
fixes #247

* chore: linter error

* fix: tests and linting

* go mod tidy
sribiere-jellysmack pushed a commit to sribiere-jellysmack/argocd-image-updater that referenced this issue Aug 13, 2024
* fix: use kyaml to preserve kustomization

fixes argoproj-labs#250
fixes argoproj-labs#268
fixes argoproj-labs#247

* chore: linter error

* fix: tests and linting

* go mod tidy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants