Skip to content

Commit d2016d3

Browse files
authored
Put all common labels/annotations in api repo (#196)
We should treat these labels and annotations as part of APIs Signed-off-by: Jian Qiu <[email protected]> Signed-off-by: Jian Qiu <[email protected]>
1 parent 744f80b commit d2016d3

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

addon/v1alpha1/types_managedclusteraddon.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,36 @@ type ManagedClusterAddOnList struct {
216216

217217
Items []ManagedClusterAddOn `json:"items"`
218218
}
219+
220+
const (
221+
// Label and annotation keys set on ManagedClusterAddon.
222+
223+
// AddonLabelKey is the label key to set addon name. It is to set on the resources on the hub relating
224+
// to an addon
225+
AddonLabelKey = "open-cluster-management.io/addon-name"
226+
227+
// DisableAddonAutomaticInstallationAnnotationKey is the annotation key for disabling the functionality of
228+
// installing addon automatically. it should be set on ManagedClusterAddon resource only.
229+
DisableAddonAutomaticInstallationAnnotationKey = "addon.open-cluster-management.io/disable-automatic-installation"
230+
231+
// AddonNamespaceLabelKey is the label key to set namespace of ManagedClusterAddon.
232+
AddonNamespaceLabelKey = "open-cluster-management.io/addon-namespace"
233+
234+
// Label and annotation keys set on manifests of addon agent.
235+
236+
// AddonPreDeleteHookLabelKey is the label key to identify that a resource manifest is used as pre-delete hook for an addon
237+
// and should be created and deleted before the specified ManagedClusterAddon is deleted.
238+
AddonPreDeleteHookLabelKey = "open-cluster-management.io/addon-pre-delete"
239+
240+
// HostingClusterNameAnnotationKey is the annotation key for indicating the hosting cluster name, it should be set
241+
// on ManagedClusterAddon resource only.
242+
HostingClusterNameAnnotationKey = "addon.open-cluster-management.io/hosting-cluster-name"
243+
244+
// DeletionOrphanAnnotationKey is an annotation for the manifest of addin indicating that it will not be cleaned up
245+
// after the addon is deleted.
246+
DeletionOrphanAnnotationKey = "addon.open-cluster-management.io/deletion-orphan"
247+
248+
// HostedManifestLocationLabelKey is the label key for indicating the cluster that the manifest should be deployed in Hosted
249+
// mode.
250+
HostedManifestLocationLabelKey = "addon.open-cluster-management.io/hosted-manifest-location"
251+
)

cluster/v1/types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,8 @@ type ManagedClusterList struct {
229229
// Items is a list of managed clusters.
230230
Items []ManagedCluster `json:"items"`
231231
}
232+
233+
const (
234+
// ClusterNameLabelKey is the key of a label to set ManagedCluster name.
235+
ClusterNameLabelKey = "open-cluster-management.io/cluster-name"
236+
)

0 commit comments

Comments
 (0)