Skip to content

Commit 8cbe0a8

Browse files
committed
Add TopologyRef struct and common functions
TopologyRef represents a struct referenced by the service operators to retrieve a Topology that is eventually applied to the resulting Deployments/StatefulSets. This patch allows to reduce the amount of code duplication across the operators, providing both the TopologyRef struct that can be added in the Services' API, as well as "EnsureTopologyRef" and "EnsureDeletedTopologyRef" where the basic logic of retrieving and managing finalizers is implemented. Signed-off-by: Francesco Pantano <fpantano@redhat.com>
1 parent 4bcef17 commit 8cbe0a8

File tree

14 files changed

+427
-280
lines changed

14 files changed

+427
-280
lines changed

modules/ansible/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ require gopkg.in/yaml.v3 v3.0.1
66

77
require (
88
github.com/kr/pretty v0.3.1 // indirect
9-
github.com/rogpeppe/go-internal v1.10.0 // indirect
9+
github.com/rogpeppe/go-internal v1.11.0 // indirect
1010
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
1111
)

modules/ansible/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
88
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
99
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
1010
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
11-
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
12-
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
11+
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
12+
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
1313
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1414
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
1515
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

modules/certmanager/go.mod

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@ require (
1111
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20240122120141-2eff3281aef1
1212
go.uber.org/zap v1.27.0
1313
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
14-
k8s.io/api v0.29.10
15-
k8s.io/apimachinery v0.29.10
16-
k8s.io/client-go v0.29.10
14+
k8s.io/api v0.29.12
15+
k8s.io/apimachinery v0.29.12
16+
k8s.io/client-go v0.29.12
1717
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
1818
sigs.k8s.io/controller-runtime v0.17.6
1919
)
2020

2121
require (
2222
github.com/beorn7/perks v1.0.1 // indirect
2323
github.com/cespare/xxhash/v2 v2.2.0 // indirect
24-
github.com/davecgh/go-spew v1.1.1 // indirect
25-
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
26-
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
24+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
25+
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
26+
github.com/evanphx/json-patch v5.7.0+incompatible // indirect
27+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
2728
github.com/fsnotify/fsnotify v1.7.0 // indirect
2829
github.com/go-logr/zapr v1.3.0 // indirect
29-
github.com/go-openapi/jsonpointer v0.19.6 // indirect
30-
github.com/go-openapi/jsonreference v0.20.2 // indirect
31-
github.com/go-openapi/swag v0.22.3 // indirect
30+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
31+
github.com/go-openapi/jsonreference v0.21.0 // indirect
32+
github.com/go-openapi/swag v0.23.0 // indirect
3233
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
3334
github.com/gogo/protobuf v1.3.2 // indirect
3435
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@@ -37,40 +38,39 @@ require (
3738
github.com/google/go-cmp v0.6.0 // indirect
3839
github.com/google/gofuzz v1.2.0 // indirect
3940
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
40-
github.com/imdario/mergo v0.3.12 // indirect
41+
github.com/imdario/mergo v0.3.16 // indirect
4142
github.com/josharian/intern v1.0.0 // indirect
4243
github.com/json-iterator/go v1.1.12 // indirect
4344
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.5 // indirect
4445
github.com/mailru/easyjson v0.7.7 // indirect
45-
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
4646
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4747
github.com/modern-go/reflect2 v1.0.2 // indirect
4848
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
4949
github.com/openshift/api v3.9.0+incompatible // indirect
5050
github.com/pkg/errors v0.9.1 // indirect
51-
github.com/prometheus/client_golang v1.18.0 // indirect
52-
github.com/prometheus/client_model v0.5.0 // indirect
53-
github.com/prometheus/common v0.45.0 // indirect
54-
github.com/prometheus/procfs v0.12.0 // indirect
51+
github.com/prometheus/client_golang v1.19.0 // indirect
52+
github.com/prometheus/client_model v0.6.0 // indirect
53+
github.com/prometheus/common v0.51.1 // indirect
54+
github.com/prometheus/procfs v0.13.0 // indirect
5555
github.com/spf13/pflag v1.0.5 // indirect
5656
go.uber.org/multierr v1.11.0 // indirect
5757
golang.org/x/net v0.28.0 // indirect
58-
golang.org/x/oauth2 v0.12.0 // indirect
58+
golang.org/x/oauth2 v0.18.0 // indirect
5959
golang.org/x/sys v0.23.0 // indirect
6060
golang.org/x/term v0.23.0 // indirect
6161
golang.org/x/text v0.17.0 // indirect
62-
golang.org/x/time v0.3.0 // indirect
62+
golang.org/x/time v0.5.0 // indirect
6363
golang.org/x/tools v0.24.0 // indirect
6464
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
65-
google.golang.org/appengine v1.6.7 // indirect
65+
google.golang.org/appengine v1.6.8 // indirect
6666
google.golang.org/protobuf v1.34.1 // indirect
6767
gopkg.in/inf.v0 v0.9.1 // indirect
6868
gopkg.in/yaml.v2 v2.4.0 // indirect
6969
gopkg.in/yaml.v3 v3.0.1 // indirect
70-
k8s.io/apiextensions-apiserver v0.29.10 // indirect
71-
k8s.io/component-base v0.29.10 // indirect
72-
k8s.io/klog/v2 v2.110.1 // indirect
73-
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
70+
k8s.io/apiextensions-apiserver v0.29.12 // indirect
71+
k8s.io/component-base v0.29.12 // indirect
72+
k8s.io/klog/v2 v2.120.1 // indirect
73+
k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect
7474
sigs.k8s.io/gateway-api v0.6.0 // indirect
7575
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
7676
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect

0 commit comments

Comments
 (0)