diff --git a/pkg/swiftproxy/const.go b/pkg/swiftproxy/const.go new file mode 100644 index 00000000..e8a97413 --- /dev/null +++ b/pkg/swiftproxy/const.go @@ -0,0 +1,21 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package swiftproxy + +const ( + // ComponentName - + ComponentName = "swift-proxy" +) diff --git a/pkg/swiftproxy/funcs.go b/pkg/swiftproxy/funcs.go index b1ea8e08..e6ddb954 100644 --- a/pkg/swiftproxy/funcs.go +++ b/pkg/swiftproxy/funcs.go @@ -15,6 +15,14 @@ limitations under the License. package swiftproxy +import ( + "github.com/openstack-k8s-operators/lib-common/modules/common" + "github.com/openstack-k8s-operators/swift-operator/pkg/swift" +) + func Labels() map[string]string { - return map[string]string{"app.kubernetes.io/name": "SwiftProxy"} + return map[string]string{ + common.AppSelector: swift.ServiceName, + common.ComponentSelector: ComponentName, + } } diff --git a/pkg/swiftring/const.go b/pkg/swiftring/const.go new file mode 100644 index 00000000..bb975902 --- /dev/null +++ b/pkg/swiftring/const.go @@ -0,0 +1,21 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package swiftring + +const ( + // ComponentName - + ComponentName = "swift-ring" +) diff --git a/pkg/swiftring/funcs.go b/pkg/swiftring/funcs.go index 486ef4c3..c4ae575d 100644 --- a/pkg/swiftring/funcs.go +++ b/pkg/swiftring/funcs.go @@ -15,6 +15,14 @@ limitations under the License. package swiftring +import ( + "github.com/openstack-k8s-operators/lib-common/modules/common" + "github.com/openstack-k8s-operators/swift-operator/pkg/swift" +) + func Labels() map[string]string { - return map[string]string{"batch.kubernetes.io/job-name": "SwiftRing"} + return map[string]string{ + common.AppSelector: swift.ServiceName, + common.ComponentSelector: ComponentName, + } } diff --git a/pkg/swiftstorage/const.go b/pkg/swiftstorage/const.go new file mode 100644 index 00000000..aa3c62d8 --- /dev/null +++ b/pkg/swiftstorage/const.go @@ -0,0 +1,21 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package swiftstorage + +const ( + // ComponentName - + ComponentName = "swift-storage" +) diff --git a/pkg/swiftstorage/funcs.go b/pkg/swiftstorage/funcs.go index b774ca0e..78083374 100644 --- a/pkg/swiftstorage/funcs.go +++ b/pkg/swiftstorage/funcs.go @@ -25,6 +25,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/types" + "github.com/openstack-k8s-operators/lib-common/modules/common" "github.com/openstack-k8s-operators/lib-common/modules/common/helper" swiftv1beta1 "github.com/openstack-k8s-operators/swift-operator/api/v1beta1" @@ -59,5 +60,8 @@ func DeviceList(ctx context.Context, h *helper.Helper, instance *swiftv1beta1.Sw } func Labels() map[string]string { - return map[string]string{"app.kubernetes.io/name": "SwiftStorage"} + return map[string]string{ + common.AppSelector: swift.ServiceName, + common.ComponentSelector: ComponentName, + } }