Skip to content

Commit

Permalink
Merge pull request #126 from cschwede/fix-labels
Browse files Browse the repository at this point in the history
Fix service labels
  • Loading branch information
cschwede authored Feb 16, 2024
2 parents 6ef6062 + fef8e46 commit eaefddf
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 3 deletions.
21 changes: 21 additions & 0 deletions pkg/swiftproxy/const.go
Original file line number Diff line number Diff line change
@@ -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"
)
10 changes: 9 additions & 1 deletion pkg/swiftproxy/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
21 changes: 21 additions & 0 deletions pkg/swiftring/const.go
Original file line number Diff line number Diff line change
@@ -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"
)
10 changes: 9 additions & 1 deletion pkg/swiftring/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
21 changes: 21 additions & 0 deletions pkg/swiftstorage/const.go
Original file line number Diff line number Diff line change
@@ -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"
)
6 changes: 5 additions & 1 deletion pkg/swiftstorage/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
}
}

0 comments on commit eaefddf

Please sign in to comment.