Bug 1949866

Summary: The ccoctl fails to create authentication file when running the command `ccoctl aws create-identity-provider` with `--output-dir` parameter
Product: OpenShift Container Platform Reporter: wang lin <lwan>
Component: Cloud Credential OperatorAssignee: Joel Diaz <jdiaz>
Status: CLOSED ERRATA QA Contact: wang lin <lwan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.8CC: jdiaz, lwan
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 23:00:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description wang lin 2021-04-15 09:33:07 UTC
Description of problem:
When running the command `ccoctl aws create-identity-provider` with --output-dir parameter, it will show the below error

$ ./ccoctl aws create-identity-provider --name=lwan-tt-4 --region=us-east-1 --public-key-file ./test/serviceaccount-signer.public --output-dir test
2021/04/15 13:50:28 Bucket lwan-tt-4-oidc created
2021/04/15 13:50:29 OpenID Connect discovery document in the S3 bucket lwan-tt-4-oidc at .well-known/openid-configuration updated
2021/04/15 13:50:29 Reading public key
2021/04/15 13:50:29 JSON web key set (JWKS) in the S3 bucket lwan-tt-4-oidc at keys.json updated
2021/04/15 13:50:37 Identity Provider created with ARN: arn:aws:iam::301721915996:oidc-provider/lwan-tt-4-oidc.s3.us-east-1.amazonaws.com
2021/04/15 13:50:37 failed to save cluster authentication file: open test/manifests/cluster-authentication-02-config.yaml: no such file or directory

Root cause:
https://github.com/openshift/cloud-credential-operator/blob/master/pkg/cmd/provisioning/aws/create_identity_provider.go#L486-L495
For func initEnvForCreateIdentityProviderCmd() , it doesn’t have a structure named CreateAllOpts, should be structure CreateIdentityProviderOpts.

Version-Release number of selected component (if applicable):
4.8.0-0.nightly-2021-04-15-030836

How reproducible:
always

Steps to Reproduce: 
1. Run the command `ccoctl aws create-identity-provider` with “--output-dir” parameter

Actual results:
Fail to save cluster authentication file

Expected results:
It can create cluster authentication file

Additional info:

Comment 3 wang lin 2021-04-30 03:55:04 UTC
The issue has fixed on 4.8.0-0.nightly-2021-04-29-222100.


Running `create-identity-provider` and `create-iam-roles` subcommand with “--output-dir” parameter can write files to output dir.

Comment 6 errata-xmlrpc 2021-07-27 23:00:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438