Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SyncMaxRetries = 6
SyncMaxRetries is the maximum number of ClusterSync poll attempts.
View Source
var SyncPollInterval = 5 * time.Second
SyncPollInterval is the delay between ClusterSync status checks.
Functions ¶
func RotateSecret ¶
func RotateSecret(ctx context.Context, input *RotateSecretInput) error
RotateSecret performs the IAM credential rotation workflow:
- Validates the Account CR (not STS, has iamUserId label)
- Resolves the osdManagedAdmin username
- Verifies rotation permissions via SimulatePrincipalPolicy
- Creates a new IAM access key
- Updates k8s secrets on hive
- Creates a SyncSet to push credentials to the cluster
- Polls ClusterSync for completion and cleans up the SyncSet
- Optionally rotates osdCcsAdmin credentials
func VerifyRotationPermissions ¶
func VerifyRotationPermissions(out io.Writer, awsClient awsprovider.Client, accountID string, username string) error
VerifyRotationPermissions checks if the assumed role has the necessary IAM permissions to perform secret rotation by simulating the required actions.
Types ¶
type InsufficientPermissionsError ¶
type InsufficientPermissionsError struct {
DeniedActions []string
}
InsufficientPermissionsError is returned when SimulatePrincipalPolicy reports that one or more required IAM actions are denied.
func (*InsufficientPermissionsError) Error ¶
func (e *InsufficientPermissionsError) Error() string
type RotateSecretInput ¶
type RotateSecretInput struct {
// AccountCRName is the name of the Account CR.
AccountCRName string
// Account is the pre-fetched Account CR.
Account *awsv1alpha1.Account
// OsdManagedAdminUsername is an explicit admin username override.
// If empty, it is derived from the Account CR's iamUserId label.
OsdManagedAdminUsername string
// UpdateCcsCreds controls whether osdCcsAdmin credentials are also rotated.
UpdateCcsCreds bool
// AwsClient is the fully-authenticated AWS client with permissions in the
// target AWS account (after all role chaining has been completed).
AwsClient awsprovider.Client
// HiveKubeClient is the k8s client connected to the hive cluster.
HiveKubeClient client.Client
// ManagedClusterClient is the k8s client connected to the managed cluster
// (via backplane using the target OCM environment). Used to delete
// CredentialRequests so CCO recreates them with the new credentials.
ManagedClusterClient client.Client
// DryRun, when true, prints what actions would be taken without performing
// any mutating operations (no AWS key creation/deletion, no k8s resource
// creation/deletion/updates).
DryRun bool
// Out is the writer for informational output.
Out io.Writer
}
RotateSecretInput holds all resolved dependencies for secret rotation. The CLI layer is responsible for resolving AWS and k8s clients before calling RotateSecret.
Click to show internal directories.
Click to hide internal directories.