Skip to content

Commit

Permalink
Merge pull request #205 from fmount/topologyref
Browse files Browse the repository at this point in the history
Update topology reference from lib-common to infra-operator
  • Loading branch information
openshift-merge-bot[bot] authored Feb 11, 2025
2 parents a7ab7b2 + f08d8ed commit 1398188
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 30 deletions.
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
github.com/onsi/ginkgo/v2 v2.20.1
github.com/onsi/gomega v1.34.1
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250204091142-ae8379c31edb
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250210183624-a8bf66784d6d
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250205143454-43504d7ad19a
k8s.io/api v0.29.13
k8s.io/apimachinery v0.29.13
Expand Down
4 changes: 2 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo
github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250204091142-ae8379c31edb h1:SedlzLahRyzctVTXzVrpmjui78A7Z0g8V1cmPBoQzYY=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250204091142-ae8379c31edb/go.mod h1:TDaE7BVQvJwJGFm33R6xcPTeF8LKAnMh+a1ho+YqJHs=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250210183624-a8bf66784d6d h1:JuIcZjfFUH9G68MR9F62xBK4eS5F2P5nKVCoDXFrvQM=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250210183624-a8bf66784d6d/go.mod h1:kkjcOSZ7jkHbVzxJd0nDQzjB+vqafuAMgSf7AnEXydw=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250205143454-43504d7ad19a h1:3LuUgB85VxGD6lmVOeZelYEASmytkrzaudU014PN7xw=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250205143454-43504d7ad19a/go.mod h1:KxnNSUk15llkKTSq/bQEE7pnc0IMk44fxhoBRpimMa8=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
5 changes: 3 additions & 2 deletions api/v1beta1/barbican_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package v1beta1
import (
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
"github.com/openstack-k8s-operators/lib-common/modules/common/topology"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"

)

