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

istioctl install: validate --revision param #28778

Merged
merged 1 commit into from
Nov 11, 2020

Conversation

shamsher31
Copy link
Member

@shamsher31 shamsher31 commented Nov 11, 2020

Found during #28745

Before:
The existing validation was wrong which does not check for invalid --revision.

$ ./out/linux_amd64/istioctl install -r "1.8:" --set hub=gcr.io/istio-testing -d manifests/
Error: invalid revision specified:
name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName',  or 'my.name',  or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')
$ ./out/linux_amd64/istioctl install -r 1.8 --set hub=gcr.io/istio-testing -d manifests/
Error: failed to get profile and enabled components: failed to generate IOP from profile default:
could not unmarshal merged YAML: json: cannot unmarshal number into Go value of type string

After:

$ ./out/linux_amd64/istioctl install -r 1.8.0 --set hub=gcr.io/istio-testing -d manifests/
Error: failed to get profile and enabled components: failed to read profile: validation errors (use --force to override): 
invalid revision specified: 1.8.0

@shamsher31 shamsher31 added area/environments/operator Issues related to Operator or installation release-notes-none Indicates a PR that does not require release notes. labels Nov 11, 2020
@shamsher31 shamsher31 added this to the 1.8 milestone Nov 11, 2020
@shamsher31 shamsher31 requested a review from a team as a code owner November 11, 2020 06:10
@shamsher31 shamsher31 self-assigned this Nov 11, 2020
@google-cla google-cla bot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Nov 11, 2020
@istio-testing istio-testing added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 11, 2020
@shamsher31
Copy link
Member Author

/test integ-security-k8s-tests_istio

@Monkeyanator
Copy link
Contributor

worth adding a test in install_test.go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/environments/operator Issues related to Operator or installation cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. release-notes-none Indicates a PR that does not require release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants