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

SmartState Docker Creds for AWS #2525

Merged
merged 2 commits into from
Oct 27, 2017

Conversation

jerryk55
Copy link
Member

@jerryk55 jerryk55 commented Oct 26, 2017

Add a new credentials tab for the Amazon provider that takes a userid and password
to be used when performing Smartstate Analysis. This tab is labeled "SmartState Docker".
These credentials will be passed to the AWS instance actually performing SSA to be used to log in to the Docker Registry. These credentials are NOT required, and no validation will be performed on them. They will simply be saved in the database to be passed to the SmartState Analysis agent.

This PR is dependent upon ManageIQ/manageiq-providers-amazon#330 which adds the smartstate_docker authtype to the Amazon provider.

Please note that while this PR is marked as WIP, it will need to be merged for the 4.6 build. It is functioning properly except for the following nits:

  1. The SmartState Docker tab is marked with a red "!" which would lead one to believe that it is
    not valid even after credentials are entered. This is related to the fact that we are not validating them.

  2. Even though the SmartState Docker credentials are not required, the "Add" button for a new provider is not enabled until the new tab is clicked on. The credentials do not have to be entered.

  3. If credentials on the SmartState Docker tab are entered and saved in the database, the next
    time the Amazon provider is edited - the userid is not filled in to the appropriate field to be modified.
    It needs to be entered again if one wishes to make changes to the password.

Finally - as a follow on we wish to enable or disable this tab based on a configuration setting. This will be added in a separate PR.

@roliveri @hsong-rh @Fryguy @AparnaKarve @h-kataria please review. We may wish to merge this as is if we cannot resolve the above nits so that the feature makes it into the build. Your mileage may vary.

Screenshots -

Old page to add Amazon Provider with Validation Required -

old add amazon validation required

New Page to add Amazon Provider - Default Credentials Tab -

add amazon provider default tab valid

Old Page to add Amazon Provider - Credentials Validated -

old add amazon validated

New Page to add Amazon Provider - Smartstate Tab

add amazon provider smartstate tab add tab

Old page to Edit Amazon Provider - Validation Required

old add amazon validation required

New page to edit Amazon Provider - Default Tab

edit amazon provider default tab

Old page to edit Amazon Provider - Validated credentials

old edit validated

New page to edit Amazon Provider - Smartstate Tab

edit amazon provider filled smartstate tab

Links

Steps for Testing/QA

Add an Amazon Provider. Enter the default credentials. Click on the "SmartState Docker" tab.
enter the userid and password. Click "Add". Both sets of credentials will be stored in the VMDB.
These can be validated by inspecting the "authentications" table in the database.

@jerryk55
Copy link
Member Author

@miq-bot add_label wip

@miq-bot
Copy link
Member

miq-bot commented Oct 26, 2017

This pull request is not mergeable. Please rebase and repush.

Add a new credentials tab for the Amazon provider that takes a userid and password
to be used when performing Smartstate Analysis.  These credentials will be passed
to the AWS instance actually performing SSA to be used to log in to the Docker
Registry.
Fix warnings called out by Rubocop.
@miq-bot
Copy link
Member

miq-bot commented Oct 26, 2017

Checked commits jerryk55/manageiq-ui-classic@60d2725~...d6c88f6 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 3 offenses detected

app/views/layouts/angular/_multi_auth_credentials.html.haml

  • ⚠️ - Line 158 - Prefer to_s over string interpolation.
  • ⚠️ - Line 159 - Prefer to_s over string interpolation.
  • ⚠️ - Line 24 - Redundant curly braces around a hash parameter.

@AparnaKarve
Copy link
Contributor

AparnaKarve commented Oct 27, 2017

The tab implementation is not correct here, since

  • the error indicator on the SmartState docker tab never goes away
  • the Add button shows disabled on the Default tab but enabled for SmartState docker tab

The attached patch would resolve the above issue (works well for me)
However, @jerryk55 could not successfully confirm that.
ems_patch.txt

I suppose, we could resolve this issue in a follow-up and go ahead with the merge for now.

/cc @h-kataria

@jerryk55
Copy link
Member Author

Correct @AparnaKarve @h-kataria when I test the patch the error indicator on the Smartstate Tab still doesn't go away, and worse the Add button is never enabled so I cannot save the provider. If we get agreement I will turn off the "WIP" on this and we can address the issues with a follow-on PR.

