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: moving list enterprise clusters to util package #1818

Conversation

dimakis
Copy link
Contributor

@dimakis dimakis commented Feb 28, 2023

Moving this out for easy resuse

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-list-enterprise-clusters branch from fb7f2d3 to c8e5796 Compare March 1, 2023 10:07
kafkamgmtclient "github.com/redhat-developer/app-services-sdk-core/app-services-sdk-go/kafkamgmt/apiv1/client"
)

func ListEnterpriseClusters(f *factory.Factory) (*kafkamgmtclient.EnterpriseClusterList, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

shared utils is a place where methods defined are used in different subcommands. For example - kafkautil.InteractiveSelect is used in kafka, connectors and cluster subcommands.
ListEnterpriseClusters is used just in dedicated list, will it make sense to move it to pkg/cmd/dedicated/dedicatedcmdutil/dedicated_util.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it will also be used in the create kafka cmd too, so that's the reason I moved it to shared

return nil, err
}
if len(clist.Items) == 0 {
return nil, f.Localizer.MustLocalizeError("dedicated.list.cmd.errorNoRegisteredClusters")
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a normal case we handle instead of returning an error

@dimakis dimakis force-pushed the refactor-list-enterprise-clusters branch from c8e5796 to b8e6058 Compare March 1, 2023 10:45
@dimakis dimakis force-pushed the refactor-list-enterprise-clusters branch from b8e6058 to 930a1d4 Compare March 1, 2023 10:57
Copy link
Contributor

@jackdelahunt jackdelahunt left a comment

Choose a reason for hiding this comment

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

@dimakis dimakis merged commit 669272e into redhat-developer:dedicated Mar 1, 2023
dimakis added a commit that referenced this pull request Mar 14, 2023
* feat: add machine pool logic

* chore(vendor): update vendoring (#1798)

* chore(vendor): update vendoring

* feat: add cluster id to create kafka

* fix(dedicated): attempts to correctly parse the cluster ingress dns name (#1806)

This is so that "apps." prefix is always included and required by KFM when it is running under
certain configuration

Related to bf2fc6cc711aee1a0c2a/kas-installer#266 (comment)

* refactor: refactor ocm methods out of register cmd

* fix: pass no params during the installation of managed kafka addon (#1815)

👍

* feat: addition of the new list cluster cmd (#1817)

* feat: addition of the new list cluster cmd

* refactor: now querying ocm for clusters by id, remove flags as kfm doesn't support pagination

* test: add some tests and fix ocm call string

* feat: now listing customer cloud in rhoas kafka list (#1816)

* refactor: dedicated changes now use new SDK

* refactor: moving list enterprise clusters to util package (#1818)

* feat: added name of cluster to kafka list (#1825)

* feat: added name of cluster to kafka list

* feat: clustermgmt url and access token flag to kafka list

* chore: localized kafka list customer cloud

* feat: kafka create with dedicated

---------

Co-authored-by: Jack Delahunt <45426048+jackdelahunt@users.noreply.github.com>

---------

Co-authored-by: Dimitri Saridakis <dimitri.saridakis@gmail.com>

* feat: added de-register command

---------

Co-authored-by: Dimitri Saridakis <dimitri.saridakis@gmail.com>
Co-authored-by: Ramakrishna Pattnaik <rkpattnaik780@gmail.com>

* fix: now checking if reponse is empty in dedicated list

* fix: now checking if reponse is empty in deregister

* fix: correct output for deregister

* feat: add clustermgmt flag to create kafka

* chore: format & docs

* chore: fix lint errors

* refactor: hide flags, improves logic around passing cluster flag in register-cluster (#1836)

---------

Co-authored-by: Dimitri Saridakis <dimitri.saridakis@gmail.com>
Co-authored-by: Ramakrishna Pattnaik <rkpattnaik780@gmail.com>
Co-authored-by: Manyanda Chitimbo <manyanda.chitimbo@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