Skip to content

Commit

Permalink
add resource cleanup feature gate for registration (#290)
Browse files Browse the repository at this point in the history
Signed-off-by: ZhiweiYin <[email protected]>
  • Loading branch information
zhiweiyin318 authored Oct 18, 2023
1 parent 6ffae4d commit d7736a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cluster/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,19 @@ const (
// ManagedClusterConditionDeleting is a condition which means the cluster is in deletion process.
ManagedClusterConditionDeleting string = "Deleting"

// ConditionDeletingReasonResourceRemaining is a reason for the condition ManagedClusterIsDeleting, which means
// ConditionDeletingReasonResourceRemaining is a reason for the condition ManagedClusterConditionDeleting, which means
// there are resources are remaining during deletion process.
ConditionDeletingReasonResourceRemaining string = "ResourceRemaining"

// ConditionDeletingReasonResourceError is a reason for the condition ManagedClusterIsDeleting, which means
// ConditionDeletingReasonNoResource is a reason for the condition ManagedClusterConditionDeleting, which means
// there is no resources left in the cluster ns during the deletion process.
ConditionDeletingReasonNoResource string = "NoResource"

// ConditionDeletingReasonResourceError is a reason for the condition ManagedClusterConditionDeleting, which means
// meet errors during the deletion process.
ConditionDeletingReasonResourceError string = "DeletingError"

// CleanupPriorityAnnotationKey is a annotation for the resources deployed in cluster ns which are waiting to
// CleanupPriorityAnnotationKey is an annotation for the resources deployed in cluster ns which are waiting to
// be cleaned up after cluster is deleted.
// The value is an integer value [0,100], The larger the value, the later the order of deletion.
// The deletion order is :
Expand Down
4 changes: 4 additions & 0 deletions feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const (
// RawFeedbackJsonString will make the work agent to return the feedback result as a json string if the result
// is not a scalar value.
RawFeedbackJsonString featuregate.Feature = "RawFeedbackJsonString"

// ResourceCleanup will start gc controller to clean up resources in cluster ns after cluster is deleted.
ResourceCleanup featuregate.Feature = "ResourceCleanup"
)

// DefaultSpokeRegistrationFeatureGates consists of all known ocm-registration
Expand All @@ -85,6 +88,7 @@ var DefaultHubRegistrationFeatureGates = map[featuregate.Feature]featuregate.Fea
DefaultClusterSet: {Default: false, PreRelease: featuregate.Alpha},
V1beta1CSRAPICompatibility: {Default: false, PreRelease: featuregate.Alpha},
ManagedClusterAutoApproval: {Default: false, PreRelease: featuregate.Alpha},
ResourceCleanup: {Default: false, PreRelease: featuregate.Alpha},
}

var DefaultHubAddonManagerFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
Expand Down

0 comments on commit d7736a1

Please sign in to comment.