Skip to content

Commit

Permalink
Merge pull request #863 from fao89/servicelabels
Browse files Browse the repository at this point in the history
Standardize service labels
  • Loading branch information
openshift-merge-bot[bot] authored Jun 18, 2024
2 parents 1252b72 + deece38 commit 0f3d544
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 42 deletions.
17 changes: 17 additions & 0 deletions apis/dataplane/v1beta1/openstackdataplaneservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,20 @@ func (instance OpenStackDataPlaneService) InitConditions() {
// initialize conditions used later as Status=Unknown
instance.Status.Conditions.Init(&cl)
}

// DefaultLabel - adding default label to the OpenStackDataPlaneService
func (r *OpenStackDataPlaneService) DefaultLabels() {
labels := map[string]string{
"app.kubernetes.io/name": "openstackdataplaneservice",
"app.kubernetes.io/instance": r.Name,
"app.kubernetes.io/part-of": "openstack-operator",
}

if r.Labels == nil {
r.Labels = labels
} else {
for k, v := range labels {
r.Labels[k] = v
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (r *OpenStackDataPlaneService) Default() {

openstackdataplaneservicelog.Info("default", "name", r.Name)
r.Spec.Default(r.Name)
r.DefaultLabels()
}

// Default - set defaults for this OpenStackDataPlaneService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-bootstrap
app.kubernetes.io/part-of: openstack-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: openstack-operator
name: bootstrap
spec:
playbook: osp.edpm.bootstrap
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-configure-network
app.kubernetes.io/part-of: openstack-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: openstack-operator
name: configure-network
spec:
playbook: osp.edpm.configure_network
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-configure-ovs-dpdk
app.kubernetes.io/part-of: openstack-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: openstack-operator
name: configure-ovs-dpdk
spec:
playbook: osp.edpm.configure_ovs_dpdk
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-derive-pci-devicespec
app.kubernetes.io/part-of: openstack-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: openstack-operator
name: derive-pci-devicespec
spec:
playbook: osp.edpm.sriov_derive_device_spec
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-download-cache
app.kubernetes.io/part-of: openstack-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: openstack-operator
name: download-cache
spec:
playbook: osp.edpm.download_cache
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-install-certs
app.kubernetes.io/part-of: openstack-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: openstack-operator
name: install-certs
spec:
playbook: osp.edpm.install_certs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
labels:
app.kubernetes.io/name: openstackdataplaneservice
app.kubernetes.io/instance: openstackdataplaneservice-validate-network
app.kubernetes.io/part-of: openstack-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: openstack-operator
name: validate-network
spec:
playbook: osp.edpm.validate_network

0 comments on commit 0f3d544

Please sign in to comment.