Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 add clusterDeleting condition and cleanup-priority annotation #286

Merged

Conversation

zhiweiyin318
Copy link
Member

Summary

Related issue(s)

Fixes #

@zhiweiyin318
Copy link
Member Author

/assign @qiujian16

// 2. delete resources with invalid value of this label.
// 3. delete resources following the priority value. For example, there are 2 manifestWorks, one value is set 100
// and another is set 10, the manifestWorks with 10 will be deleted before the one with 100.
LabelDeletionPriority string = "open-cluster-management.io/deletion-priority"
Copy link
Member

Choose a reason for hiding this comment

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

seems to me it should be a field rather than label

Copy link
Member Author

Choose a reason for hiding this comment

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

changed to annotation with the name cleanup-priority.

@zhiweiyin318 zhiweiyin318 force-pushed the add-condition branch 2 times, most recently from 3fc8402 to 5482cc8 Compare October 11, 2023 06:26
@zhiweiyin318 zhiweiyin318 changed the title 🌱 add clusterDeleting condition and deletion-priority label 🌱 add clusterDeleting condition and cleanup-priority annotation Oct 12, 2023

const (
// ManagedClusterConditionDeleting is a condition which means the cluster is in deletion process.
ManagedClusterConditionDeleting string = "ManagedClusterIsDeleting"
Copy link
Member

Choose a reason for hiding this comment

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

Deleting is good enough, it is ManagedCluster resource so it is not needed to specify it in the type

Copy link
Member Author

Choose a reason for hiding this comment

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

done

// 2. delete resources with invalid value of this annotation (!= [0,100]).
// 3. delete resources following the priority value. For example, there are 2 manifestWorks, one value is set 100
// and another is set 10, the manifestWorks with 10 will be deleted before the one with 100.
CleanupPriorityAnnotationKey string = "open-cluster-management.io/cleanup-priority"
Copy link
Member

Choose a reason for hiding this comment

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

this should also be in the types, but not here.

Copy link
Member Author

Choose a reason for hiding this comment

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

moved to types of clusters

Signed-off-by: ZhiweiYin <zyin@redhat.com>
@qiujian16
Copy link
Member

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm label Oct 12, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16, zhiweiyin318

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot merged commit c2e638b into open-cluster-management-io:main Oct 12, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants