Skip to content

Commit

Permalink
refactor labels comments (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdsteelRail authored Oct 11, 2024
1 parent dcf4e9b commit 42d2bfc
Showing 1 changed file with 50 additions and 25 deletions.
75 changes: 50 additions & 25 deletions apps/v1alpha1/well_known_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,39 @@ const (

// PodOpsLifecycle labels
const (
PodOperatingLabelPrefix = "operating.podopslifecycle.kusionstack.io" // indicate a pod is operating
PodOperationTypeLabelPrefix = "operation-type.podopslifecycle.kusionstack.io" // indicate the type of operation
PodOperationPermissionLabelPrefix = "operation-permission.podopslifecycle.kusionstack.io" // indicate the permission of operation
PodUndoOperationTypeLabelPrefix = "undo-operation-type.podopslifecycle.kusionstack.io" // indicate the type of operation has been canceled
PodDoneOperationTypeLabelPrefix = "done-operation-type.podopslifecycle.kusionstack.io" // indicate the type of operation has been done
// PodOperatingLabelPrefix indicates a pod is operating
PodOperatingLabelPrefix = "operating.podopslifecycle.kusionstack.io"
// PodOperationTypeLabelPrefix indicates the type of operation
PodOperationTypeLabelPrefix = "operation-type.podopslifecycle.kusionstack.io"
// PodOperationPermissionLabelPrefix indicates the permission of operation
PodOperationPermissionLabelPrefix = "operation-permission.podopslifecycle.kusionstack.io"
// PodUndoOperationTypeLabelPrefix indicates the type of operation has been canceled
PodUndoOperationTypeLabelPrefix = "undo-operation-type.podopslifecycle.kusionstack.io"
// PodDoneOperationTypeLabelPrefix indicates the type of operation has been done
PodDoneOperationTypeLabelPrefix = "done-operation-type.podopslifecycle.kusionstack.io"

PodPreCheckLabelPrefix = "pre-check.podopslifecycle.kusionstack.io" // indicate a pod is in pre-check phase
PodPreCheckedLabelPrefix = "pre-checked.podopslifecycle.kusionstack.io" // indicate a pod has finished pre-check phase
PodPreparingLabelPrefix = "preparing.podopslifecycle.kusionstack.io" // indicate a pod is preparing for operation
PodOperateLabelPrefix = "operate.podopslifecycle.kusionstack.io" // indicate a pod is in operate phase
PodOperatedLabelPrefix = "operated.podopslifecycle.kusionstack.io" // indicate a pod has finished operate phase
PodPostCheckLabelPrefix = "post-check.podopslifecycle.kusionstack.io" // indicate a pod is in post-check phase
PodPostCheckedLabelPrefix = "post-checked.podopslifecycle.kusionstack.io" // indicate a pod has finished post-check phase
PodCompletingLabelPrefix = "completing.podopslifecycle.kusionstack.io" // indicate a pod is completing operation
// PodPreCheckLabelPrefix indicates a pod is in pre-check phase
PodPreCheckLabelPrefix = "pre-check.podopslifecycle.kusionstack.io"
// PodPreCheckedLabelPrefix indicates a pod has finished pre-check phase
PodPreCheckedLabelPrefix = "pre-checked.podopslifecycle.kusionstack.io"
// PodPreparingLabelPrefix indicates a pod is preparing for operation
PodPreparingLabelPrefix = "preparing.podopslifecycle.kusionstack.io"
// PodOperateLabelPrefix indicates a pod is in operate phase
PodOperateLabelPrefix = "operate.podopslifecycle.kusionstack.io"
// PodOperatedLabelPrefix indicates a pod has finished operate phase
PodOperatedLabelPrefix = "operated.podopslifecycle.kusionstack.io"
// PodPostCheckLabelPrefix indicates a pod is in post-check phase
PodPostCheckLabelPrefix = "post-check.podopslifecycle.kusionstack.io"
// PodPostCheckedLabelPrefix indicates a pod has finished post-check phase
PodPostCheckedLabelPrefix = "post-checked.podopslifecycle.kusionstack.io"
// PodCompletingLabelPrefix indicates a pod is completing operation
PodCompletingLabelPrefix = "completing.podopslifecycle.kusionstack.io"

PodServiceAvailableLabel = "podopslifecycle.kusionstack.io/service-available" // indicate a pod is available to serve
PodStayOfflineLabel = "podopslifecycle.kusionstack.io/stay-offline" // indicate a pod is not ready and available to serve
PodPreparingDeleteLabel = "podopslifecycle.kusionstack.io/preparing-to-delete"
// PodServiceAvailableLabel indicates a pod is available to serve
PodServiceAvailableLabel = "podopslifecycle.kusionstack.io/service-available"
// PodStayOfflineLabel indicates a pod is not ready and available to serve
PodStayOfflineLabel = "podopslifecycle.kusionstack.io/stay-offline"
PodPreparingDeleteLabel = "podopslifecycle.kusionstack.io/preparing-to-delete"
)

var (
Expand All @@ -50,19 +65,29 @@ var (

// CollaSet labels
const (
PodInstanceIDLabelKey = "collaset.kusionstack.io/instance-id" // used to attach Pod instance ID on Pod
CollaSetUpdateIndicateLabelKey = "collaset.kusionstack.io/update-included" // used to indicate a pod should be updated by label
PodUpgradeByRecreateLabelKey = "collaset.kusionstack.io/upgrade-by-recreating" // used to indicate a pod is upgraded by recreate
// PodInstanceIDLabelKey is used to attach Pod instance ID on Pod
PodInstanceIDLabelKey = "collaset.kusionstack.io/instance-id"
// CollaSetUpdateIndicateLabelKey is used to indicate a pod should be updated by label
CollaSetUpdateIndicateLabelKey = "collaset.kusionstack.io/update-included"

PodDeletionIndicationLabelKey = "collaset.kusionstack.io/to-delete" // users can use this label to indicate a pod to delete
PodReplaceIndicationLabelKey = "collaset.kusionstack.io/to-replace" // users can use this label to indicate a pod to replace
// PodDeletionIndicationLabelKey indicates a pod will be deleted by collaset
PodDeletionIndicationLabelKey = "collaset.kusionstack.io/to-delete"
// PodReplaceIndicationLabelKey indicates a pod will be replaced by collaset
PodReplaceIndicationLabelKey = "collaset.kusionstack.io/to-replace"
// PodReplaceByReplaceUpdateLabelKey indicates a pod is replaced by update by collaset
PodReplaceByReplaceUpdateLabelKey = "collaset.kusionstack.io/replaced-by-replace-update"
PodIgnoringIndicationLabelKey = "collaset.kusionstack.io/to-ignore" // users can use this label to indicate a pod to be ignored by collaset
// PodIgnoringIndicationLabelKey indicates a pod to be ignored by collaset. For example,
// a Pod is stuck to delete when it is on a failed node or its network communication to
// the outside world is completely cut, then the Pod can be ignored by CollaSet.
PodIgnoringIndicationLabelKey = "collaset.kusionstack.io/to-ignore"

PodReplacePairOriginName = "collaset.kusionstack.io/replace-pair-origin-name" // used to indicate the original Pod name for replacement.
PodReplacePairNewId = "collaset.kusionstack.io/replace-pair-new-id" // used to indicate the new created Pod instance ID for replacement.
// PodReplacePairOriginName is used to indicate replace origin Pod name on the new created Pod
PodReplacePairOriginName = "collaset.kusionstack.io/replace-pair-origin-name"
// PodReplacePairNewId is used to indicate the new created Pod instance on the replace origin Pod
PodReplacePairNewId = "collaset.kusionstack.io/replace-pair-new-id"

PvcTemplateHashLabelKey = "collaset.kusionstack.io/pvc-template-hash" // used to attach hash of pvc template to pvc resource
// PvcTemplateHashLabelKey is used to attach hash of pvc template to pvc resource
PvcTemplateHashLabelKey = "collaset.kusionstack.io/pvc-template-hash"
)

// PodDecoration labels
Expand Down

0 comments on commit 42d2bfc

Please sign in to comment.