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

jx gitops upgrade not respecting the --dir argument #907

Open
nikki-quant opened this issue Nov 1, 2022 · 0 comments
Open

jx gitops upgrade not respecting the --dir argument #907

nikki-quant opened this issue Nov 1, 2022 · 0 comments

Comments

@nikki-quant
Copy link

nikki-quant commented Nov 1, 2022

Hello good JX community,

I'm working on a project where we use custom project templates that have some different needs:

  1. Build pipeline upgrades we want to be fully consistent across all projects, and so want to use the force-delete-replace update strategy
  2. The Helm chart we want to create from a template once but then would expect to merge changes into carefully using a less brute-force strategy

The help text for jx gitops upgrade suggests it should be possible to replace only my Tekton pipelines in .lighthouse/jenkins-x by passing the --dir and --strategy arguments, like so:

jx gitops upgrade —-dir .lighthouse/jenkins-x --strategy force-delete-replace

But in fact it tries to touch the other directories with a Kptfile in as well:

% jx gitops upgrade —-dir '.lighthouse/jenkins-x' --strategy force-delete-replace --verbose
upgrading local source code from the version stream using kpt...

no strategy configuration file .jx/gitops/kpt-strategy.yaml found so using default merge strategies
processing kpt directory: .lighthouse/jenkins-x wth strategy: force-delete-replace
processing kpt directory: charts/MYCHART wth strategy: force-delete-replace
error: failed to update source using kpt: failed to upgrade kpt packages in dir CHARTDIR: failed to run kpt command: failed to run '/BLAH/.jx-gitops/plugins/bin/kpt-0.37.0 pkg update charts/MYCHART@master --strategy force-delete-replace' command in directory '/BLAH', output: 'updating package charts/MYCHART to master
error: unable to read package Kptfile: charts/MYCHART Kptfile missing upstream.git.commit'

Running what I'd guess is the equivalent operation manually using the bundled kpt binary that jx gitops uses works as expected:

.jx-gitops/plugins/bin/kpt-0.37.0 pkg update .lighthouse/jenkins-x --strategy force-delete-replace

Anyone got any idea why the jx wrapper is not managing the same? I will try and look through the source code for clues but I've not worked with go before.

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

No branches or pull requests

1 participant