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

THREESCALE-8707 Fix apply app #361

Merged
merged 3 commits into from
Dec 22, 2022
Merged

THREESCALE-8707 Fix apply app #361

merged 3 commits into from
Dec 22, 2022

Conversation

eguzki
Copy link
Member

@eguzki eguzki commented Dec 14, 2022

what

Jira: https://issues.redhat.com/browse/THREESCALE-8707

The source issue was that applications were created populating both user_key and application_id regardless of the product's authentication mode (backend_version attr). When the auth mode is user_key (backend_version attr equals '1'), the application_id was also populated. After user key regeneration, the user_key changed but not the application_id. When the toolbox asked for an application with user_key application_parameter10,3scale returned not found as expected. Then the toolbox asked for an application with application _id application_parameter10 which existed, but since the auth mode is user_key 3scale still returned not found. In the last step, when the toolbox tried to create a new app with application_id application_parameter10, 3scale complained saying it is already used and the command failed. This is because the regenerated application, somehow (internal stuff), still kept application_id as application_parameter10, hence failing the creation step.

The fix consists on populating only required fields. No more.

verification steps

  • Create a new application with command "application apply"
3scale --verbose application apply --account=<value> --service=<value> --description=<value> --name=<value> --plan=<value> <remote> application_parameter10
  • Retrieve the application attributes. It must return recently created app
3scale --verbose application show <remote> application_parameter10
  • Regenerate the User Key through the Admin Portal UI and check the attributes again, so the application user_key has anew value and not application_parameter10 as defined in the first step:
3scale --verbose application show <remote> application_parameter10

The following error should be returned:

{
  "code": "E_3SCALE",
  "message": "Application application_parameter10 does not exist",
  "class": "ThreeScaleToolbox::Error"
}
  • try to rerun the command mentioned in the first step, i.e. create a new application with the application_parameter10 user key
3scale --verbose application apply --account=<value> --service=<value> --description=<value> --name=<value> --plan=<value> <remote> application_parameter10

This command should not fail and you should end up having two applicatins with the same name and descriptions, but different user key.

@eguzki eguzki merged commit c01175c into main Dec 22, 2022
@eguzki eguzki deleted the fix-apply-app branch December 22, 2022 09:11
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.

1 participant