[OSD-22253] refactor sts command to support wif as well#583
Conversation
|
@mrWinston Why was this renamed to managed policies? That has a specific meaning in ROSA, so it may be confusing to change this command to that name when it doesn't directly relate to the ROSA meaning. |
In general, the name Do you already have an idea for a better name? |
|
Maybe something like |
|
Renamed the command to |
fb3bf2a to
60ed068
Compare
|
@mrWinston: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AlexVulaj, mrWinston The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
This PR is part of the ongoing effort to support gcp WIF the same way we do for aws sts.
It rewrites the
osdctl stssubcommand to support both aws sts policies as well as gcp wif templates. To reflect the change, the command was renamed toosdctl managedpoliciesand it's subcommands were renamed togetanddiffrespectively:osdctl sts policy 4.15.0-->osdctl iampermissions get -c aws -r 4.15.0osdctl sts policy-diff 4.14.0 4.15.0-->osdctl iampermissions diff -c aws -b 4.15.0 -t 4.15.0Furthermore, a new command is added to convert the credentialsrequests for a given cloud and version to a format that can be consumed directly by managed-cluster-config.
osdctl managedpolicies savecreates a json or yaml file (json for aws, yaml for gcp) for each credentialsrequest in a given folder. These contain the neccessary permissions for the service accounts.Examples
$ ./osdctl -S iampermissions save -d ./aws1 -c aws -r 4.16.0-rc.0 Writing aws1/openshift-ingress.json Writing aws1/openshift-cloud-network-config-controller-aws.json Writing aws1/aws-ebs-csi-driver-operator.json Writing aws1/openshift-cluster-api-aws.json Writing aws1/openshift-machine-api-aws.json Writing aws1/cloud-credential-operator-iam-ro.json Writing aws1/openshift-image-registry.json # same for gcp $ ./osdctl -S iampermissions save -d ./gcp -c gcp -r 4.16.0-rc.0 Writing gcp/openshift-image-registry-gcs.yaml Writing gcp/openshift-ingress-gcp.yaml Writing gcp/openshift-cloud-network-config-controller-gcp.yaml Writing gcp/openshift-gcp-pd-csi-driver-operator.yaml Writing gcp/openshift-gcp-ccm.yaml Writing gcp/openshift-cluster-api-gcp.yaml Writing gcp/openshift-machine-api-gcp.yaml Writing gcp/cloud-credential-operator-gcp-ro-creds.yaml