Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Set app.kubernetes.io/component label (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
croomes authored Sep 28, 2020
1 parent f16e883 commit b66d3d2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion pkg/controller/storageoscluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func (c *StorageOSCluster) SetDeployment(r *ReconcileStorageOSCluster) {
// by any label selectors.
labels["app"] = "storageos"

// Add default resource app labels.
// Add default resource app labels. Component will be set to "cluster" by
// default.
labels = k8s.AddDefaultAppLabels(c.cluster.Name, labels)

c.deployment = storageos.NewDeployment(r.client, r.discoveryClient, c.cluster, labels, r.recorder, r.scheme, r.k8sVersion, updateIfExists)
Expand Down
7 changes: 4 additions & 3 deletions pkg/storageos/csi_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,10 @@ func (s Deployment) deleteCSIHelper() error {
func podLabelsForCSIHelpers(name, kind string) map[string]string {
// Combine CSI Helper specific labels with the default app labels.
labels := map[string]string{
"app": appName,
"storageos_cr": name,
"kind": kind,
"app": appName,
"storageos_cr": name,
"kind": kind,
k8s.AppComponent: csiHelperName,
}
return k8s.AddDefaultAppLabels(name, labels)
}
7 changes: 4 additions & 3 deletions pkg/storageos/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ func (s *Deployment) createDaemonSet() error {
func podLabelsForDaemonSet(name string) map[string]string {
// Combine DaemonSet specific labels with the default app labels.
labels := map[string]string{
"app": appName,
"storageos_cr": name,
"kind": daemonsetKind,
"app": appName,
"storageos_cr": name,
"kind": daemonsetKind,
k8s.AppComponent: daemonsetName,
}
return k8s.AddDefaultAppLabels(name, labels)
}
7 changes: 4 additions & 3 deletions pkg/storageos/scheduler_extender.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ func (s Deployment) createSchedulerPolicy() error {
func podLabelsForScheduler(name string) map[string]string {
// Combine CSI Helper specific labels with the default app labels.
labels := map[string]string{
"app": appName,
"storageos_cr": name,
"kind": deploymentKind,
"app": appName,
"storageos_cr": name,
"kind": deploymentKind,
k8s.AppComponent: SchedulerExtenderName,
}
return k8s.AddDefaultAppLabels(name, labels)
}

0 comments on commit b66d3d2

Please sign in to comment.