Skip to content

Commit 00e666b

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 <[email protected]>
1 parent 4bcef17 commit 00e666b

File tree

14 files changed

+335
-280
lines changed

14 files changed

+335
-280
lines changed

modules/ansible/go.mod

+1-1
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

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ 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=
1312
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1413
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
1514
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

modules/certmanager/go.mod

+21-22
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ 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 v5.9.0 // indirect
2727
github.com/fsnotify/fsnotify v1.7.0 // indirect
2828
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
29+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
30+
github.com/go-openapi/jsonreference v0.21.0 // indirect
31+
github.com/go-openapi/swag v0.23.0 // indirect
3232
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
3333
github.com/gogo/protobuf v1.3.2 // indirect
3434
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@@ -37,40 +37,39 @@ require (
3737
github.com/google/go-cmp v0.6.0 // indirect
3838
github.com/google/gofuzz v1.2.0 // indirect
3939
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect
40-
github.com/imdario/mergo v0.3.12 // indirect
40+
github.com/imdario/mergo v0.3.16 // indirect
4141
github.com/josharian/intern v1.0.0 // indirect
4242
github.com/json-iterator/go v1.1.12 // indirect
4343
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.5 // indirect
4444
github.com/mailru/easyjson v0.7.7 // indirect
45-
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
4645
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4746
github.com/modern-go/reflect2 v1.0.2 // indirect
4847
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
4948
github.com/openshift/api v3.9.0+incompatible // indirect
5049
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
50+
github.com/prometheus/client_golang v1.19.0 // indirect
51+
github.com/prometheus/client_model v0.6.0 // indirect
52+
github.com/prometheus/common v0.51.1 // indirect
53+
github.com/prometheus/procfs v0.13.0 // indirect
5554
github.com/spf13/pflag v1.0.5 // indirect
5655
go.uber.org/multierr v1.11.0 // indirect
5756
golang.org/x/net v0.28.0 // indirect
58-
golang.org/x/oauth2 v0.12.0 // indirect
57+
golang.org/x/oauth2 v0.18.0 // indirect
5958
golang.org/x/sys v0.23.0 // indirect
6059
golang.org/x/term v0.23.0 // indirect
6160
golang.org/x/text v0.17.0 // indirect
62-
golang.org/x/time v0.3.0 // indirect
61+
golang.org/x/time v0.5.0 // indirect
6362
golang.org/x/tools v0.24.0 // indirect
6463
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
65-
google.golang.org/appengine v1.6.7 // indirect
64+
google.golang.org/appengine v1.6.8 // indirect
6665
google.golang.org/protobuf v1.34.1 // indirect
6766
gopkg.in/inf.v0 v0.9.1 // indirect
6867
gopkg.in/yaml.v2 v2.4.0 // indirect
6968
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
69+
k8s.io/apiextensions-apiserver v0.29.12 // indirect
70+
k8s.io/component-base v0.29.12 // indirect
71+
k8s.io/klog/v2 v2.120.1 // indirect
72+
k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect
7473
sigs.k8s.io/gateway-api v0.6.0 // indirect
7574
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
7675
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect

0 commit comments

Comments
 (0)