Skip to content

Ensure object are finalized under impersonation#552

Merged
stefanprodan merged 1 commit intomainfrom
impersonation-finalize
Jan 31, 2022
Merged

Ensure object are finalized under impersonation#552
stefanprodan merged 1 commit intomainfrom
impersonation-finalize

Conversation

@stefanprodan
Copy link
Copy Markdown
Member

If the service account used for impersonation has been deleted, skip pruning, log the error and continue with finalization to allow tenants removals from clusters.

Followup: #550

If the service account used for impersonation has been deleted, skip pruning, log the error and continue with finalization to allow tenants removals from clusters.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
@stefanprodan stefanprodan added the enhancement New feature or request label Jan 31, 2022
@stefanprodan stefanprodan requested a review from hiddeco January 31, 2022 11:20
}
} else {
// when the account to impersonate is gone, log the stale objects and continue with the finalization
msg := fmt.Sprintf("unable to prune objects: \n%s", ssa.FmtUnstructuredList(objects))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want the logged message to contain a newline and/or full list of objects?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I haven't changed to log format in this PR. Each object is logged a new line like before, this makes it pretty in Slack and others.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, I get this is pretty for Slack. Was more wondering how useful it is in controller log output.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All objects lists/actions are logged like this in KC. If you think we should use a different formatting for logs, please open an issue.

@stefanprodan stefanprodan merged commit ceefe5a into main Jan 31, 2022
@stefanprodan stefanprodan deleted the impersonation-finalize branch January 31, 2022 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants