Skip to content

Commit

Permalink
Add validator for clusterproxyconfigs to make sure only one is ever c…
Browse files Browse the repository at this point in the history
…reated for a given cluster
  • Loading branch information
crobby committed Jan 29, 2024
1 parent 6d6130f commit f6c8e39
Show file tree
Hide file tree
Showing 10 changed files with 330 additions and 78 deletions.
9 changes: 9 additions & 0 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ If yes, the webhook redacts the role, so that it only grants a deletion permissi

# management.cattle.io/v3

## ClusterProxyConfig

### Validation Checks

#### On create

When creating a clusterproxyconfig, we check to make sure that one does not already exist for the given cluster.
Only 1 clusterproxyconfig per downstream cluster is ever permitted.

## ClusterRoleTemplateBinding

### Validation Checks
Expand Down
48 changes: 25 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ go 1.21
replace github.com/rancher/wrangler v1.1.1 => github.com/rancher/wrangler v1.1.1-0.20230831050635-df1bd5aae9df

replace (
github.com/rancher/rancher/pkg/apis => github.com/pmatseykanets/rancher/pkg/apis v0.0.0-20240123143352-5df802d576a6
k8s.io/api => k8s.io/api v0.27.4
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.27.4
k8s.io/apimachinery => k8s.io/apimachinery v0.27.4
Expand All @@ -20,6 +21,7 @@ replace (
k8s.io/controller-manager => k8s.io/controller-manager v0.27.4
k8s.io/cri-api => k8s.io/cri-api v0.27.4
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.27.4
k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.28.2
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.27.4
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.27.4
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
Expand Down Expand Up @@ -49,8 +51,8 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/text v0.13.0
golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846
golang.org/x/text v0.14.0
golang.org/x/tools v0.14.0
k8s.io/api v0.27.6
k8s.io/apiextensions-apiserver v0.27.6
k8s.io/apimachinery v0.27.6
Expand All @@ -61,7 +63,7 @@ require (
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/cluster-api v1.5.0
sigs.k8s.io/controller-runtime v0.15.0
sigs.k8s.io/yaml v1.3.0
sigs.k8s.io/yaml v1.4.0
)

require (
Expand All @@ -84,7 +86,7 @@ require (
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
Expand All @@ -95,9 +97,9 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/cel-go v0.16.0 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
Expand All @@ -113,18 +115,18 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/gomega v1.27.10 // indirect
github.com/onsi/gomega v1.30.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/rancher/aks-operator v1.2.0 // indirect
github.com/rancher/eks-operator v1.3.0 // indirect
github.com/rancher/aks-operator v1.3.0-rc1 // indirect
github.com/rancher/eks-operator v1.4.0-rc1 // indirect
github.com/rancher/fleet/pkg/apis v0.0.0-20231017140638-93432f288e79 // indirect
github.com/rancher/gke-operator v1.2.0 // indirect
github.com/rancher/gke-operator v1.3.0-rc2 // indirect
github.com/rancher/norman v0.0.0-20230831160711-5de27f66385d // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.1 // indirect
Expand All @@ -147,20 +149,20 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/time v0.5.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect
google.golang.org/grpc v1.57.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
Expand Down
Loading

0 comments on commit f6c8e39

Please sign in to comment.