const (
Expand Down Expand Up @@ -116,7 +117,7 @@ type BarbicanSpecBase struct {
// +kubebuilder:validation:Optional
// TopologyRef to apply the Topology defined by the associated CR referenced
// by name
TopologyRef *topology.TopoRef `json:"topologyRef,omitempty"`
TopologyRef *topologyv1.TopoRef `json:"topologyRef,omitempty"`
}

// BarbicanStatus defines the observed state of Barbican
Expand Down
5 changes: 3 additions & 2 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package v1beta1

import (
corev1 "k8s.io/api/core/v1"
"github.com/openstack-k8s-operators/lib-common/modules/common/topology"
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"

)

// BarbicanTemplate defines common Spec elements for all Barbican components
Expand Down Expand Up @@ -111,7 +112,7 @@ type BarbicanComponentTemplate struct {
// +kubebuilder:validation:Optional
// TopologyRef to apply the Topology defined by the associated CR referenced
// by name
TopologyRef *topology.TopoRef `json:"topologyRef,omitempty"`
TopologyRef *topologyv1.TopoRef `json:"topologyRef,omitempty"`
}

// +kubebuilder:validation:Enum=simple_crypto;pkcs11
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions controllers/barbican_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/openstack-k8s-operators/lib-common/modules/common/helper"
"github.com/openstack-k8s-operators/lib-common/modules/common/labels"
"github.com/openstack-k8s-operators/lib-common/modules/common/secret"
"github.com/openstack-k8s-operators/lib-common/modules/common/topology"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand Down Expand Up @@ -103,8 +102,8 @@ func GenerateSecretStoreTemplateMap(
func ensureBarbicanTopology(
ctx context.Context,
helper *helper.Helper,
tpRef *topology.TopoRef,
lastAppliedTopology *topology.TopoRef,
tpRef *topologyv1.TopoRef,
lastAppliedTopology *topologyv1.TopoRef,
finalizer string,
selector string,
) (*topologyv1.Topology, error) {
Expand All @@ -122,7 +121,7 @@ func ensureBarbicanTopology(
// referenced topology (tpRef.Name != lastAppliedTopology.Name)
if (tpRef == nil && lastAppliedTopology.Name != "") ||
(tpRef != nil && tpRef.Name != lastAppliedTopology.Name) {
_, err = topology.EnsureDeletedTopologyRef(
_, err = topologyv1.EnsureDeletedTopologyRef(
ctx,
helper,
lastAppliedTopology,
Expand All @@ -144,7 +143,7 @@ func ensureBarbicanTopology(
selector,
)
// Retrieve the referenced Topology
podTopology, _, err = topology.EnsureTopologyRef(
podTopology, _, err = topologyv1.EnsureTopologyRef(
ctx,
helper,
tpRef,
Expand Down
7 changes: 3 additions & 4 deletions controllers/barbicanapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
"github.com/openstack-k8s-operators/lib-common/modules/common/secret"
"github.com/openstack-k8s-operators/lib-common/modules/common/service"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
"github.com/openstack-k8s-operators/lib-common/modules/common/topology"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1"
"k8s.io/apimachinery/pkg/fields"
Expand Down Expand Up @@ -607,10 +606,10 @@ func (r *BarbicanAPIReconciler) reconcileDelete(ctx context.Context, instance *b
}

// Remove finalizer on the Topology CR
if ctrlResult, err := topology.EnsureDeletedTopologyRef(
if ctrlResult, err := topologyv1.EnsureDeletedTopologyRef(
ctx,
helper,
&topology.TopoRef{
&topologyv1.TopoRef{
Name: instance.Status.LastAppliedTopology,
Namespace: instance.Namespace,
},
Expand Down Expand Up @@ -842,7 +841,7 @@ func (r *BarbicanAPIReconciler) reconcileNormal(ctx context.Context, instance *b
//
// Handle Topology
//
lastTopologyRef := topology.TopoRef{
lastTopologyRef := topologyv1.TopoRef{
Name: instance.Status.LastAppliedTopology,
Namespace: instance.Namespace,
}
Expand Down
7 changes: 3 additions & 4 deletions controllers/barbicankeystonelistener_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/deployment"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
"github.com/openstack-k8s-operators/lib-common/modules/common/topology"

//"github.com/openstack-k8s-operators/lib-common/modules/common/endpoint"
"github.com/openstack-k8s-operators/lib-common/modules/common/env"
Expand Down Expand Up @@ -380,10 +379,10 @@ func (r *BarbicanKeystoneListenerReconciler) reconcileDelete(ctx context.Context
*/

// Remove finalizer on the Topology CR
if ctrlResult, err := topology.EnsureDeletedTopologyRef(
if ctrlResult, err := topologyv1.EnsureDeletedTopologyRef(
ctx,
helper,
&topology.TopoRef{
&topologyv1.TopoRef{
Name: instance.Status.LastAppliedTopology,
Namespace: instance.Namespace,
},
Expand Down Expand Up @@ -572,7 +571,7 @@ func (r *BarbicanKeystoneListenerReconciler) reconcileNormal(ctx context.Context
//
// Handle Topology
//
lastTopologyRef := topology.TopoRef{
lastTopologyRef := topologyv1.TopoRef{
Name: instance.Status.LastAppliedTopology,
Namespace: instance.Namespace,
}
Expand Down
7 changes: 3 additions & 4 deletions controllers/barbicanworker_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/deployment"
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
"github.com/openstack-k8s-operators/lib-common/modules/common/topology"

"github.com/openstack-k8s-operators/lib-common/modules/common/env"
"github.com/openstack-k8s-operators/lib-common/modules/common/helper"
Expand Down Expand Up @@ -368,10 +367,10 @@ func (r *BarbicanWorkerReconciler) reconcileDelete(ctx context.Context, instance
Log.Info(fmt.Sprintf("Reconciling Service '%s' delete", instance.Name))

// Remove finalizer on the Topology CR
if ctrlResult, err := topology.EnsureDeletedTopologyRef(
if ctrlResult, err := topologyv1.EnsureDeletedTopologyRef(
ctx,
helper,
&topology.TopoRef{
&topologyv1.TopoRef{
Name: instance.Status.LastAppliedTopology,
Namespace: instance.Namespace,
},
Expand Down Expand Up @@ -583,7 +582,7 @@ func (r *BarbicanWorkerReconciler) reconcileNormal(ctx context.Context, instance
//
// Handle Topology
//
lastTopologyRef := topology.TopoRef{
lastTopologyRef := topologyv1.TopoRef{
Name: instance.Status.LastAppliedTopology,
Namespace: instance.Namespace,
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/onsi/ginkgo/v2 v2.20.1
github.com/onsi/gomega v1.34.1
github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-00010101000000-000000000000
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250204091142-ae8379c31edb
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250210183624-a8bf66784d6d
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20250203105048-182afa0c45d8
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250205143454-43504d7ad19a
github.com/openstack-k8s-operators/lib-common/modules/storage v0.5.1-0.20250205143454-43504d7ad19a
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 h1:J1wuGhVxpsHykZBa6Beb1gQ96Ptej9AE/BvwCBiRj1E=
github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094/go.mod h1:CxgbWAlvu2iQB0UmKTtRu1YfepRg1/vJ64n2DlIEVz4=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250204091142-ae8379c31edb h1:SedlzLahRyzctVTXzVrpmjui78A7Z0g8V1cmPBoQzYY=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250204091142-ae8379c31edb/go.mod h1:TDaE7BVQvJwJGFm33R6xcPTeF8LKAnMh+a1ho+YqJHs=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250210183624-a8bf66784d6d h1:JuIcZjfFUH9G68MR9F62xBK4eS5F2P5nKVCoDXFrvQM=
github.com/openstack-k8s-operators/infra-operator/apis v0.5.1-0.20250210183624-a8bf66784d6d/go.mod h1:kkjcOSZ7jkHbVzxJd0nDQzjB+vqafuAMgSf7AnEXydw=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20250203105048-182afa0c45d8 h1:HIL7hIXZPuwMVr46jMoLxHToBHAplGWwOtR4FlMrCUU=
github.com/openstack-k8s-operators/keystone-operator/api v0.5.1-0.20250203105048-182afa0c45d8/go.mod h1:pZ3kLMgL9thHN7ewyLsTE8R0nsI81f8KJ0yEVBBpa9Q=
github.com/openstack-k8s-operators/lib-common/modules/common v0.5.1-0.20250205143454-43504d7ad19a h1:3LuUgB85VxGD6lmVOeZelYEASmytkrzaudU014PN7xw=
Expand Down

0 comments on commit 1398188

Please sign in to comment.