@h-kataria
Copy link
Contributor

@jerryk55 can you please add before/after screenshots, it is easy to test/verify changes.

@jerryk55
Copy link
Member Author

@h-kataria will do.

@h-kataria
Copy link
Contributor

@jerryk55 verified patch from @AparnaKarve , seems to be working as expected, please apply that to your PR, then i can test/verify again.

@jerryk55
Copy link
Member Author

@h-kataria the patch did not work for me but I will try again. This could be some flakey cache issue on my appliance.

@chessbyte
Copy link
Member

@jerryk55 also, don't forget to add before/after screenshots so people can look at the PR and quickly understand how it affects the UI

@h-kataria
Copy link
Contributor

@jerryk55 i think i will merge this PR as is since patch from @AparnaKarve does not seem to work for you, please make a follow up PR with those changes. Please mark this PR as non-WIP once it is ready to merge.

@jerryk55
Copy link
Member Author

@chessbyte in the process...

@jerryk55
Copy link
Member Author

@h-kataria @chessbyte before and after screenshots added for adding and editing an Amazon provider with one or both sets of credentials.

@jerryk55 jerryk55 changed the title [WIP] SmartState Docker Creds for AWS SmartState Docker Creds for AWS Oct 27, 2017
@jerryk55
Copy link
Member Author

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Oct 27, 2017
@chessbyte
Copy link
Member

@jerryk55 @Fryguy should we call it SmartState Container, instead of SmartState Docker?

@h-kataria h-kataria self-assigned this Oct 27, 2017
@h-kataria h-kataria added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 27, 2017
@h-kataria h-kataria removed this from the Sprint 72 Ending Oct 30, 2017 milestone Oct 27, 2017
@jerryk55
Copy link
Member Author

jerryk55 commented Oct 27, 2017

@chessbyte I will leave it up to those with stronger opinions. We already changed the name once before based on consensus from @roliveri @Fryguy and @bdunne. Originally it was named "RHSM Credentials" because those were the initial set of credentials required. Then @bdunne stated that the creds were for the Docker Registry, and that upstream and downstream they could be different.

@chessbyte
Copy link
Member

@jerryk55 thanks for the clarification.
@h-kataria please review/merge. We can always change label name in a future PR

@h-kataria h-kataria added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 27, 2017
@h-kataria h-kataria merged commit 4780722 into ManageIQ:master Oct 27, 2017
jerryk55 added a commit to jerryk55/manageiq-ui-classic that referenced this pull request Nov 7, 2017
The visibility of the Amazon Docker Creds tab will be based on a true
Settings value.  The setting used is Settings.ems.ems_amazon.agent_coordinator.docker_login_required.
If the value is false no tab is presented.

This feature is implemented based on offline discussions around the original PR implementing
the tab - ManageIQ#2525 with @Fryguy.
jerryk55 added a commit to jerryk55/manageiq-ui-classic that referenced this pull request Nov 7, 2017
Re-adds commit b5ea01f after
cleaning up the branch which was pushed with commits from another PR
inadvertantly.

The visibility of the Amazon Docker Creds tab will be based on a true
Settings value.  The setting used is Settings.ems.ems_amazon.agent_coordinator.docker_login_required.
If the value is false no tab is presented.

This feature is implemented based on offline discussions around the original PR implementing
the tab - ManageIQ#2525 with @Fryguy.
jerryk55 added a commit to jerryk55/manageiq-ui-classic that referenced this pull request Nov 8, 2017
The visibility of the Amazon Docker Creds tab will be based on a true
Settings value.  The setting used is Settings.ems.ems_amazon.agent_coordinator.docker_login_required.
If the value is false no tab is presented.

This feature is implemented based on offline discussions around the original PR implementing
the tab - ManageIQ#2525 with @Fryguy.
jerryk55 added a commit to jerryk55/manageiq-ui-classic that referenced this pull request Nov 8, 2017
The visibility of the Amazon Docker Creds tab will be based on a true
Settings value. The setting used is Settings.ems.ems_amazon.agent_coordinator.docker_login_required.
If the value is false no tab is presented.

This feature is implemented based on offline discussions around the original PR implementing
the tab - ManageIQ#2525 with @Fryguy.
This is the original desired functionality but it was not implemented in time for the 4.6 cutoff.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants