Skip to content

Commit ef04575

Browse files
Embed CAPI Operator reconciler in turtles
Signed-off-by: Danil-Grigorev <[email protected]>
1 parent 3436702 commit ef04575

File tree

8 files changed

+419
-18
lines changed

8 files changed

+419
-18
lines changed

api/v1alpha1/capiprovider_wrapper.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package v1alpha1
1818

1919
import (
2020
"cmp"
21-
"strings"
2221

2322
operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2"
2423
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -58,7 +57,7 @@ func (b *CAPIProvider) SetStatus(in operatorv1.ProviderStatus) {
5857

5958
// GetType returns the type of the CAPIProvider.
6059
func (b *CAPIProvider) GetType() string {
61-
return strings.ToLower(string(b.Spec.Type))
60+
return "capiprovider"
6261
}
6362

6463
// GetItems returns the list of GenericProviders for CAPIProviderList.

api/v1alpha1/groupversion_info.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ var (
4848
&operatorv1.IPAMProvider{},
4949
}
5050

51-
// ProvidersMap is a map of registered CAPI Operator resources satisfying Provider interface.
52-
ProvidersMap = map[string]operatorv1.GenericProvider{}
53-
5451
// ProviderLists is a list of registered CAPI Operator resources satisfying ProviderList interface.
5552
ProviderLists = []operatorv1.GenericProviderList{
5653
&operatorv1.CoreProviderList{},
@@ -62,12 +59,6 @@ var (
6259
}
6360
)
6461

65-
func init() {
66-
for _, provider := range Providers {
67-
ProvidersMap[provider.GetType()] = provider
68-
}
69-
}
70-
7162
// AddKnownTypes adds the list of known types to api.Scheme.
7263
func AddKnownTypes(scheme *runtime.Scheme) {
7364
scheme.AddKnownTypes(GroupVersion, &CAPIProvider{}, &CAPIProviderList{})

api/v1alpha1/provider_types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,3 @@ const (
6262
// Failed status defines a failed state of provider provisioning.
6363
Failed Phase = "Failed"
6464
)
65-
66-
// ProviderNameAnnotation is the annotation key for the provider name.
67-
const ProviderNameAnnotation = "turtles.cattle.io/provider-name"

go.mod

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,47 +24,90 @@ require (
2424
)
2525

2626
require (
27+
cel.dev/expr v0.18.0 // indirect
28+
dario.cat/mergo v1.0.1 // indirect
2729
github.com/MakeNowJust/heredoc v1.0.0 // indirect
30+
github.com/Masterminds/goutils v1.1.1 // indirect
31+
github.com/Masterminds/semver/v3 v3.3.0 // indirect
32+
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
33+
github.com/ProtonMail/go-crypto v1.0.0 // indirect
34+
github.com/adrg/xdg v0.5.3 // indirect
35+
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
36+
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
2837
github.com/beorn7/perks v1.0.1 // indirect
38+
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
2939
github.com/cespare/xxhash/v2 v2.3.0 // indirect
40+
github.com/cloudflare/circl v1.3.7 // indirect
3041
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
42+
github.com/distribution/reference v0.6.0 // indirect
43+
github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // indirect
3144
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
3245
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
46+
github.com/felixge/httpsnoop v1.0.4 // indirect
3347
github.com/fsnotify/fsnotify v1.8.0 // indirect
3448
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
49+
github.com/go-logr/stdr v1.2.2 // indirect
3550
github.com/go-logr/zapr v1.3.0 // indirect
3651
github.com/go-openapi/jsonpointer v0.21.0 // indirect
3752
github.com/go-openapi/jsonreference v0.20.2 // indirect
3853
github.com/go-openapi/swag v0.23.0 // indirect
3954
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
55+
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
4056
github.com/gobuffalo/flect v1.0.3 // indirect
4157
github.com/gogo/protobuf v1.3.2 // indirect
4258
github.com/golang/protobuf v1.5.4 // indirect
4359
github.com/google/btree v1.1.3 // indirect
60+
github.com/google/cel-go v0.22.0 // indirect
4461
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
4562
github.com/google/go-cmp v0.7.0 // indirect
63+
github.com/google/go-github/v52 v52.0.0 // indirect
64+
github.com/google/go-github/v53 v53.2.0 // indirect
65+
github.com/google/go-querystring v1.1.0 // indirect
4666
github.com/google/gofuzz v1.2.0 // indirect
4767
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
4868
github.com/google/uuid v1.6.0 // indirect
69+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
70+
github.com/huandu/xstrings v1.5.0 // indirect
4971
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5072
github.com/josharian/intern v1.0.0 // indirect
5173
github.com/json-iterator/go v1.1.12 // indirect
5274
github.com/mailru/easyjson v0.7.7 // indirect
75+
github.com/mitchellh/copystructure v1.2.0 // indirect
76+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
5377
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5478
github.com/modern-go/reflect2 v1.0.2 // indirect
5579
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
80+
github.com/opencontainers/go-digest v1.0.0 // indirect
81+
github.com/opencontainers/image-spec v1.1.1 // indirect
82+
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
5683
github.com/prometheus/client_golang v1.19.1 // indirect
5784
github.com/prometheus/client_model v0.6.1 // indirect
5885
github.com/prometheus/common v0.55.0 // indirect
5986
github.com/prometheus/procfs v0.15.1 // indirect
87+
github.com/sagikazarmark/locafero v0.7.0 // indirect
88+
github.com/shopspring/decimal v1.4.0 // indirect
89+
github.com/sourcegraph/conc v0.3.0 // indirect
90+
github.com/spf13/afero v1.12.0 // indirect
91+
github.com/spf13/cast v1.7.1 // indirect
6092
github.com/spf13/cobra v1.9.1 // indirect
61-
github.com/stretchr/testify v1.10.0 // indirect
93+
github.com/spf13/viper v1.20.0 // indirect
94+
github.com/stoewer/go-strcase v1.3.0 // indirect
95+
github.com/subosito/gotenv v1.6.0 // indirect
96+
github.com/valyala/fastjson v1.6.4 // indirect
6297
github.com/x448/float16 v0.8.4 // indirect
98+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
6399
go.opentelemetry.io/otel v1.29.0 // indirect
100+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
101+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
102+
go.opentelemetry.io/otel/metric v1.29.0 // indirect
103+
go.opentelemetry.io/otel/sdk v1.29.0 // indirect
64104
go.opentelemetry.io/otel/trace v1.29.0 // indirect
105+
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
65106
go.uber.org/automaxprocs v1.6.0 // indirect
66107
go.uber.org/multierr v1.11.0 // indirect
67108
go.uber.org/zap v1.27.0 // indirect
109+
golang.org/x/crypto v0.36.0 // indirect
110+
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
68111
golang.org/x/net v0.38.0 // indirect
69112
golang.org/x/oauth2 v0.30.0 // indirect
70113
golang.org/x/sync v0.14.0 // indirect
@@ -73,13 +116,18 @@ require (
73116
golang.org/x/time v0.8.0 // indirect
74117
golang.org/x/tools v0.31.0 // indirect
75118
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
119+
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
120+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect
121+
google.golang.org/grpc v1.67.3 // indirect
76122
google.golang.org/protobuf v1.36.5 // indirect
77123
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
78124
gopkg.in/inf.v0 v0.9.1 // indirect
79125
gopkg.in/yaml.v3 v3.0.1 // indirect
80126
k8s.io/apiserver v0.32.5 // indirect
81127
k8s.io/cluster-bootstrap v0.32.3 // indirect
82128
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
129+
oras.land/oras-go/v2 v2.6.0 // indirect
130+
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 // indirect
83131
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
84132
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
85133
)

0 commit comments

Comments
 (0)