jenkins-x-plugins / jenkins-x-plugins/jx-gitops
`jx gitops upgrade` not respecting the `--dir` argument
- Dominant language
- Go
- Stars
- 35
- Forks
- 53
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 7
Description
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.