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

refactor: Refactor ocm methods out of register cmd file #1807

Merged
merged 4 commits into from
Feb 20, 2023

Conversation

dimakis
Copy link
Contributor

@dimakis dimakis commented Feb 13, 2023

to verify,
One will have to walk through the rhoas dedicated register-cluster cmd.

Closes #

Verification Steps

  1. Do x
  2. Do y

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

@dimakis dimakis force-pushed the refactor-ocm-methods2 branch from 9639359 to 80fe1ed Compare February 13, 2023 09:56
Copy link
Contributor

@rkpattnaik780 rkpattnaik780 left a 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.

Copy link
Member

@andreaTP andreaTP left a 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 🙁

@dimakis dimakis force-pushed the refactor-ocm-methods2 branch from 80fe1ed to 4845af8 Compare February 15, 2023 08:08
@dimakis dimakis requested a review from andreaTP February 15, 2023 11:44
@dimakis
Copy link
Contributor Author

dimakis commented Feb 15, 2023

A couple of suggestions, the main issue is the lack of tests 🙁

@andreaTP
refactored and addresses cluster pagination, also adds an error message when there are no available valid openshift clusters to choose from

@@ -27,7 +28,8 @@ type options struct {
selectedClusterMachinePool clustersmgmtv1.MachinePool
requestedMachinePoolNodeCount int
accessKafkasViaPrivateNetwork bool
// newMachinePool clustersmgmtv1.MachinePool
pageNumber int
Copy link
Contributor

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.

@dimakis dimakis merged commit 57f89b8 into redhat-developer:dedicated Feb 20, 2023
@@ -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"))
Copy link
Contributor

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.

jackdelahunt pushed a commit that referenced this pull request Feb 28, 2023
* 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
jackdelahunt pushed a commit that referenced this pull request Mar 2, 2023
* 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
jackdelahunt pushed a commit that referenced this pull request Mar 3, 2023
* 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
jackdelahunt pushed a commit that referenced this pull request Mar 3, 2023
* 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
jackdelahunt pushed a commit that referenced this pull request Mar 7, 2023
* 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
dimakis added a commit that referenced this pull request Mar 8, 2023
* 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>
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.

3 participants