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

feat(kafka): add promote command #1805

Merged
merged 2 commits into from
Feb 13, 2023
Merged

Conversation

rkpattnaik780
Copy link
Contributor

@rkpattnaik780 rkpattnaik780 commented Feb 9, 2023

rhoas kafka promote command to promote eval instances to use paid subscriptions.

Verification Steps

  1. Create an eval instance:
rhoas kafka create --name test-instance --billing-model eval
  1. Run promote command to change billing model to standard.
rhoas kafka promote --billing-model standard

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)

@ziccardi
Copy link

ziccardi commented Feb 9, 2023

I gave a run to the code and it works very well.

I have only a few comments:

  1. If you run the promote command and the kafka is not in a valid state for promotion (ready/suspended/resuming), the cli gives a misleading error : Only Kafka instances with billing model "eval" can be promoted
  2. The promote is valid only for eval instances, but when I list the kafkas, the billing model is not visualised. How can I know what are the kafkas I can promote?
  3. When the promote is called and it is successful, it returns an 'instance has been successfully promoted' message. That is misleading. When you invoke the promotion endpoint, the promotion request gets accepted. A reconciler then manages the promotion. At this point, the promotion can still fail. The cli should take into consideration the promotion_status and the promotion_details fields.
  4. The billing_model is not shown in the kafka list: I have no way to know the current billing model and I don't have any way to check that the promotion has been really done.

@rkpattnaik780
Copy link
Contributor Author

Hello @ziccardi
Thanks for the review. While going through the wrong error message issue, it turns out that the custom error code KAFKAS-MGMT-9 is associated with two failed reasons - kafka request \"cfivi8ubtv3kjdprf0v0\" has a kafka billing model \"standard\". Only kafka requests with a kafka billing model 'eval' can be promoted and kafka request \"cfivi8ubtv3kjdprf0v0\" with status \"accepted\" cannot be promoted: promotable status are: [ready suspended resuming]". Is there any reason we have two errors mapped to single error code? Shouldn't they be unique?

@ziccardi
Copy link

ziccardi commented Feb 10, 2023

Is there any reason we have two errors mapped to single error code? Shouldn't they be unique?

Currently we return those errors as general errors, so they share the same code. If you need those to use different codes, please fire a jira and we will look into it

@rkpattnaik780
Copy link
Contributor Author

Is there any reason we have two errors mapped to single error code? Shouldn't they be unique?

Currently we return those errors as general errors, so they share the same code. If you need those to use different codes, please fire a jira and we will look into it

Thank you for explaining. Will be creating a JIRA.

Copy link
Contributor

@dimakis dimakis left a comment

Choose a reason for hiding this comment

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

LGTM, much better success message 👍

@rkpattnaik780 rkpattnaik780 merged commit b7f8c4b into feat-long-lived Feb 13, 2023
@rkpattnaik780 rkpattnaik780 deleted the promote-eval branch February 13, 2023 12:54
rkpattnaik780 added a commit that referenced this pull request Feb 13, 2023
* feat(kafka create): enable creating long-lived trial instances (#1800)

* feat(kafka): add promote command (#1805)
@@ -54,6 +54,15 @@ one = 'Kafka instance ID. Uses the current instance if not set'
[kafkas.common.flag.output.description]
one = 'Format in which to display the Kafka instances (choose from: "json", "yml", "yaml")'

[kafka.common.flag.marketplaceId.description]
one = 'Cloud Account ID for the marketplace'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest: "Account ID for cloud marketplace"

one = 'Billing model to be used'

[kafka.common.flag.marketplaceType.description]
one = 'Name of the marketplace where the instance is purchased on'
Copy link
Contributor

@jbyrne-redhat jbyrne-redhat Feb 14, 2023

Choose a reason for hiding this comment

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

Suggest: 'Name of cloud marketplace where Kafka instance was purchased'

@@ -396,6 +396,9 @@ one = 'unable to create new Kafka instance at this time in specified cloud provi
[kafka.create.error.instance.limit]
one = 'maximum number of allowed kafka instances has been reached. Please review all instances that your user has access to and delete one or more instances before creating a new one'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest: 'the maximum number of Kafka instances for your organization has been reached. Before you can create a new instance, you must delete one or more of the existing instances'

Copy link
Contributor

@jbyrne-redhat jbyrne-redhat left a comment

Choose a reason for hiding this comment

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

Descriptions look good overall, @rkpattnaik780 . A couple of minor suggestions.

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