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-5281 | Feat | Add region validation from ocm-shards and list regions command #586

Merged
merged 4 commits into from
Feb 6, 2024

Conversation

tirthct
Copy link
Contributor

@tirthct tirthct commented Dec 12, 2023

Changed

  • Modified ocm login command to pass the region name (with or without rh prefix)
  • Add package to get and validate regions
  • Add list regions command

Tested

  • Region name passed in should be validated from ocm-shards
  • list rh-regions should show all available region names

@tirthct tirthct changed the title Add region validation from ocm-shards and list regions command OCM-5281 | Feat | Add region validation from ocm-shards and list regions command Dec 12, 2023
cmd/ocm/login/cmd.go Outdated Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
pkg/rhRegion/rhRegion.go Outdated Show resolved Hide resolved
pkg/rhRegion/rhRegion.go Outdated Show resolved Hide resolved
pkg/rhRegion/rhRegion.go Outdated Show resolved Hide resolved
pkg/rhRegion/rhRegion.go Outdated Show resolved Hide resolved
cmd/ocm/login/cmd.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
pkg/rhRegion/rhRegion.go Outdated Show resolved Hide resolved
cmd/ocm/login/cmd.go Outdated Show resolved Hide resolved
@macgregor
Copy link
Contributor

lgtm, thanks Tirth!

@tirthct tirthct marked this pull request as ready for review February 1, 2024 18:57
@macgregor
Copy link
Contributor

lgtm

cmd/ocm/list/cmd.go Outdated Show resolved Hide resolved
Copy link
Contributor

@markturansky markturansky left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@markturansky markturansky left a comment

Choose a reason for hiding this comment

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

LGTM

Use: "rh-regions",
Short: "List available OCM regions",
Long: "List available OCM regions",
Example: ` # List all supported OCM regions ocm list rh-regions`,
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be ocm list rh-regions only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Example sections in other files have the same format : https://github.com/openshift-online/ocm-cli/blob/main/cmd/ocm/list/version/cmd.go#L38

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, but IMO that's not really helpful.

go 1.18
go 1.21
Copy link
Contributor

Choose a reason for hiding this comment

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

is the go version update required here? I'm wondering if it can/should be handled in a separate MR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OCM SDK uses latest golang : openshift-online/ocm-sdk-go@1252182#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6
We can create a separate MR here though.

Copy link
Contributor

@cristianoveiga cristianoveiga left a comment

Choose a reason for hiding this comment

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

LGTM

@cristianoveiga cristianoveiga merged commit fab7ccf into openshift-online:main Feb 6, 2024
4 checks passed
@tirthct tirthct deleted the ocm-5281 branch February 6, 2024 18:03
tylercreller added a commit to tylercreller/ocm-cli that referenced this pull request Feb 6, 2024
* OCM-4962 | Feat | Add OAuth login using PKCE (openshift-online#590)

* OCM-5759 | feat: Add Device Code Flow (openshift-online#591)

* OCM-5281 | Feat | Add region validation from ocm-shards and list regions command (openshift-online#586)

* Add region validation from ocm-shards and list regions command

* Fixed mior debug changes

* Marked rh region list flag hidden in cmd

* Formatting change in example section in cmd file

* OCM-4964: Secure store config

* OCM-4964: Go mod tidy

* OCM-4964: go mod tidy

* OCM-4964: Secure store updates

* OCM-4965: Use keyring for oauth flows

* Temp: modify pub/release for testing

* Add auth method password

* Missed auth method test

---------

Co-authored-by: tirthct <[email protected]>
@tylercreller tylercreller mentioned this pull request Mar 11, 2024
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.

4 participants