diff --git a/.gitmodules b/.gitmodules index c2fad47..8f84209 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "build"] path = build - url = https://github.com/upbound/build + url = https://github.com/crossplane/build diff --git a/apis/core/v1alpha1/zz_generated.deepcopy.go b/apis/core/v1alpha1/zz_generated.deepcopy.go index 82e6b79..9bd0ba0 100644 --- a/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -172,7 +172,7 @@ func (in *ClusterObservationStatus) DeepCopy() *ClusterObservationStatus { func (in *ClusterParameters) DeepCopyInto(out *ClusterParameters) { *out = *in out.InstanceRef = in.InstanceRef - out.ClusterSpec = in.ClusterSpec + in.ClusterSpec.DeepCopyInto(&out.ClusterSpec) if in.Annotations != nil { in, out := &in.Annotations, &out.Annotations *out = make(map[string]string, len(*in)) diff --git a/build b/build index 613d169..f67b099 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 613d1694ec9727b759b4ade8fd6b1f3e849c8267 +Subproject commit f67b099288946d6ae11625435cc541b580606e22 diff --git a/go.mod b/go.mod index c753995..2b7b6b9 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,9 @@ module github.com/akuityio/provider-crossplane-akuity -go 1.22.0 - -toolchain go1.22.5 +go 1.21 require ( + github.com/akuity/api-client-go v0.15.0 github.com/akuity/grpc-gateway-client v0.0.0-20231116134900-80c401329778 github.com/avast/retry-go/v4 v4.5.1 github.com/crossplane/crossplane-runtime v1.15.1 @@ -15,10 +14,10 @@ require ( go.uber.org/mock v0.4.0 google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe gopkg.in/alecthomas/kingpin.v2 v2.2.6 - k8s.io/apimachinery v0.30.2 - k8s.io/client-go v0.30.2 - k8s.io/kubectl v0.30.2 - sigs.k8s.io/controller-runtime v0.18.4 + k8s.io/apimachinery v0.29.1 + k8s.io/client-go v0.29.1 + k8s.io/kubectl v0.29.1 + sigs.k8s.io/controller-runtime v0.17.0 sigs.k8s.io/controller-tools v0.14.0 ) @@ -35,7 +34,6 @@ require ( require ( dario.cat/mergo v1.0.0 // indirect - github.com/akuity/api-client-go v0.10.0 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -43,7 +41,7 @@ require ( github.com/dave/jennifer v1.7.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.11.2 // indirect - github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/evanphx/json-patch/v5 v5.8.1 // indirect github.com/fatih/color v1.16.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect @@ -54,7 +52,7 @@ require ( github.com/gobuffalo/flect v1.0.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect @@ -76,14 +74,14 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/mod v0.15.0 // indirect + golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.16.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.17.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect @@ -92,11 +90,12 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.30.2 - k8s.io/apiextensions-apiserver v0.30.1 // indirect + k8s.io/api v0.29.1 + k8s.io/apiextensions-apiserver v0.29.1 // indirect + k8s.io/component-base v0.29.1 // indirect k8s.io/klog/v2 v2.120.1 // indirect - k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect - k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect + k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 // indirect + k8s.io/utils v0.0.0-20240102154912-e7106e64919e sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 diff --git a/go.sum b/go.sum index d5aa7be..3f111ea 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-2023110619213 buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231106192134-1baebb0a1518.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/akuity/api-client-go v0.10.0 h1:v38/8a1e1abOkLzpVflytraAcUX0UGDRIum8W7luqBY= -github.com/akuity/api-client-go v0.10.0/go.mod h1:F9Rdem0OdJQ+JLsO2I76jyrFFypK9JhgjnlLUve2KU0= +github.com/akuity/api-client-go v0.15.0 h1:w9OPnQGiAMiXIZN0+eqN7Fph/u/g15H8Ug3/PCE/esA= +github.com/akuity/api-client-go v0.15.0/go.mod h1:ziHCeqFmAytZZ6lZbwvmq9hFG42bLV8iHnz13/SdMoo= github.com/akuity/grpc-gateway-client v0.0.0-20231116134900-80c401329778 h1:qj3+B4PU5AR2mBffDVXvP2d3hLCNDot28KKPWvQnOxs= github.com/akuity/grpc-gateway-client v0.0.0-20231116134900-80c401329778/go.mod h1:0MZqOxL+zq+hGedAjYhkm1tOKuZyjUmE/xA8nqXa9q0= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= @@ -38,8 +38,8 @@ github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+ github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= -github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/evanphx/json-patch/v5 v5.8.1 h1:iPEdwg0XayoS+E7Mth9JxwUtOgyVxnDTXHtKhZPlZxA= +github.com/evanphx/json-patch/v5 v5.8.1/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -66,8 +66,8 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/cel-go v0.18.1 h1:V/lAXKq4C3BYLDy/ARzMtpkEEYfHQpZzVyzy69nEUjs= github.com/google/cel-go v0.18.1/go.mod h1:PVAybmSnWkNMUZR/tEWFUiJ1Np4Hz0MHsZJcgC4zln4= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= @@ -117,10 +117,10 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= -github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= +github.com/onsi/ginkgo/v2 v2.14.0 h1:vSmGj2Z5YPb9JwCWT6z6ihcUvDhuXLc3sJiqd3jMKAY= +github.com/onsi/ginkgo/v2 v2.14.0/go.mod h1:JkUdW7JkN0V6rFvsHcJ478egV3XH9NxpD27Hal/PhZw= +github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -176,8 +176,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -237,8 +237,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -275,24 +275,26 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= -k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= -k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= -k8s.io/apiextensions-apiserver v0.30.1/go.mod h1:R4GuSrlhgq43oRY9sF2IToFh7PVlF1JjfWdoG3pixk4= -k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= -k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= -k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= +k8s.io/api v0.29.1 h1:DAjwWX/9YT7NQD4INu49ROJuZAAAP/Ijki48GUPzxqw= +k8s.io/api v0.29.1/go.mod h1:7Kl10vBRUXhnQQI8YR/R327zXC8eJ7887/+Ybta+RoQ= +k8s.io/apiextensions-apiserver v0.29.1 h1:S9xOtyk9M3Sk1tIpQMu9wXHm5O2MX6Y1kIpPMimZBZw= +k8s.io/apiextensions-apiserver v0.29.1/go.mod h1:zZECpujY5yTW58co8V2EQR4BD6A9pktVgHhvc0uLfeU= +k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc= +k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= +k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A= +k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks= +k8s.io/component-base v0.29.1 h1:MUimqJPCRnnHsskTTjKD+IC1EHBbRCVyi37IoFBrkYw= +k8s.io/component-base v0.29.1/go.mod h1:fP9GFjxYrLERq1GcWWZAE3bqbNcDKDytn2srWuHTtKc= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/kubectl v0.30.2 h1:cgKNIvsOiufgcs4yjvgkK0+aPCfa8pUwzXdJtkbhsH8= -k8s.io/kubectl v0.30.2/go.mod h1:rz7GHXaxwnigrqob0lJsiA07Df8RE3n1TSaC2CTeuB4= +k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15 h1:m6dl1pkxz3HuE2mP9MUYPCCGyy6IIFlv/vTlLBDxIwA= +k8s.io/kube-openapi v0.0.0-20240117194847-208609032b15/go.mod h1:Pa1PvrP7ACSkuX6I7KYomY6cmMA0Tx86waBhDUgoKPw= +k8s.io/kubectl v0.29.1 h1:rWnW3hi/rEUvvg7jp4iYB68qW5un/urKbv7fu3Vj0/s= +k8s.io/kubectl v0.29.1/go.mod h1:SZzvLqtuOJYSvZzPZR9weSuP0wDQ+N37CENJf0FhDF4= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= -sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= +sigs.k8s.io/controller-runtime v0.17.0 h1:fjJQf8Ukya+VjogLO6/bNX9HE6Y2xpsO5+fyS26ur/s= +sigs.k8s.io/controller-runtime v0.17.0/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s= sigs.k8s.io/controller-tools v0.14.0 h1:rnNoCC5wSXlrNoBKKzL70LNJKIQKEzT6lloG6/LF73A= sigs.k8s.io/controller-tools v0.14.0/go.mod h1:TV7uOtNNnnR72SpzhStvPkoS/U5ir0nMudrkrC4M9Sc= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/internal/clients/akuity/mock/argocd_service_gateway_client_mock.go b/internal/clients/akuity/mock/argocd_service_gateway_client_mock.go index 46b97c3..471850e 100644 --- a/internal/clients/akuity/mock/argocd_service_gateway_client_mock.go +++ b/internal/clients/akuity/mock/argocd_service_gateway_client_mock.go @@ -162,6 +162,21 @@ func (mr *MockArgoCDServiceGatewayClientMockRecorder) GetAIAssistantUsageStats(a return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAIAssistantUsageStats", reflect.TypeOf((*MockArgoCDServiceGatewayClient)(nil).GetAIAssistantUsageStats), arg0, arg1) } +// GetClusterAPIServerCAData mocks base method. +func (m *MockArgoCDServiceGatewayClient) GetClusterAPIServerCAData(arg0 context.Context, arg1 *argocdv1.GetClusterAPIServerCADataRequest) (*argocdv1.GetClusterAPIServerCADataResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetClusterAPIServerCAData", arg0, arg1) + ret0, _ := ret[0].(*argocdv1.GetClusterAPIServerCADataResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetClusterAPIServerCAData indicates an expected call of GetClusterAPIServerCAData. +func (mr *MockArgoCDServiceGatewayClientMockRecorder) GetClusterAPIServerCAData(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClusterAPIServerCAData", reflect.TypeOf((*MockArgoCDServiceGatewayClient)(nil).GetClusterAPIServerCAData), arg0, arg1) +} + // GetInstance mocks base method. func (m *MockArgoCDServiceGatewayClient) GetInstance(arg0 context.Context, arg1 *argocdv1.GetInstanceRequest) (*argocdv1.GetInstanceResponse, error) { m.ctrl.T.Helper() @@ -703,6 +718,21 @@ func (mr *MockArgoCDServiceGatewayClientMockRecorder) UpdateInstanceResourceCust return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateInstanceResourceCustomizations", reflect.TypeOf((*MockArgoCDServiceGatewayClient)(nil).UpdateInstanceResourceCustomizations), arg0, arg1) } +// UpdateInstanceWorkspace mocks base method. +func (m *MockArgoCDServiceGatewayClient) UpdateInstanceWorkspace(arg0 context.Context, arg1 *argocdv1.UpdateInstanceWorkspaceRequest) (*argocdv1.UpdateInstanceWorkspaceResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateInstanceWorkspace", arg0, arg1) + ret0, _ := ret[0].(*argocdv1.UpdateInstanceWorkspaceResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateInstanceWorkspace indicates an expected call of UpdateInstanceWorkspace. +func (mr *MockArgoCDServiceGatewayClientMockRecorder) UpdateInstanceWorkspace(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateInstanceWorkspace", reflect.TypeOf((*MockArgoCDServiceGatewayClient)(nil).UpdateInstanceWorkspace), arg0, arg1) +} + // UpsertInstanceAccount mocks base method. func (m *MockArgoCDServiceGatewayClient) UpsertInstanceAccount(arg0 context.Context, arg1 *argocdv1.UpsertInstanceAccountRequest) (*argocdv1.UpsertInstanceAccountResponse, error) { m.ctrl.T.Helper() diff --git a/internal/controller/cluster/cluster.go b/internal/controller/cluster/cluster.go index fa1542d..2b2ded9 100644 --- a/internal/controller/cluster/cluster.go +++ b/internal/controller/cluster/cluster.go @@ -47,7 +47,6 @@ import ( "github.com/akuityio/provider-crossplane-akuity/internal/clients/kube" "github.com/akuityio/provider-crossplane-akuity/internal/controller/config" "github.com/akuityio/provider-crossplane-akuity/internal/features" - "github.com/akuityio/provider-crossplane-akuity/internal/reason" "github.com/akuityio/provider-crossplane-akuity/internal/types" "github.com/akuityio/provider-crossplane-akuity/internal/utils/pointer" ) @@ -156,12 +155,18 @@ func (c *External) Observe(ctx context.Context, mg resource.Managed) (managed.Ex akuityCluster, err := c.client.GetCluster(ctx, instanceID, meta.GetExternalName(managedCluster)) if err != nil { - if reason.IsNotFound(err) { - return managed.ExternalObservation{ResourceExists: false}, nil - } - - managedCluster.SetConditions(xpv1.ReconcileError(err)) - return managed.ExternalObservation{}, err + c.logger.Debug("As we are not able to differentiate PermissionDenied/NotFound when calling GetCluster, we simply treat as not found here", "error", err) + return managed.ExternalObservation{ResourceExists: false}, nil + + // As mentioned above, we simply treat PermissionDenied/NotFound as not found error here, otherwise, the provider + // is not able to create cluster. + + // if reason.IsNotFound(err) { + // return managed.ExternalObservation{ResourceExists: false}, nil + // } + // + // managedCluster.SetConditions(xpv1.ReconcileError(err)) + // return managed.ExternalObservation{}, err } actualCluster, err := types.AkuityAPIToCrossplaneCluster(instanceID, managedCluster.Spec.ForProvider, akuityCluster) diff --git a/internal/controller/cluster/cluster_test.go b/internal/controller/cluster/cluster_test.go index e588500..a1d2174 100644 --- a/internal/controller/cluster/cluster_test.go +++ b/internal/controller/cluster/cluster_test.go @@ -394,9 +394,13 @@ func TestObserve_GetClusterErr(t *testing.T) { Return(nil, errors.New("fake")).Times(1) resp, err := client.Observe(ctx, &managedCluster) - require.Error(t, err) - assert.Equal(t, managed.ExternalObservation{}, resp) - assert.Equal(t, xpv1.ReasonReconcileError, managedCluster.Status.Conditions[0].Reason) + // require.Error(t, err) + // assert.Equal(t, managed.ExternalObservation{}, resp) + // assert.Equal(t, xpv1.ReasonReconcileError, managedCluster.Status.Conditions[0].Reason) + + // we use not found for permission denied error + require.NoError(t, err) + assert.Equal(t, managed.ExternalObservation{ResourceExists: false}, resp) } func TestObserve_HealthStatusNotHealthy(t *testing.T) { diff --git a/internal/types/cluster.go b/internal/types/cluster.go index 8b6721f..97e9c01 100644 --- a/internal/types/cluster.go +++ b/internal/types/cluster.go @@ -39,8 +39,8 @@ func AkuityAPIToCrossplaneClusterObservation(cluster *argocdv1.Cluster) (v1alpha ID: cluster.GetId(), Name: cluster.GetName(), Description: cluster.GetDescription(), - Namespace: cluster.GetNamespace(), - NamespaceScoped: cluster.GetNamespaceScoped(), + Namespace: cluster.GetData().GetNamespace(), + NamespaceScoped: cluster.GetData().GetNamespaceScoped(), Labels: cluster.GetData().GetLabels(), Annotations: cluster.GetData().GetAnnotations(), AutoUpgradeDisabled: cluster.GetData().GetAutoUpgradeDisabled(), @@ -93,6 +93,28 @@ func AkuityAPIToClusterObservationAgentStateStatus(agentHealthStatuses map[strin return statuses } +func AkuityAPIToCrossplaneManagedClusterConfig(managedClusterConfig *argocdv1.ManagedClusterConfig) *generated.ManagedClusterConfig { + if managedClusterConfig == nil { + return nil + } + + return &generated.ManagedClusterConfig{ + SecretName: managedClusterConfig.GetSecretName(), + SecretKey: managedClusterConfig.GetSecretKey(), + } +} + +func CrossplaneToAkuityAPIManagedClusterConfig(managedClusterConfig *generated.ManagedClusterConfig) *akuitytypes.ManagedClusterConfig { + if managedClusterConfig == nil { + return nil + } + + return &akuitytypes.ManagedClusterConfig{ + SecretName: managedClusterConfig.SecretName, + SecretKey: managedClusterConfig.SecretKey, + } +} + func AkuityAPIToCrossplaneCluster(instanceID string, managedCluster v1alpha1.ClusterParameters, cluster *argocdv1.Cluster) (v1alpha1.ClusterParameters, error) { kustomizationYAML, err := AkuityAPIKustomizationToCrossplaneKustomization(cluster.GetData().GetKustomization()) if err != nil { @@ -120,19 +142,22 @@ func AkuityAPIToCrossplaneCluster(instanceID string, managedCluster v1alpha1.Clu Name: managedCluster.InstanceRef.Name, }, Name: cluster.GetName(), - Namespace: cluster.GetNamespace(), + Namespace: cluster.GetData().GetNamespace(), Labels: cluster.GetData().GetLabels(), Annotations: cluster.GetData().GetAnnotations(), ClusterSpec: generated.ClusterSpec{ Description: cluster.GetDescription(), - NamespaceScoped: cluster.GetNamespaceScoped(), + NamespaceScoped: cluster.GetData().GetNamespaceScoped(), Data: generated.ClusterData{ - Size: generated.ClusterSize(size), - AutoUpgradeDisabled: cluster.GetData().GetAutoUpgradeDisabled(), - Kustomization: string(kustomizationYAML), - AppReplication: cluster.GetData().GetAppReplication(), - TargetVersion: cluster.GetData().GetTargetVersion(), - RedisTunneling: cluster.GetData().GetRedisTunneling(), + Size: generated.ClusterSize(size), + AutoUpgradeDisabled: cluster.GetData().GetAutoUpgradeDisabled(), + Kustomization: string(kustomizationYAML), + AppReplication: cluster.GetData().GetAppReplication(), + TargetVersion: cluster.GetData().GetTargetVersion(), + RedisTunneling: cluster.GetData().GetRedisTunneling(), + DatadogAnnotationsEnabled: cluster.GetData().DatadogAnnotationsEnabled, //nolint:all + EksAddonEnabled: cluster.GetData().EksAddonEnabled, //nolint:all + ManagedClusterConfig: AkuityAPIToCrossplaneManagedClusterConfig(cluster.GetData().GetManagedClusterConfig()), }, }, EnableInClusterKubeConfig: managedCluster.EnableInClusterKubeConfig, @@ -169,12 +194,15 @@ func CrossplaneToAkuityAPICluster(cluster v1alpha1.ClusterParameters) (akuitytyp Description: cluster.ClusterSpec.Description, NamespaceScoped: cluster.ClusterSpec.NamespaceScoped, Data: akuitytypes.ClusterData{ - Size: akuitytypes.ClusterSize(cluster.ClusterSpec.Data.Size), - AutoUpgradeDisabled: &cluster.ClusterSpec.Data.AutoUpgradeDisabled, - Kustomization: kustomization, - AppReplication: &cluster.ClusterSpec.Data.AppReplication, - TargetVersion: cluster.ClusterSpec.Data.TargetVersion, - RedisTunneling: &cluster.ClusterSpec.Data.RedisTunneling, + Size: akuitytypes.ClusterSize(cluster.ClusterSpec.Data.Size), + AutoUpgradeDisabled: &cluster.ClusterSpec.Data.AutoUpgradeDisabled, + Kustomization: kustomization, + AppReplication: &cluster.ClusterSpec.Data.AppReplication, + TargetVersion: cluster.ClusterSpec.Data.TargetVersion, + RedisTunneling: &cluster.ClusterSpec.Data.RedisTunneling, + DatadogAnnotationsEnabled: cluster.ClusterSpec.Data.DatadogAnnotationsEnabled, + EksAddonEnabled: cluster.ClusterSpec.Data.EksAddonEnabled, + ManagedClusterConfig: CrossplaneToAkuityAPIManagedClusterConfig(cluster.ClusterSpec.Data.ManagedClusterConfig), }, }, }, nil diff --git a/internal/types/cluster_test.go b/internal/types/cluster_test.go index 98d0792..7a8d862 100644 --- a/internal/types/cluster_test.go +++ b/internal/types/cluster_test.go @@ -41,8 +41,8 @@ func TestAkuityAPIToCrossplaneClusterObservation(t *testing.T) { ID: fixtures.ArgocdCluster.GetId(), Name: fixtures.ArgocdCluster.GetName(), Description: fixtures.ArgocdCluster.GetDescription(), - Namespace: fixtures.ArgocdCluster.GetNamespace(), - NamespaceScoped: fixtures.ArgocdCluster.GetNamespaceScoped(), + Namespace: fixtures.ArgocdCluster.GetData().GetNamespace(), + NamespaceScoped: fixtures.ArgocdCluster.GetData().GetNamespaceScoped(), Labels: fixtures.ArgocdCluster.GetData().GetLabels(), Annotations: fixtures.ArgocdCluster.GetData().GetAnnotations(), AutoUpgradeDisabled: fixtures.ArgocdCluster.GetData().GetAutoUpgradeDisabled(), diff --git a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go index 9d5ffaf..d06e008 100644 --- a/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/akuity/v1alpha1/argocdinstance_types.go @@ -10,10 +10,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// ArgoCD is the Schema for the argocd API type ArgoCD struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -21,23 +17,10 @@ type ArgoCD struct { Spec ArgoCDSpec `json:"spec,omitempty"` } -//+kubebuilder:object:root=true - -// ArgoCDList contains a list of ArgoCD -type ArgoCDList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ArgoCD `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ArgoCD{}, &ArgoCDList{}) -} - type ArgoCDSpec struct { - Description string `json:"description"` - Version string `json:"version"` - Shard string `json:"shard"` + Description string `json:"description"` + Version string `json:"version"` + InstanceSpec InstanceSpec `json:"instanceSpec,omitempty"` } @@ -47,33 +30,50 @@ type ArgoCDExtensionInstallEntry struct { } type ClusterCustomization struct { - AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` + AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` Kustomization runtime.RawExtension `json:"kustomization,omitempty"` - AppReplication bool `json:"appReplication,omitempty"` - RedisTunneling bool `json:"redisTunneling,omitempty"` + AppReplication *bool `json:"appReplication,omitempty"` + RedisTunneling *bool `json:"redisTunneling,omitempty"` } type AppsetPolicy struct { Policy string `json:"policy,omitempty"` - OverridePolicy bool `json:"overridePolicy,omitempty"` + OverridePolicy *bool `json:"overridePolicy,omitempty"` +} + +type AgentPermissionsRule struct { + ApiGroups []string `json:"apiGroups,omitempty"` + Resources []string `json:"resources,omitempty"` + Verbs []string `json:"verbs,omitempty"` +} + +type CrossplaneExtensionResource struct { + Group string `json:"group,omitempty"` +} + +type CrossplaneExtension struct { + Resources []*CrossplaneExtensionResource `json:"resources,omitempty"` } type InstanceSpec struct { IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` Subdomain string `json:"subdomain,omitempty"` - DeclarativeManagementEnabled bool `json:"declarativeManagementEnabled,omitempty"` + DeclarativeManagementEnabled *bool `json:"declarativeManagementEnabled,omitempty"` Extensions []*ArgoCDExtensionInstallEntry `json:"extensions,omitempty"` ClusterCustomizationDefaults *ClusterCustomization `json:"clusterCustomizationDefaults,omitempty"` - ImageUpdaterEnabled bool `json:"imageUpdaterEnabled,omitempty"` - BackendIpAllowListEnabled bool `json:"backendIpAllowListEnabled,omitempty"` + ImageUpdaterEnabled *bool `json:"imageUpdaterEnabled,omitempty"` + BackendIpAllowListEnabled *bool `json:"backendIpAllowListEnabled,omitempty"` RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` - AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` - SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` + AuditExtensionEnabled *bool `json:"auditExtensionEnabled,omitempty"` + SyncHistoryExtensionEnabled *bool `json:"syncHistoryExtensionEnabled,omitempty"` + CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` - AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` + AssistantExtensionEnabled *bool `json:"assistantExtensionEnabled,omitempty"` AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` HostAliases []*HostAliases `json:"hostAliases,omitempty"` + AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` } type ManagedCluster struct { @@ -81,12 +81,12 @@ type ManagedCluster struct { } type RepoServerDelegate struct { - ControlPlane bool `json:"controlPlane,omitempty"` + ControlPlane *bool `json:"controlPlane,omitempty"` ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"` } type ImageUpdaterDelegate struct { - ControlPlane bool `json:"controlPlane,omitempty"` + ControlPlane *bool `json:"controlPlane,omitempty"` ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"` } diff --git a/internal/types/generated/akuity/v1alpha1/cluster_types.go b/internal/types/generated/akuity/v1alpha1/cluster_types.go index 84a1b42..4002afc 100644 --- a/internal/types/generated/akuity/v1alpha1/cluster_types.go +++ b/internal/types/generated/akuity/v1alpha1/cluster_types.go @@ -10,10 +10,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Cluster is the Schema for the cluster API type Cluster struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -23,30 +19,25 @@ type Cluster struct { type ClusterSize string -//+kubebuilder:object:root=true - -// ClusterList contains a list of Cluster -type ClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Cluster `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Cluster{}, &ClusterList{}) -} - type ClusterSpec struct { Description string `json:"description,omitempty"` NamespaceScoped bool `json:"namespaceScoped,omitempty"` Data ClusterData `json:"data,omitempty"` } +type ManagedClusterConfig struct { + SecretName string `json:"secretName,omitempty"` + SecretKey string `json:"secretKey,omitempty"` +} + type ClusterData struct { - Size ClusterSize `json:"size,omitempty"` - AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization runtime.RawExtension `json:"kustomization,omitempty"` - AppReplication *bool `json:"appReplication,omitempty"` - TargetVersion string `json:"targetVersion,omitempty"` - RedisTunneling *bool `json:"redisTunneling,omitempty"` + Size ClusterSize `json:"size,omitempty"` + AutoUpgradeDisabled *bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization runtime.RawExtension `json:"kustomization,omitempty"` + AppReplication *bool `json:"appReplication,omitempty"` + TargetVersion string `json:"targetVersion,omitempty"` + RedisTunneling *bool `json:"redisTunneling,omitempty"` + DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` + EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` + ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` } diff --git a/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go index 1caf47d..88d1154 100644 --- a/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/akuity/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. @@ -9,6 +8,36 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentPermissionsRule) DeepCopyInto(out *AgentPermissionsRule) { + *out = *in + if in.ApiGroups != nil { + in, out := &in.ApiGroups, &out.ApiGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Verbs != nil { + in, out := &in.Verbs, &out.Verbs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentPermissionsRule. +func (in *AgentPermissionsRule) DeepCopy() *AgentPermissionsRule { + if in == nil { + return nil + } + out := new(AgentPermissionsRule) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AppSetDelegate) DeepCopyInto(out *AppSetDelegate) { *out = *in @@ -85,38 +114,6 @@ func (in *ArgoCDExtensionInstallEntry) DeepCopy() *ArgoCDExtensionInstallEntry { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ArgoCDList) DeepCopyInto(out *ArgoCDList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ArgoCD, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArgoCDList. -func (in *ArgoCDList) DeepCopy() *ArgoCDList { - if in == nil { - return nil - } - out := new(ArgoCDList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ArgoCDList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ArgoCDSpec) DeepCopyInto(out *ArgoCDSpec) { *out = *in @@ -194,6 +191,21 @@ func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = new(bool) **out = **in } + if in.DatadogAnnotationsEnabled != nil { + in, out := &in.DatadogAnnotationsEnabled, &out.DatadogAnnotationsEnabled + *out = new(bool) + **out = **in + } + if in.EksAddonEnabled != nil { + in, out := &in.EksAddonEnabled, &out.EksAddonEnabled + *out = new(bool) + **out = **in + } + if in.ManagedClusterConfig != nil { + in, out := &in.ManagedClusterConfig, &out.ManagedClusterConfig + *out = new(ManagedClusterConfig) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterData. @@ -207,49 +219,58 @@ func (in *ClusterData) DeepCopy() *ClusterData { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { +func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } + in.Data.DeepCopyInto(&out.Data) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. +func (in *ClusterSpec) DeepCopy() *ClusterSpec { if in == nil { return nil } - out := new(ClusterList) + out := new(ClusterSpec) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CrossplaneExtension) DeepCopyInto(out *CrossplaneExtension) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]*CrossplaneExtensionResource, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(CrossplaneExtensionResource) + **out = **in + } + } } - return nil +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossplaneExtension. +func (in *CrossplaneExtension) DeepCopy() *CrossplaneExtension { + if in == nil { + return nil + } + out := new(CrossplaneExtension) + in.DeepCopyInto(out) + return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { +func (in *CrossplaneExtensionResource) DeepCopyInto(out *CrossplaneExtensionResource) { *out = *in - in.Data.DeepCopyInto(&out.Data) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. -func (in *ClusterSpec) DeepCopy() *ClusterSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossplaneExtensionResource. +func (in *CrossplaneExtensionResource) DeepCopy() *CrossplaneExtensionResource { if in == nil { return nil } - out := new(ClusterSpec) + out := new(CrossplaneExtensionResource) in.DeepCopyInto(out) return out } @@ -344,6 +365,11 @@ func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { *out = new(RepoServerDelegate) (*in).DeepCopyInto(*out) } + if in.CrossplaneExtension != nil { + in, out := &in.CrossplaneExtension, &out.CrossplaneExtension + *out = new(CrossplaneExtension) + (*in).DeepCopyInto(*out) + } if in.ImageUpdaterDelegate != nil { in, out := &in.ImageUpdaterDelegate, &out.ImageUpdaterDelegate *out = new(ImageUpdaterDelegate) @@ -370,6 +396,17 @@ func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { } } } + if in.AgentPermissionsRules != nil { + in, out := &in.AgentPermissionsRules, &out.AgentPermissionsRules + *out = make([]*AgentPermissionsRule, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(AgentPermissionsRule) + (*in).DeepCopyInto(*out) + } + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec. @@ -397,6 +434,21 @@ func (in *ManagedCluster) DeepCopy() *ManagedCluster { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedClusterConfig) DeepCopyInto(out *ManagedClusterConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterConfig. +func (in *ManagedClusterConfig) DeepCopy() *ManagedClusterConfig { + if in == nil { + return nil + } + out := new(ManagedClusterConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RepoServerDelegate) DeepCopyInto(out *RepoServerDelegate) { *out = *in diff --git a/internal/types/generated/argocd/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/argocd/v1alpha1/zz_generated.deepcopy.go index 632857a..d53dc96 100644 --- a/internal/types/generated/argocd/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/argocd/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. diff --git a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go index 64c5f08..6eb74c4 100644 --- a/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go +++ b/internal/types/generated/crossplane/v1alpha1/argocdinstance_types.go @@ -25,10 +25,10 @@ type ArgoCDExtensionInstallEntry struct { // +kubebuilder:object:generate=true type ClusterCustomization struct { - AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization string `json:"kustomization,omitempty"` - AppReplication bool `json:"appReplication,omitempty"` - RedisTunneling bool `json:"redisTunneling,omitempty"` + AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization string `json:"kustomization,omitempty"` + AppReplication bool `json:"appReplication,omitempty"` + RedisTunneling bool `json:"redisTunneling,omitempty"` } // +kubebuilder:object:generate=true @@ -37,6 +37,23 @@ type AppsetPolicy struct { OverridePolicy bool `json:"overridePolicy,omitempty"` } +// +kubebuilder:object:generate=true +type AgentPermissionsRule struct { + ApiGroups []string `json:"apiGroups,omitempty"` + Resources []string `json:"resources,omitempty"` + Verbs []string `json:"verbs,omitempty"` +} + +// +kubebuilder:object:generate=true +type CrossplaneExtensionResource struct { + Group string `json:"group,omitempty"` +} + +// +kubebuilder:object:generate=true +type CrossplaneExtension struct { + Resources []*CrossplaneExtensionResource `json:"resources,omitempty"` +} + // +kubebuilder:object:generate=true type InstanceSpec struct { IpAllowList []*IPAllowListEntry `json:"ipAllowList,omitempty"` @@ -49,11 +66,14 @@ type InstanceSpec struct { RepoServerDelegate *RepoServerDelegate `json:"repoServerDelegate,omitempty"` AuditExtensionEnabled bool `json:"auditExtensionEnabled,omitempty"` SyncHistoryExtensionEnabled bool `json:"syncHistoryExtensionEnabled,omitempty"` + CrossplaneExtension *CrossplaneExtension `json:"crossplaneExtension,omitempty"` ImageUpdaterDelegate *ImageUpdaterDelegate `json:"imageUpdaterDelegate,omitempty"` AppSetDelegate *AppSetDelegate `json:"appSetDelegate,omitempty"` AssistantExtensionEnabled bool `json:"assistantExtensionEnabled,omitempty"` AppsetPolicy *AppsetPolicy `json:"appsetPolicy,omitempty"` HostAliases []*HostAliases `json:"hostAliases,omitempty"` + AgentPermissionsRules []*AgentPermissionsRule `json:"agentPermissionsRules,omitempty"` + Fqdn string `json:"fqdn,omitempty"` } // +kubebuilder:object:generate=true diff --git a/internal/types/generated/crossplane/v1alpha1/cluster_types.go b/internal/types/generated/crossplane/v1alpha1/cluster_types.go index 3b83782..8a1de52 100644 --- a/internal/types/generated/crossplane/v1alpha1/cluster_types.go +++ b/internal/types/generated/crossplane/v1alpha1/cluster_types.go @@ -19,12 +19,21 @@ type ClusterSpec struct { Data ClusterData `json:"data,omitempty"` } +// +kubebuilder:object:generate=true +type ManagedClusterConfig struct { + SecretName string `json:"secretName,omitempty"` + SecretKey string `json:"secretKey,omitempty"` +} + // +kubebuilder:object:generate=true type ClusterData struct { - Size ClusterSize `json:"size,omitempty"` - AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` - Kustomization string `json:"kustomization,omitempty"` - AppReplication bool `json:"appReplication,omitempty"` - TargetVersion string `json:"targetVersion,omitempty"` - RedisTunneling bool `json:"redisTunneling,omitempty"` + Size ClusterSize `json:"size,omitempty"` + AutoUpgradeDisabled bool `json:"autoUpgradeDisabled,omitempty"` + Kustomization string `json:"kustomization,omitempty"` + AppReplication bool `json:"appReplication,omitempty"` + TargetVersion string `json:"targetVersion,omitempty"` + RedisTunneling bool `json:"redisTunneling,omitempty"` + DatadogAnnotationsEnabled *bool `json:"datadogAnnotationsEnabled,omitempty"` + EksAddonEnabled *bool `json:"eksAddonEnabled,omitempty"` + ManagedClusterConfig *ManagedClusterConfig `json:"managedClusterConfig,omitempty"` } diff --git a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go index 55e0da1..c3655d1 100644 --- a/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go +++ b/internal/types/generated/crossplane/v1alpha1/zz_generated.deepcopy.go @@ -1,10 +1,41 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Code generated by controller-gen. DO NOT EDIT. package v1alpha1 +import () + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AgentPermissionsRule) DeepCopyInto(out *AgentPermissionsRule) { + *out = *in + if in.ApiGroups != nil { + in, out := &in.ApiGroups, &out.ApiGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Verbs != nil { + in, out := &in.Verbs, &out.Verbs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AgentPermissionsRule. +func (in *AgentPermissionsRule) DeepCopy() *AgentPermissionsRule { + if in == nil { + return nil + } + out := new(AgentPermissionsRule) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AppSetDelegate) DeepCopyInto(out *AppSetDelegate) { *out = *in @@ -87,6 +118,22 @@ func (in *ArgoCDSpec) DeepCopy() *ArgoCDSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cluster) DeepCopyInto(out *Cluster) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. +func (in *Cluster) DeepCopy() *Cluster { + if in == nil { + return nil + } + out := new(Cluster) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterCustomization) DeepCopyInto(out *ClusterCustomization) { *out = *in @@ -105,6 +152,21 @@ func (in *ClusterCustomization) DeepCopy() *ClusterCustomization { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterData) DeepCopyInto(out *ClusterData) { *out = *in + if in.DatadogAnnotationsEnabled != nil { + in, out := &in.DatadogAnnotationsEnabled, &out.DatadogAnnotationsEnabled + *out = new(bool) + **out = **in + } + if in.EksAddonEnabled != nil { + in, out := &in.EksAddonEnabled, &out.EksAddonEnabled + *out = new(bool) + **out = **in + } + if in.ManagedClusterConfig != nil { + in, out := &in.ManagedClusterConfig, &out.ManagedClusterConfig + *out = new(ManagedClusterConfig) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterData. @@ -133,6 +195,158 @@ func (in *ClusterSpec) DeepCopy() *ClusterSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Command) DeepCopyInto(out *Command) { + *out = *in + if in.Command != nil { + in, out := &in.Command, &out.Command + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Command. +func (in *Command) DeepCopy() *Command { + if in == nil { + return nil + } + out := new(Command) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigManagementPlugin) DeepCopyInto(out *ConfigManagementPlugin) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigManagementPlugin. +func (in *ConfigManagementPlugin) DeepCopy() *ConfigManagementPlugin { + if in == nil { + return nil + } + out := new(ConfigManagementPlugin) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CrossplaneExtension) DeepCopyInto(out *CrossplaneExtension) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]*CrossplaneExtensionResource, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(CrossplaneExtensionResource) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossplaneExtension. +func (in *CrossplaneExtension) DeepCopy() *CrossplaneExtension { + if in == nil { + return nil + } + out := new(CrossplaneExtension) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CrossplaneExtensionResource) DeepCopyInto(out *CrossplaneExtensionResource) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossplaneExtensionResource. +func (in *CrossplaneExtensionResource) DeepCopy() *CrossplaneExtensionResource { + if in == nil { + return nil + } + out := new(CrossplaneExtensionResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Discover) DeepCopyInto(out *Discover) { + *out = *in + if in.Find != nil { + in, out := &in.Find, &out.Find + *out = new(Find) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Discover. +func (in *Discover) DeepCopy() *Discover { + if in == nil { + return nil + } + out := new(Discover) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Dynamic) DeepCopyInto(out *Dynamic) { + *out = *in + if in.Command != nil { + in, out := &in.Command, &out.Command + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dynamic. +func (in *Dynamic) DeepCopy() *Dynamic { + if in == nil { + return nil + } + out := new(Dynamic) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Find) DeepCopyInto(out *Find) { + *out = *in + if in.Command != nil { + in, out := &in.Command, &out.Command + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Find. +func (in *Find) DeepCopy() *Find { + if in == nil { + return nil + } + out := new(Find) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HostAliases) DeepCopyInto(out *HostAliases) { *out = *in @@ -216,13 +430,18 @@ func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { if in.ClusterCustomizationDefaults != nil { in, out := &in.ClusterCustomizationDefaults, &out.ClusterCustomizationDefaults *out = new(ClusterCustomization) - (*in).DeepCopyInto(*out) + **out = **in } if in.RepoServerDelegate != nil { in, out := &in.RepoServerDelegate, &out.RepoServerDelegate *out = new(RepoServerDelegate) (*in).DeepCopyInto(*out) } + if in.CrossplaneExtension != nil { + in, out := &in.CrossplaneExtension, &out.CrossplaneExtension + *out = new(CrossplaneExtension) + (*in).DeepCopyInto(*out) + } if in.ImageUpdaterDelegate != nil { in, out := &in.ImageUpdaterDelegate, &out.ImageUpdaterDelegate *out = new(ImageUpdaterDelegate) @@ -249,6 +468,17 @@ func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { } } } + if in.AgentPermissionsRules != nil { + in, out := &in.AgentPermissionsRules, &out.AgentPermissionsRules + *out = make([]*AgentPermissionsRule, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(AgentPermissionsRule) + (*in).DeepCopyInto(*out) + } + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec. @@ -277,132 +507,16 @@ func (in *ManagedCluster) DeepCopy() *ManagedCluster { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RepoServerDelegate) DeepCopyInto(out *RepoServerDelegate) { +func (in *ManagedClusterConfig) DeepCopyInto(out *ManagedClusterConfig) { *out = *in - if in.ManagedCluster != nil { - in, out := &in.ManagedCluster, &out.ManagedCluster - *out = new(ManagedCluster) - **out = **in - } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepoServerDelegate. -func (in *RepoServerDelegate) DeepCopy() *RepoServerDelegate { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedClusterConfig. +func (in *ManagedClusterConfig) DeepCopy() *ManagedClusterConfig { if in == nil { return nil } - out := new(RepoServerDelegate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Command) DeepCopyInto(out *Command) { - *out = *in - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Command. -func (in *Command) DeepCopy() *Command { - if in == nil { - return nil - } - out := new(Command) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigManagementPlugin) DeepCopyInto(out *ConfigManagementPlugin) { - *out = *in - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigManagementPlugin. -func (in *ConfigManagementPlugin) DeepCopy() *ConfigManagementPlugin { - if in == nil { - return nil - } - out := new(ConfigManagementPlugin) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Discover) DeepCopyInto(out *Discover) { - *out = *in - if in.Find != nil { - in, out := &in.Find, &out.Find - *out = new(Find) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Discover. -func (in *Discover) DeepCopy() *Discover { - if in == nil { - return nil - } - out := new(Discover) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Dynamic) DeepCopyInto(out *Dynamic) { - *out = *in - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Dynamic. -func (in *Dynamic) DeepCopy() *Dynamic { - if in == nil { - return nil - } - out := new(Dynamic) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Find) DeepCopyInto(out *Find) { - *out = *in - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Find. -func (in *Find) DeepCopy() *Find { - if in == nil { - return nil - } - out := new(Find) + out := new(ManagedClusterConfig) in.DeepCopyInto(out) return out } @@ -499,3 +613,23 @@ func (in *PluginSpec) DeepCopy() *PluginSpec { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RepoServerDelegate) DeepCopyInto(out *RepoServerDelegate) { + *out = *in + if in.ManagedCluster != nil { + in, out := &in.ManagedCluster, &out.ManagedCluster + *out = new(ManagedCluster) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepoServerDelegate. +func (in *RepoServerDelegate) DeepCopy() *RepoServerDelegate { + if in == nil { + return nil + } + out := new(RepoServerDelegate) + in.DeepCopyInto(out) + return out +} diff --git a/internal/types/instance.go b/internal/types/instance.go index 9618c7c..1f026cc 100644 --- a/internal/types/instance.go +++ b/internal/types/instance.go @@ -9,6 +9,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/utils/ptr" "sigs.k8s.io/yaml" "github.com/akuityio/provider-crossplane-akuity/apis/core/v1alpha1" @@ -325,11 +326,14 @@ func AkuityAPIToCrossplaneInstanceSpec(instanceSpec *argocdv1.InstanceSpec) (cro RepoServerDelegate: AkuityAPIToCrossplaneRepoServerDelegate(instanceSpec.GetRepoServerDelegate()), AuditExtensionEnabled: instanceSpec.GetAuditExtensionEnabled(), SyncHistoryExtensionEnabled: instanceSpec.GetSyncHistoryExtensionEnabled(), + CrossplaneExtension: AkuityAPIToCrossplaneCrossplaneExtension(instanceSpec.GetCrossplaneExtension()), ImageUpdaterDelegate: AkuityAPIToCrossplaneImageUpdaterDelegate(instanceSpec.GetImageUpdaterDelegate()), AppSetDelegate: AkuityAPIToCrossplaneAppSetDelegate(instanceSpec.GetAppSetDelegate()), AssistantExtensionEnabled: instanceSpec.GetAssistantExtensionEnabled(), AppsetPolicy: AkuityAPIToCrossplaneAppsetPolicy(instanceSpec.GetAppsetPolicy()), HostAliases: AkuityAPIToCrossplaneHostAliases(instanceSpec.GetHostAliases()), + AgentPermissionsRules: AkuityAPIToCrossplaneAgentPermissionsRules(instanceSpec.GetAgentPermissionsRules()), + Fqdn: instanceSpec.GetFqdn(), }, nil } @@ -416,6 +420,21 @@ func AkuityAPIToCrossplaneRepoServerDelegate(repoServerDelegate *argocdv1.RepoSe } } +func AkuityAPIToCrossplaneCrossplaneExtension(crossplaneExtension *argocdv1.CrossplaneExtension) *crossplanetypes.CrossplaneExtension { + if crossplaneExtension == nil { + return nil + } + + resources := make([]*crossplanetypes.CrossplaneExtensionResource, 0, len(crossplaneExtension.GetResources())) + for _, r := range crossplaneExtension.GetResources() { + resource := &crossplanetypes.CrossplaneExtensionResource{ + Group: r.GetGroup(), + } + resources = append(resources, resource) + } + return &crossplanetypes.CrossplaneExtension{Resources: resources} +} + func AkuityAPIToCrossplaneImageUpdaterDelegate(imageUpdaterDelegate *argocdv1.ImageUpdaterDelegate) *crossplanetypes.ImageUpdaterDelegate { if imageUpdaterDelegate == nil { return nil @@ -469,6 +488,28 @@ func AkuityAPIToCrossplaneHostAliases(hostAliasesList []*argocdv1.HostAliases) [ return crossplaneHostAliasesList } +func AkuityAPIToCrossplaneAgentPermissionsRules(agentPermissionsRules []*argocdv1.AgentPermissionsRule) []*crossplanetypes.AgentPermissionsRule { + if len(agentPermissionsRules) == 0 { + return nil + } + + crossplaneAgentPermissionsRules := make([]*crossplanetypes.AgentPermissionsRule, 0, len(agentPermissionsRules)) + for _, rule := range agentPermissionsRules { + var apiGroups []string + apiGroups = append(apiGroups, rule.GetApiGroups()...) + var resources []string + resources = append(resources, rule.GetResources()...) + var verbs []string + verbs = append(verbs, rule.GetVerbs()...) + crossplaneAgentPermissionsRules = append(crossplaneAgentPermissionsRules, &crossplanetypes.AgentPermissionsRule{ + ApiGroups: apiGroups, + Resources: resources, + Verbs: verbs, + }) + } + return crossplaneAgentPermissionsRules +} + func CrossplaneToAkuityAPIArgoCD(name string, instance *crossplanetypes.ArgoCD) (*structpb.Struct, error) { instanceSpec, err := CrossplaneToAkuityAPIInstanceSpec(instance.Spec.InstanceSpec) if err != nil { @@ -507,19 +548,22 @@ func CrossplaneToAkuityAPIInstanceSpec(instanceSpec crossplanetypes.InstanceSpec return akuitytypes.InstanceSpec{ IpAllowList: CrossplaneToAkuityAPIIPAllowListEntry(instanceSpec.IpAllowList), Subdomain: instanceSpec.Subdomain, - DeclarativeManagementEnabled: instanceSpec.DeclarativeManagementEnabled, + DeclarativeManagementEnabled: ptr.To(instanceSpec.DeclarativeManagementEnabled), Extensions: CrossplaneToAkuityAPIArgoCDExtensionInstallEntry(instanceSpec.Extensions), ClusterCustomizationDefaults: clusterCustomization, - ImageUpdaterEnabled: instanceSpec.ImageUpdaterEnabled, - BackendIpAllowListEnabled: instanceSpec.BackendIpAllowListEnabled, + ImageUpdaterEnabled: ptr.To(instanceSpec.ImageUpdaterEnabled), + BackendIpAllowListEnabled: ptr.To(instanceSpec.BackendIpAllowListEnabled), RepoServerDelegate: CrossplaneToAkuityAPIRepoServerDelegate(instanceSpec.RepoServerDelegate), - AuditExtensionEnabled: instanceSpec.AuditExtensionEnabled, - SyncHistoryExtensionEnabled: instanceSpec.SyncHistoryExtensionEnabled, + AuditExtensionEnabled: ptr.To(instanceSpec.AuditExtensionEnabled), + SyncHistoryExtensionEnabled: ptr.To(instanceSpec.SyncHistoryExtensionEnabled), + CrossplaneExtension: CrossplaneToAkuityAPICrossplaneExtension(instanceSpec.CrossplaneExtension), ImageUpdaterDelegate: CrossplaneToAkuityAPIImageUpdaterDelegate(instanceSpec.ImageUpdaterDelegate), AppSetDelegate: CrossplaneToAkuityAPIAppSetDelegate(instanceSpec.AppSetDelegate), - AssistantExtensionEnabled: instanceSpec.AssistantExtensionEnabled, + AssistantExtensionEnabled: ptr.To(instanceSpec.AssistantExtensionEnabled), AppsetPolicy: CrossplaneToAkuityAPIAppsetPolicy(instanceSpec.AppsetPolicy), HostAliases: CrossplaneToAkuityAPIHostAliases(instanceSpec.HostAliases), + AgentPermissionsRules: CrossplaneToAkuityAPIAgentPermissionsRules(instanceSpec.AgentPermissionsRules), + Fqdn: ptr.To(instanceSpec.Fqdn), }, nil } @@ -560,10 +604,10 @@ func CrossplaneToAkuityAPIClusterCustomization(clusterCustomization *crossplanet } return &akuitytypes.ClusterCustomization{ - AutoUpgradeDisabled: clusterCustomization.AutoUpgradeDisabled, + AutoUpgradeDisabled: ptr.To(clusterCustomization.AutoUpgradeDisabled), Kustomization: kustomization, - AppReplication: clusterCustomization.AppReplication, - RedisTunneling: clusterCustomization.RedisTunneling, + AppReplication: ptr.To(clusterCustomization.AppReplication), + RedisTunneling: ptr.To(clusterCustomization.RedisTunneling), }, nil } @@ -573,20 +617,35 @@ func CrossplaneToAkuityAPIRepoServerDelegate(repoServerDelegate *crossplanetypes } return &akuitytypes.RepoServerDelegate{ - ControlPlane: repoServerDelegate.ControlPlane, + ControlPlane: ptr.To(repoServerDelegate.ControlPlane), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: repoServerDelegate.ManagedCluster.ClusterName, }, } } +func CrossplaneToAkuityAPICrossplaneExtension(extension *crossplanetypes.CrossplaneExtension) *akuitytypes.CrossplaneExtension { + if extension == nil { + return nil + } + + resources := make([]*akuitytypes.CrossplaneExtensionResource, 0, len(extension.Resources)) + for _, resource := range extension.Resources { + resources = append(resources, &akuitytypes.CrossplaneExtensionResource{ + Group: resource.Group, + }) + } + return &akuitytypes.CrossplaneExtension{Resources: resources} + +} + func CrossplaneToAkuityAPIImageUpdaterDelegate(imageUpdaterDelegate *crossplanetypes.ImageUpdaterDelegate) *akuitytypes.ImageUpdaterDelegate { if imageUpdaterDelegate == nil { return nil } return &akuitytypes.ImageUpdaterDelegate{ - ControlPlane: imageUpdaterDelegate.ControlPlane, + ControlPlane: ptr.To(imageUpdaterDelegate.ControlPlane), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: imageUpdaterDelegate.ManagedCluster.ClusterName, }, @@ -612,7 +671,7 @@ func CrossplaneToAkuityAPIAppsetPolicy(appsetPolicy *crossplanetypes.AppsetPolic return &akuitytypes.AppsetPolicy{ Policy: appsetPolicy.Policy, - OverridePolicy: appsetPolicy.OverridePolicy, + OverridePolicy: ptr.To(appsetPolicy.OverridePolicy), } } @@ -629,6 +688,23 @@ func CrossplaneToAkuityAPIHostAliases(hostAliasesList []*crossplanetypes.HostAli return AkuityHostAliasesList } +func CrossplaneToAkuityAPIAgentPermissionsRules(agentPermissionsRules []*crossplanetypes.AgentPermissionsRule) []*akuitytypes.AgentPermissionsRule { + if len(agentPermissionsRules) == 0 { + return nil + } + + akuityAgentPermissionsRules := make([]*akuitytypes.AgentPermissionsRule, 0, len(agentPermissionsRules)) + for _, a := range agentPermissionsRules { + copied := a.DeepCopy() + akuityAgentPermissionsRules = append(akuityAgentPermissionsRules, &akuitytypes.AgentPermissionsRule{ + ApiGroups: copied.ApiGroups, + Resources: copied.Resources, + Verbs: copied.Verbs, + }) + } + return akuityAgentPermissionsRules +} + func CrossplaneToAkuityAPIConfigMap(name string, configMapData map[string]string) (*structpb.Struct, error) { if len(configMapData) == 0 { return nil, nil diff --git a/internal/types/test/fixtures/cluster.go b/internal/types/test/fixtures/cluster.go index 669f4a8..6f7abc2 100644 --- a/internal/types/test/fixtures/cluster.go +++ b/internal/types/test/fixtures/cluster.go @@ -87,6 +87,8 @@ patches: Name: ClusterName, Namespace: "test-namespace", Data: &argocdv1.ClusterData{ + Namespace: "test-namespace", + NamespaceScoped: true, Labels: Labels, Annotations: Annotations, Size: argocdv1.ClusterSize_CLUSTER_SIZE_MEDIUM, diff --git a/internal/types/test/fixtures/instance.go b/internal/types/test/fixtures/instance.go index 0361b35..6e43ac9 100644 --- a/internal/types/test/fixtures/instance.go +++ b/internal/types/test/fixtures/instance.go @@ -2,6 +2,7 @@ package fixtures import ( argocdv1 "github.com/akuity/api-client-go/pkg/api/gen/argocd/v1" + "k8s.io/utils/ptr" "github.com/akuityio/provider-crossplane-akuity/apis/core/v1alpha1" akuitytypes "github.com/akuityio/provider-crossplane-akuity/internal/types/generated/akuity/v1alpha1" @@ -47,7 +48,7 @@ var ( AkuityAppsetPolicy = &akuitytypes.AppsetPolicy{ Policy: "policy", - OverridePolicy: true, + OverridePolicy: ptr.To(true), } ArgocdAppsetPolicy = &argocdv1.AppsetPolicy{ @@ -79,7 +80,7 @@ var ( } AkuityImageUpdaterDelegate = &akuitytypes.ImageUpdaterDelegate{ - ControlPlane: true, + ControlPlane: ptr.To(true), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: "test-cluster", }, @@ -100,7 +101,7 @@ var ( } AkuityRepoServerDelegate = &akuitytypes.RepoServerDelegate{ - ControlPlane: true, + ControlPlane: ptr.To(true), ManagedCluster: &akuitytypes.ManagedCluster{ ClusterName: "test-cluster", }, @@ -187,10 +188,10 @@ var ( } AkuityClusterCustomization = &akuitytypes.ClusterCustomization{ - AutoUpgradeDisabled: true, + AutoUpgradeDisabled: ptr.To(true), Kustomization: Kustomization, - AppReplication: true, - RedisTunneling: true, + AppReplication: ptr.To(true), + RedisTunneling: ptr.To(true), } ArgocdClusterCustomization = &argocdv1.ClusterCustomization{ @@ -210,19 +211,20 @@ var ( AkuityInstanceSpec = akuitytypes.InstanceSpec{ IpAllowList: AkuityIpAllowList, Subdomain: "example.com", - DeclarativeManagementEnabled: true, + DeclarativeManagementEnabled: ptr.To(true), Extensions: AkuityInstallEntryList, ClusterCustomizationDefaults: AkuityClusterCustomization, - ImageUpdaterEnabled: true, - BackendIpAllowListEnabled: true, + ImageUpdaterEnabled: ptr.To(true), + BackendIpAllowListEnabled: ptr.To(true), RepoServerDelegate: AkuityRepoServerDelegate, - AuditExtensionEnabled: true, - SyncHistoryExtensionEnabled: true, + AuditExtensionEnabled: ptr.To(true), + SyncHistoryExtensionEnabled: ptr.To(true), ImageUpdaterDelegate: AkuityImageUpdaterDelegate, AppSetDelegate: AkuityAppSetDelegate, - AssistantExtensionEnabled: true, + AssistantExtensionEnabled: ptr.To(true), AppsetPolicy: AkuityAppsetPolicy, HostAliases: AkuityHostAliasesList, + Fqdn: ptr.To(""), } ArgocdInstanceSpec = &argocdv1.InstanceSpec{ diff --git a/package/crds/core.akuity.crossplane.io_clusters.yaml b/package/crds/core.akuity.crossplane.io_clusters.yaml index 0aabf29..ed4c7e6 100644 --- a/package/crds/core.akuity.crossplane.io_clusters.yaml +++ b/package/crds/core.akuity.crossplane.io_clusters.yaml @@ -88,8 +88,19 @@ spec: type: boolean autoUpgradeDisabled: type: boolean + datadogAnnotationsEnabled: + type: boolean + eksAddonEnabled: + type: boolean kustomization: type: string + managedClusterConfig: + properties: + secretKey: + type: string + secretName: + type: string + type: object redisTunneling: type: boolean size: diff --git a/package/crds/core.akuity.crossplane.io_instances.yaml b/package/crds/core.akuity.crossplane.io_instances.yaml index c786f89..4b0bd96 100644 --- a/package/crds/core.akuity.crossplane.io_instances.yaml +++ b/package/crds/core.akuity.crossplane.io_instances.yaml @@ -82,6 +82,23 @@ spec: type: string instanceSpec: properties: + agentPermissionsRules: + items: + properties: + apiGroups: + items: + type: string + type: array + resources: + items: + type: string + type: array + verbs: + items: + type: string + type: array + type: object + type: array appSetDelegate: properties: managedCluster: @@ -114,6 +131,16 @@ spec: redisTunneling: type: boolean type: object + crossplaneExtension: + properties: + resources: + items: + properties: + group: + type: string + type: object + type: array + type: object declarativeManagementEnabled: type: boolean extensions: @@ -125,6 +152,8 @@ spec: type: string type: object type: array + fqdn: + type: string hostAliases: items: properties: @@ -515,6 +544,23 @@ spec: type: string instanceSpec: properties: + agentPermissionsRules: + items: + properties: + apiGroups: + items: + type: string + type: array + resources: + items: + type: string + type: array + verbs: + items: + type: string + type: array + type: object + type: array appSetDelegate: properties: managedCluster: @@ -547,6 +593,16 @@ spec: redisTunneling: type: boolean type: object + crossplaneExtension: + properties: + resources: + items: + properties: + group: + type: string + type: object + type: array + type: object declarativeManagementEnabled: type: boolean extensions: @@ -558,6 +614,8 @@ spec: type: string type: object type: array + fqdn: + type: string hostAliases: items: properties: