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

Console-3733: Add support for Azure Workload Identity / Federated Identity based installs in OperatorHub #13082

Merged
merged 1 commit into from Dec 8, 2023

Conversation

gallettilance
Copy link
Contributor

@gallettilance gallettilance commented Aug 8, 2023

This PR adds the following:

  1. A warning is displayed in the item modal that the cluster is in WI/FI mode if the operator claims to supports it
  2. A warning is displayed in the item subscription page that the cluster is in WI/FI mode if the operator claims to support it
  3. If the cluster is in WI/FI mode and the operator claims support for it the the subscription page provides configuring 3 additional fields: client ID, tenant ID, and subscription ID (we are assuming that token path will be standardized / defaulted to /var/run/secrets/openshift/serviceaccount/token and region is not a required configuration)
  4. Default subscription to manual for installs on WI/FI mode clusters for operators that support it
Screencast.from.2023-08-08.11-52-54.webm

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 8, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Aug 8, 2023

@gallettilance: This pull request references Console-3733 which is a valid jira issue.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added component/olm Related to OLM kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Aug 8, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Aug 8, 2023

@gallettilance: This pull request references Console-3733 which is a valid jira issue.

In response to this:

This PR adds the following:

  1. A warning is displayed in the item modal that the cluster is in WI/FI mode if the operator claims to supports it
  2. A warning is displayed in the item subscription page that the cluster is in WI/FI mode if the operator claims to support it
  3. If the cluster is in WI/FI mode and the operator claims support for it the the subscription page provides configuring 3 additional fields: client ID, tenant ID, and subscription ID (we are assuming that token path will be standardized / defaulted to /var/run/secrets/openshift/serviceaccount/token and region is not a required configuration)

Screen capture to follow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@gallettilance
Copy link
Contributor Author

cc @rhamilto @TheRealJon @jhadvig

@TheRealJon
Copy link
Member

QE Approver
/assign @yanpzhan

Docs Approver:
/assign @opayne1

PX Approver:
/assign @RickJWagner

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Aug 8, 2023

@gallettilance: This pull request references Console-3733 which is a valid jira issue.

In response to this:

This PR adds the following:

  1. A warning is displayed in the item modal that the cluster is in WI/FI mode if the operator claims to supports it
  2. A warning is displayed in the item subscription page that the cluster is in WI/FI mode if the operator claims to support it
  3. If the cluster is in WI/FI mode and the operator claims support for it the the subscription page provides configuring 3 additional fields: client ID, tenant ID, and subscription ID (we are assuming that token path will be standardized / defaulted to /var/run/secrets/openshift/serviceaccount/token and region is not a required configuration)
  4. Default subscription to manual for installs on WI/FI mode clusters for operators that support it
Screencast.from.2023-08-08.11-52-54.webm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@RickJWagner
Copy link

/label px-approved

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label Aug 8, 2023
@RickJWagner RickJWagner removed their assignment Aug 8, 2023
Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

/lgtm

Comment on lines 381 to 384
{isAzureWIFCluster(cloudCredentials, infrastructure, authentication) &&
showWarn &&
infraFeatures?.find((i) => i === InfraFeatures[shortLivedTokenAuth]) && (
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible for both the AWS and Azure warnings to be shown side by side or are they mutually exclusive? If they can, then each needs it's own "show/hide" state or else dismissing one will dismiss both.

Copy link
Member

Choose a reason for hiding this comment

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

Also, the infraFeatures check is not necessary for either of these warnings. The isAzureWIFCluster check is a prerequisite for the shortLivedTokenAuth infra feature to be included. Seen here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TheRealJon the warnings are mutually exclusive - an operator can support both AWS and Azure but the platform will only be one or the other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

shortLivedTokenAuth is set to true when the operator supports the platform-specific short lived tokenized auth and the cluster is in that mode. So if anything it's the isAzureWIFCluster or isAWSSTSCluster that isn't required (I think) but I would like to display a warning custom to the platform (and shortLivedTokenAuth doesn't tell me the platform type) so I need a way to detect the platform type which is why isAzure... and isAWS... were added.

currentItem.infrastructure,
currentItem.authentication,
) &&
currentItem.infraFeatures?.find((i) => i === InfraFeatures[shortLivedTokenAuth])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
currentItem.infraFeatures?.find((i) => i === InfraFeatures[shortLivedTokenAuth])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure I understand why - I need to know the operator claims support for the platform's specific short term auth method

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 8, 2023
@TheRealJon
Copy link
Member

The comments I made are just nits. You can address them or not. Just let me know if you make changes and I'll review again.

@opayne1
Copy link
Contributor

opayne1 commented Aug 9, 2023

/label docs-approved

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Aug 9, 2023
@gallettilance
Copy link
Contributor Author

/hold until openshift/cloud-credential-operator#587 merges

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 16, 2023
@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 15, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 15, 2023
@rhamilto
Copy link
Member

cc: @jcaianirh

@yanpzhan
Copy link
Contributor

yanpzhan commented Dec 1, 2023

@gallettilance I lauched a cluster against the pr, simulated a azure WI/FI configuration:

# oc get infrastructure cluster -o jsonpath --template '{ .status.platform }'
Azure
# oc get cloudcredential cluster -o jsonpath --template '{ .spec.credentialsMode }'
Manual
#  oc get authentication cluster -o jsonpath --template='{ .spec.serviceAccountIssuer }'
abutcher-oidc.apps.yanpz3733.qe.azure.devcluster.openshift.com

And prepared a operator with annotation: features.operators.openshift.io/token-auth-azure: 'true'
But I didn't see any warning about the cluster on this operator's item modal page and item subscription page.
I remember when I tested the pr in August, I could see warning info.
If there is something different in code recently and test steps are changed? How could I test the feature now?

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2023
@gallettilance
Copy link
Contributor Author

@yanpzhan thanks for catching that! You were right there was an issue with the new infraFeatures that I've fixed and it should all be working now

@rhamilto
Copy link
Member

rhamilto commented Dec 5, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2023
@yanpzhan
Copy link
Contributor

yanpzhan commented Dec 6, 2023

@gallettilance Thanks for your update, I could see the warning info on new cluster launched against the pr now.
But there is other issue, twhen click on input fields "Azure Client ID","Azure Tenant ID","Azure Subscription ID", they are set as "[object Object]" automatically, and could not be updated. If insist on clicking "Install" button, an error shows up:

Danger alert:An error occurred
Converting circular structure to JSON
--> starting at object with constructor 'HTMLInputElement'
| property '__reactFiber$abxqa1swcim' -> object with constructor 'Lu'
--- property 'stateNode' closes the circle

Screenshot from 2023-12-06 17-47-12

Screenshot from 2023-12-06 17-50-16
Could you pls help to check again?

@rhamilto
Copy link
Member

rhamilto commented Dec 6, 2023

Danger alert:An error occurred
Converting circular structure to JSON
--> starting at object with constructor 'HTMLInputElement'
| property '__reactFiber$abxqa1swcim' -> object with constructor 'Lu'
--- property 'stateNode' closes the circle

Related bug: https://issues.redhat.com/browse/ocpbugs-24252

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2023
@gallettilance
Copy link
Contributor Author

waiting on #13416 to merge first

const featuresAnnotationsObjects = [
{ key: InfraFeatures.Disconnected, value: disconnected },
{ key: InfraFeatures.FipsMode, value: fipsCompliant },
{ key: InfraFeatures.Proxy, value: proxyAware },
{ key: InfraFeatures.cnf, value: cnf },
{ key: InfraFeatures.cni, value: cni },
{ key: InfraFeatures.csi, value: csi },
{ key: InfraFeatures.TokenAuth, value: tokenAuthSupport },
Copy link
Member

Choose a reason for hiding this comment

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

My memory on this is fuzzy as it has been awhile and this has changed a bit. featuresAnnotationsObjects really only exists in order to override legacy labels. Since tokenAuth*s are new, I would not include them here. I would preserve the existing functionality where you push the value on to infrastructureFeatures.

@rhamilto
Copy link
Member

rhamilto commented Dec 7, 2023

/lgtm

/hold for @gallettilance to finish testing

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 7, 2023
Copy link
Contributor

openshift-ci bot commented Dec 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gallettilance, rhamilto, TheRealJon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

openshift-ci bot commented Dec 7, 2023

@gallettilance: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@gallettilance
Copy link
Contributor Author

/hold cancel
/label px-approved

Adding these labels since QE will not be able to add them before branch date and this needs to be in before then and extensive testing has been done prior to today.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 7, 2023
@gallettilance
Copy link
Contributor Author

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Dec 7, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 7, 2023

@gallettilance: This pull request references Console-3733 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target either version "4.15." or "openshift-4.15.", but it targets "openshift-4.14" instead.

In response to this:

This PR adds the following:

  1. A warning is displayed in the item modal that the cluster is in WI/FI mode if the operator claims to supports it
  2. A warning is displayed in the item subscription page that the cluster is in WI/FI mode if the operator claims to support it
  3. If the cluster is in WI/FI mode and the operator claims support for it the the subscription page provides configuring 3 additional fields: client ID, tenant ID, and subscription ID (we are assuming that token path will be standardized / defaulted to /var/run/secrets/openshift/serviceaccount/token and region is not a required configuration)
  4. Default subscription to manual for installs on WI/FI mode clusters for operators that support it
Screencast.from.2023-08-08.11-52-54.webm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@gallettilance
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 7, 2023

@gallettilance: This pull request references Console-3733 which is a valid jira issue.

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-merge-bot openshift-merge-bot bot merged commit ee66c50 into openshift:master Dec 8, 2023
6 checks passed
@yanpzhan
Copy link
Contributor

Retested on cluster launched against the pr, the warning info show correctly and operator could be installed successfully.
I have a question about where the info set for "Azure Client Id", "Azure Tenant Id". "Azure Subscription Id" fields are stored after the operator is installed. Pasted the comment in jira
@gallettilance could you give me some clue about the question? Thanks very much.

@rhamilto
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/olm Related to OLM docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants