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

OCM-12391 | feat: Add 'version' flag to wif-config create and update commands #698

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JakobGray
Copy link
Contributor

@JakobGray JakobGray commented Dec 18, 2024

Version flag expects a string representing an Openshift minor release in the form 'X.Y'. On create this sets the wif template used by the wif config. On upgrade, the version is added to the list of templates.

Given a version like 4.17, the CLI will parse that it is in X.Y form and convert it to the expected wif template id form v4.17. Otherwise it will pass the input directly for the backend to validate.

Example use:

➜  ocm-cli git:(OCM-12391) ✗ go run ./cmd/ocm gcp create wif-config --name=jdg3 --project=sda-ccs-1 --version=4.17 --mode=manual

The flag can also be set during interactive create mode:

➜  ocm-cli git:(OCM-12391) ✗ go run ./cmd/ocm gcp create wif-config --mode=manual -i
? wif-config name: name
? Gcp Project ID: sda-ccs-1
? The OCP version to configure the wif-config for. Will default to the latest supported version if left unset.
? Openshift version: 

Manual Mode
Script generated by manually running an update with two versions: apply.txt
This doubles the number of roles to create and update

Tests run

  • Returning 400 when giving an invalid version input
  • Update adds new roles for version, and old roles from existing version if missing
  • Update generates script covering both versions assigned
  • Verify command passes following an update

Issues:
OCM-12391
OCM-12396

Copy link
Collaborator

@renan-campos renan-campos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a constant name that should be fixed. We must communicate to the user that leaving the version option empty during wif-config creation will result in a wif-config that uses the latest version.

cmd/ocm/gcp/create-wif-config.go Outdated Show resolved Hide resolved
Version will set the wif_templates field of the wif-config.
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

Successfully merging this pull request may close these issues.

2 participants