nephio-project / sig-release

SIG Release will govern the Nephio release process and manage the releases.
Apache License 2.0
1 stars 4 forks source link

playbooks/library/kpt.py: does not fail on fatal error from kpt #33

Open johnbelamaric opened 1 year ago

johnbelamaric commented 1 year ago

While testing out the e2e scripts, I was seeing a problem where some packages were not getting applied. It turns out I had a typo in my "version":

    - {pkg: configsync, version: config-sync/v1, namespaces: [config-management-monitoring, config-management-system, resource-group-system]}

The tag config-sync/v1 does not exist; the correct tag is configsync/v1. When running kpt pkg get manually, I get this:

jbelamaric@nephio-r1-e2e:~$ /usr/local/bin/kpt pkg get https://github.com/nephio-project/nephio-example-packages.git/configsync@config-sync/v1 /tmp/jj
Package "jj":
Fetching https://github.com/nephio-project/nephio-example-packages@config-sync/v1
Error: Unknown ref "config-sync/v1". Please verify that the reference exists in upstream repo "https://github.com/nephio-project/nephio-example-packages".

Details:
fatal: ambiguous argument 'config-sync/v1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

jbelamaric@nephio-r1-e2e:~$ echo $?
1

With a correct tag, the return value is 0.

I think the kpt.py should fail on a non-zero return value from kpt.

johnbelamaric commented 1 year ago

/assign @electrocucaracha @vjayaramrh

electrocucaracha commented 1 year ago

We need to improve the error handling in Ansible Module and remove all the errors ignored in its ansible role