-
Notifications
You must be signed in to change notification settings - Fork 69
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
refactor: Refactor ocm methods out of register cmd file #1807
refactor: Refactor ocm methods out of register cmd file #1807
Conversation
…stomer-cloud dataplane clusters
9639359
to
80fe1ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Dropped some minor suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of suggestions, the main issue is the lack of tests 🙁
80fe1ed
to
4845af8
Compare
@andreaTP |
@@ -27,7 +28,8 @@ type options struct { | |||
selectedClusterMachinePool clustersmgmtv1.MachinePool | |||
requestedMachinePoolNodeCount int | |||
accessKafkasViaPrivateNetwork bool | |||
// newMachinePool clustersmgmtv1.MachinePool | |||
pageNumber int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Suggesting to use variable names page
and size
, since that's what we use for most of the commands.
@@ -68,20 +70,22 @@ func NewRegisterClusterCommand(f *factory.Factory) *cobra.Command { | |||
flags.StringVar(&opts.clusterManagementApiUrl, "cluster-mgmt-api-url", "", f.Localizer.MustLocalize("dedicated.registerCluster.flag.clusterMgmtApiUrl.description")) | |||
flags.StringVar(&opts.accessToken, "access-token", "", f.Localizer.MustLocalize("dedicated.registercluster.flag.accessToken.description")) | |||
flags.StringVar(&opts.selectedClusterId, "cluster-id", "", f.Localizer.MustLocalize("dedicated.registerCluster.flag.clusterId.description")) | |||
flags.IntVar(&opts.pageNumber, "page-number", int(cmdutil.ConvertPageValueToInt32(build.DefaultPageNumber)), f.Localizer.MustLocalize("dedicated.registerCluster.flag.pageNumber.description")) | |||
flags.IntVar(&opts.pageSize, "page-size", 100, f.Localizer.MustLocalize("dedicated.registerCluster.flag.pageSize.description")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Struck me while reviewing a different PR, why is the page size 100 here?
Can we use buid.defaultpagesize
here? 100 might be too large.
* feat: addition of descriptions and examples to dedicated * feat: Allows the CLI to install stage env addons when terraforming customer-cloud dataplane clusters * refactor: extraction of clustermgmt funcs from register to own dir * refactor: addresses cluster pagination and refactor of ocm functions
* feat: addition of descriptions and examples to dedicated * feat: Allows the CLI to install stage env addons when terraforming customer-cloud dataplane clusters * refactor: extraction of clustermgmt funcs from register to own dir * refactor: addresses cluster pagination and refactor of ocm functions
* feat: addition of descriptions and examples to dedicated * feat: Allows the CLI to install stage env addons when terraforming customer-cloud dataplane clusters * refactor: extraction of clustermgmt funcs from register to own dir * refactor: addresses cluster pagination and refactor of ocm functions
* feat: addition of descriptions and examples to dedicated * feat: Allows the CLI to install stage env addons when terraforming customer-cloud dataplane clusters * refactor: extraction of clustermgmt funcs from register to own dir * refactor: addresses cluster pagination and refactor of ocm functions
* feat: addition of descriptions and examples to dedicated * feat: Allows the CLI to install stage env addons when terraforming customer-cloud dataplane clusters * refactor: extraction of clustermgmt funcs from register to own dir * refactor: addresses cluster pagination and refactor of ocm functions
* Enterprise crete kafka interactive (#1819) * refactor: moving list enterprise clusters to util package * feat: start of interactive enterprise create * refactor: refactor of create kafka ams checks for enterprise quota (#1822) * feat: when using dedicated with kafka create, we now check the capacity of the cluster * refactor: refactor of the interactive create kafka cmd * refactor: refactoring dedicated list to use refactored search string func * refactor: refactor and addition of name + id of cluster in prompt * refactor: refactor to functional create enterprise flow with some updates based on reviews * Add machine pool logic (#1795) * feat: addition of the new dedicated command to select ocm cluster * feat: addition of getting machine pools and hitting the register cluster endpoint in KFM * refactor: addition of close ocm connection * fix: addition of autoscaling check logic * refactor: addresses commments made in PR * refactor: addresses comments in review * feat: addition of the addon installation flow * feat: addition of cluster-id flag * refactor: addresses some further comments in the review * feat: addition of localization * refactor: addition of error when user has no valid clusters * chore(vendor): update vendoring (#1798) * Add cluster id to create kafka (#1804) * feat: addition of descriptions and examples to dedicated * feat: Allows the CLI to install stage env addons when terraforming customer-cloud dataplane clusters * refactor: the default api url is now set when creating a connection instead of in the registercluster cmd file * refactor: update some func and var names * refactor: add cluster-id flag to create kafka cmd to allow kafka creation on CC cluster * refactor: doc and small refactor * refactor: Refactor ocm methods out of register cmd file (#1807) * feat: addition of descriptions and examples to dedicated * feat: Allows the CLI to install stage env addons when terraforming customer-cloud dataplane clusters * refactor: extraction of clustermgmt funcs from register to own dir * refactor: addresses cluster pagination and refactor of ocm functions * feat: added deregister command * refactor: imrpoved quality of deregister command * chore: added localisation to deregister command * feat: deregister now waits for all kafkas to be deleted * fix: better logging when deleting kafka * refactor: getting cluster list now ask kfm then ocm * chore: remove unused fields * fix: edge case handling in deregister * docs: update the docs (#1826) * refactor: print the httpresponse (#1827) * fix: fixing broken lints * chore: rebase changes --------- Co-authored-by: Dimitri Saridakis <dimitri.saridakis@gmail.com> Co-authored-by: Ramakrishna Pattnaik <rkpattnaik780@gmail.com>
to verify,
One will have to walk through the
rhoas dedicated register-cluster
cmd.Closes #
Verification Steps
Type of change