1
0
mirror of synced 2026-03-21 01:46:57 +00:00

Adds an optional reason cli flag to the suspend command that

accepts a reason for why the resource was suspended.

Defines the resource metadata annotation key that stores the reason for
the resource suspension.

Updates the suspend and resume resource patching to add or remove the
annotation holding the suspend reason.

Signed-off-by: Travis Mattera <travis@mattera.io>
This commit is contained in:
Travis Mattera
2023-09-11 19:53:34 -07:00
parent 0d18dc128a
commit 479fc3cd3b
23 changed files with 66 additions and 14 deletions

View File

@@ -48,6 +48,9 @@ func (obj gitRepositoryAdapter) getObservedGeneration() int64 {
func (obj gitRepositoryAdapter) setUnsuspended() {
obj.GitRepository.Spec.Suspend = false
if _, ok := obj.GitRepository.Annotations[SuspendReasonAnnotation]; ok {
delete(obj.GitRepository.Annotations, SuspendReasonAnnotation)
}
}
func (a gitRepositoryListAdapter) resumeItem(i int) resumable {