diff --git a/.golangci.yaml b/.golangci.yaml index ca43f970c..e8f5932a0 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -145,7 +145,7 @@ linters: - k8s.io/component-base - k8s.io/kubectl - sigs.k8s.io/controller-runtime - + replace-local: true toolchain-forbidden: true go-version-pattern: 1\.\d+(\.0)?$ gosec: diff --git a/Makefile b/Makefile index 042a96d91..4df5d77d2 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,8 @@ generate-documentation: check-gen-crd-api-reference-docs .PHONY: test test: manifests generate envtest flux-crds ## Run tests. KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out -v + cd api; go test ./... + .PHONY: flux-crds flux-crds: kustomize @@ -118,10 +120,12 @@ flux-crds: kustomize fmt: goimports GOBIN=$(LOCALBIN) go fmt ./... $(GOIMPORTS) -w -local github.com/cloudoperators/greenhouse . + cd api; GOBIN=$(LOCALBIN) go fmt ./... .PHONY: lint lint: golint - $(GOLINT) run -v --timeout 5m + $(GOLINT) run -v --timeout 5m + cd api; $(GOLINT) run -v --timeout 5m .PHONY: check check: fmt lint test diff --git a/api/go.mod b/api/go.mod new file mode 100644 index 000000000..72427b6b0 --- /dev/null +++ b/api/go.mod @@ -0,0 +1,45 @@ +module github.com/cloudoperators/greenhouse/api + +go 1.26.0 + +require ( + github.com/onsi/ginkgo/v2 v2.28.1 + github.com/onsi/gomega v1.39.1 + k8s.io/api v0.36.0 + k8s.io/apiextensions-apiserver v0.36.0 + k8s.io/apimachinery v0.36.0 + k8s.io/client-go v0.36.0 + sigs.k8s.io/controller-runtime v0.23.1 +) + +require ( + github.com/Masterminds/semver/v3 v3.4.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.21.1 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.1 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect + github.com/google/go-cmp v0.7.0 // indirect + github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/mod v0.35.0 // indirect + golang.org/x/net v0.53.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.43.0 // indirect + golang.org/x/text v0.36.0 // indirect + golang.org/x/tools v0.44.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + k8s.io/klog/v2 v2.140.0 // indirect + k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a // indirect + k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 // indirect + sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect +) diff --git a/api/go.sum b/api/go.sum new file mode 100644 index 000000000..f274ef689 --- /dev/null +++ b/api/go.sum @@ -0,0 +1,135 @@ +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= +github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs= +github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo= +github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M= +github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk= +github.com/gkampitakis/go-snaps v0.5.15 h1:amyJrvM1D33cPHwVrjo9jQxX8g/7E2wYdZ+01KS3zGE= +github.com/gkampitakis/go-snaps v0.5.15/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic= +github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.23.1 h1:lpsStH0n2ittzTnbaSloVZLuB5+fvSY/+hnagBjSNZU= +github.com/go-openapi/swag v0.23.1/go.mod h1:STZs8TbRvEQQKUA+JZNAm3EWlgaOBGpyFDqQnDHMef0= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw= +github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= +github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo= +github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= +github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE= +github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= +github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= +github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= +github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg= +github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE= +github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= +github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= +github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= +github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= +github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= +github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= +go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af h1:+5/Sw3GsDNlEmu7TfklWKPdQ0Ykja5VEmq2i817+jbI= +google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +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.36.0 h1:SgqDhZzHdOtMk40xVSvCXkP9ME0H05hPM3p9AB1kL80= +k8s.io/api v0.36.0/go.mod h1:m1LVrGPNYax5NBHdO+QuAedXyuzTt4RryI/qnmNvs34= +k8s.io/apiextensions-apiserver v0.36.0 h1:Wt7E8J+VBCbj4FjiBfDTK/neXDDjyJVJc7xfuOHImZ0= +k8s.io/apiextensions-apiserver v0.36.0/go.mod h1:kGDjH0msuiIB3tgsYRV0kS9GqpMYMUsQ3GHv7TApyug= +k8s.io/apimachinery v0.36.0 h1:jZyPzhd5Z+3h9vJLt0z9XdzW9VzNzWAUw+P1xZ9PXtQ= +k8s.io/apimachinery v0.36.0/go.mod h1:FklypaRJt6n5wUIwWXIP6GJlIpUizTgfo1T/As+Tyxc= +k8s.io/client-go v0.36.0 h1:pOYi7C4RHChYjMiHpZSpSbIM6ZxVbRXBy7CuiIwqA3c= +k8s.io/client-go v0.36.0/go.mod h1:ZKKcpwF0aLYfkHFCjillCKaTK/yBkEDHTDXCFY6AS9Y= +k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= +k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= +k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a h1:xCeOEAOoGYl2jnJoHkC3hkbPJgdATINPMAxaynU2Ovg= +k8s.io/kube-openapi v0.0.0-20260317180543-43fb72c5454a/go.mod h1:uGBT7iTA6c6MvqUvSXIaYZo9ukscABYi2btjhvgKGZ0= +k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 h1:kBawHLSnx/mYHmRnNUf9d4CpjREbeZuxoSGOX/J+aYM= +k8s.io/utils v0.0.0-20260319190234-28399d86e0b5/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= +sigs.k8s.io/controller-runtime v0.23.1 h1:TjJSM80Nf43Mg21+RCy3J70aj/W6KyvDtOlpKf+PupE= +sigs.k8s.io/controller-runtime v0.23.1/go.mod h1:B6COOxKptp+YaUT5q4l6LqUJTRpizbgf9KSRNdQGns0= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= +sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80uLmm0wJkk8= +sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= +sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= +sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= diff --git a/api/meta/v1alpha1/suite_test.go b/api/meta/v1alpha1/suite_test.go index a85d8e28f..a56e63399 100644 --- a/api/meta/v1alpha1/suite_test.go +++ b/api/meta/v1alpha1/suite_test.go @@ -8,20 +8,9 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - - "github.com/cloudoperators/greenhouse/internal/test" ) func TestAPI(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "API types Suite") } - -var _ = BeforeSuite(func() { - test.TestBeforeSuite() -}) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - test.TestAfterSuite() -}) diff --git a/api/meta/v1alpha1/zz_generated.deepcopy.go b/api/meta/v1alpha1/zz_generated.deepcopy.go index 29f815cf4..956eaa207 100644 --- a/api/meta/v1alpha1/zz_generated.deepcopy.go +++ b/api/meta/v1alpha1/zz_generated.deepcopy.go @@ -7,6 +7,8 @@ package v1alpha1 +import () + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Condition) DeepCopyInto(out *Condition) { *out = *in diff --git a/api/v1alpha1/api_suite_test.go b/api/v1alpha1/api_suite_test.go index a85d8e28f..a56e63399 100644 --- a/api/v1alpha1/api_suite_test.go +++ b/api/v1alpha1/api_suite_test.go @@ -8,20 +8,9 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - - "github.com/cloudoperators/greenhouse/internal/test" ) func TestAPI(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "API types Suite") } - -var _ = BeforeSuite(func() { - test.TestBeforeSuite() -}) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - test.TestAfterSuite() -}) diff --git a/api/v1alpha1/catalog_types.go b/api/v1alpha1/catalog_types.go index ac049c4ed..2c9961ff8 100644 --- a/api/v1alpha1/catalog_types.go +++ b/api/v1alpha1/catalog_types.go @@ -7,7 +7,6 @@ import ( "slices" "time" - sourcev1 "github.com/fluxcd/source-controller/api/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -184,25 +183,6 @@ func (s *CatalogSource) GetRefValue() (gitRef string) { return } -func (s *CatalogSource) GetGitRepositoryReference() *sourcev1.GitRepositoryRef { - gitReference := &sourcev1.GitRepositoryRef{} - if s.Ref != nil { - // flux precedence 1 - if s.Ref.SHA != nil { - gitReference.Commit = *s.Ref.SHA - } - // flux precedence 2 - if s.Ref.Tag != nil { - gitReference.Tag = *s.Ref.Tag - } - // flux precedence 3 - if s.Ref.Branch != nil { - gitReference.Branch = *s.Ref.Branch - } - } - return gitReference -} - func (c *Catalog) SetInventory(hash, kind, name, msg string, ready metav1.ConditionStatus) { if c.Status.Inventory == nil { c.Status.Inventory = make(map[string][]SourceStatus) diff --git a/api/v1alpha1/organization_types.go b/api/v1alpha1/organization_types.go index 3b543c53b..fed1c3499 100644 --- a/api/v1alpha1/organization_types.go +++ b/api/v1alpha1/organization_types.go @@ -10,7 +10,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" greenhousemetav1alpha1 "github.com/cloudoperators/greenhouse/api/meta/v1alpha1" - "github.com/cloudoperators/greenhouse/internal/scim" ) const ( @@ -94,7 +93,7 @@ type SCIMConfig struct { // AuthType defined possible authentication type // +kubebuilder:validation:Enum=basic;token // +kubebuilder:default="basic" - AuthType scim.AuthType `json:"authType,omitempty"` + AuthType AuthType `json:"authType,omitempty"` // User to be used for basic authentication. BasicAuthUser *ValueFromSource `json:"basicAuthUser,omitempty"` // Password to be used for basic authentication. @@ -107,6 +106,14 @@ type SCIMConfig struct { BearerHeader string `json:"bearerHeader,omitempty"` } +// AuthType defines the authentication method for SCIM API access. +type AuthType string + +const ( + AuthTypeBasic AuthType = "basic" + AuthTypeBearerToken AuthType = "token" +) + // OrganizationStatus defines the observed state of an Organization type OrganizationStatus struct { // StatusConditions contain the different conditions that constitute the status of the Organization. diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 65702d587..f66b919af 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -10,7 +10,7 @@ package v1alpha1 import ( rbacv1 "k8s.io/api/rbac/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) diff --git a/docs/reference/api/index.html b/docs/reference/api/index.html index 67f0c179c..80e8e13b3 100644 --- a/docs/reference/api/index.html +++ b/docs/reference/api/index.html @@ -16,6 +16,13 @@

greenhouse.sap/v1alpha1

Resource Types: +

AuthType +(string alias)

+

+(Appears on: +SCIMConfig) +

+

AuthType defines the authentication method for SCIM API access.

Authentication

@@ -4068,7 +4075,9 @@

SCIMConfig authType
-github.com/cloudoperators/greenhouse/internal/scim.AuthType + +AuthType + diff --git a/e2e/authz/e2e_test.go b/e2e/authz/e2e_test.go index 79aef94e5..203d00e48 100644 --- a/e2e/authz/e2e_test.go +++ b/e2e/authz/e2e_test.go @@ -102,7 +102,7 @@ var _ = BeforeSuite(func() { org.Spec.Authentication = &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: scimBaseURL, - AuthType: scim.Basic, + AuthType: greenhousev1alpha1.AuthTypeBasic, BasicAuthUser: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "mock-scim-secret", diff --git a/go.mod b/go.mod index ef7c20bb9..54b2b855f 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,8 @@ module github.com/cloudoperators/greenhouse go 1.26.0 replace ( + github.com/cloudoperators/greenhouse/api => ./api //nolint:gomoddirectives + // DEX import matches version v2.45.1. github.com/dexidp/dex => github.com/dexidp/dex v0.0.0-20260303133905-11d2eeb52b42 github.com/dexidp/dex/api/v2 => github.com/dexidp/dex/api/v2 v2.4.0 @@ -28,6 +30,7 @@ replace ( require ( github.com/cenkalti/backoff/v5 v5.0.3 + github.com/cloudoperators/greenhouse/api v0.0.0-00010101000000-000000000000 github.com/dexidp/dex v0.0.0-20260303133905-11d2eeb52b42 github.com/fluxcd/cli-utils v1.2.1 github.com/fluxcd/helm-controller/api v1.5.5 diff --git a/internal/controller/catalog/source.go b/internal/controller/catalog/source.go index 6aecebe2d..10a53e014 100644 --- a/internal/controller/catalog/source.go +++ b/internal/controller/catalog/source.go @@ -211,7 +211,7 @@ func (s *source) reconcileGitRepository(ctx context.Context) error { spec := sourcev1.GitRepositorySpec{ URL: s.source.Repository, Interval: s.source.GetInterval(), - Reference: s.source.GetGitRepositoryReference(), + Reference: getGitRepositoryReference(&s.source), Provider: genericAuthProvider, Suspend: false, } diff --git a/internal/controller/catalog/utils.go b/internal/controller/catalog/utils.go index 037ac02ee..f6c7b6e50 100644 --- a/internal/controller/catalog/utils.go +++ b/internal/controller/catalog/utils.go @@ -9,6 +9,10 @@ import ( "net/url" "strconv" "strings" + + sourcev1 "github.com/fluxcd/source-controller/api/v1" + + greenhousev1alpha1 "github.com/cloudoperators/greenhouse/api/v1alpha1" ) // HashValue - returns a hash of the string @@ -41,3 +45,22 @@ func GetOwnerRepoInfo(s string) (host, owner, repo string, err error) { repo = comp[1] return } + +func getGitRepositoryReference(s *greenhousev1alpha1.CatalogSource) *sourcev1.GitRepositoryRef { + gitReference := &sourcev1.GitRepositoryRef{} + if s.Ref != nil { + // flux precedence 1 + if s.Ref.SHA != nil { + gitReference.Commit = *s.Ref.SHA + } + // flux precedence 2 + if s.Ref.Tag != nil { + gitReference.Tag = *s.Ref.Tag + } + // flux precedence 3 + if s.Ref.Branch != nil { + gitReference.Branch = *s.Ref.Branch + } + } + return gitReference +} diff --git a/internal/controller/organization/organization_controller_test.go b/internal/controller/organization/organization_controller_test.go index e09efb785..a773b4467 100644 --- a/internal/controller/organization/organization_controller_test.go +++ b/internal/controller/organization/organization_controller_test.go @@ -26,7 +26,6 @@ import ( "github.com/cloudoperators/greenhouse/internal/dex" dexapi "github.com/cloudoperators/greenhouse/internal/dex/api" "github.com/cloudoperators/greenhouse/internal/rbac" - "github.com/cloudoperators/greenhouse/internal/scim" "github.com/cloudoperators/greenhouse/internal/test" ) @@ -157,7 +156,7 @@ var _ = Describe("Test Organization reconciliation", Ordered, func() { o.Spec.Authentication = &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: groupsServer.URL + "/scim", - AuthType: scim.Basic, + AuthType: greenhousev1alpha1.AuthTypeBasic, BasicAuthUser: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "test-secret", @@ -199,7 +198,7 @@ var _ = Describe("Test Organization reconciliation", Ordered, func() { o.Spec.Authentication = &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: groupsServer.URL + "/scim", - AuthType: scim.BearerToken, + AuthType: greenhousev1alpha1.AuthTypeBearerToken, BearerToken: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "test-secret", @@ -247,7 +246,7 @@ var _ = Describe("Test Organization reconciliation", Ordered, func() { testOrg.Spec.Authentication = &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: groupsServer.URL + "/scim", - AuthType: scim.Basic, + AuthType: greenhousev1alpha1.AuthTypeBasic, BasicAuthUser: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "test-secret", diff --git a/internal/scim/scim_client.go b/internal/scim/scim_client.go index 4bc0d4c5a..405d36d50 100644 --- a/internal/scim/scim_client.go +++ b/internal/scim/scim_client.go @@ -17,6 +17,8 @@ import ( "strings" "github.com/go-logr/logr" + + greenhousev1alpha1 "github.com/cloudoperators/greenhouse/api/v1alpha1" ) type scimClient struct { @@ -33,7 +35,7 @@ type basicAuthTransport struct { type Config struct { URL string - AuthType AuthType + AuthType greenhousev1alpha1.AuthType BasicAuth *BasicAuthConfig BearerToken *BearerTokenConfig } @@ -96,7 +98,7 @@ func NewSCIMClient(logger logr.Logger, config *Config) (ISCIMClient, error) { } switch config.AuthType { - case Basic: + case greenhousev1alpha1.AuthTypeBasic: if config.BasicAuth == nil { return nil, errors.New("could not create http scim client, Basic Auth Config missing") } @@ -109,7 +111,7 @@ func NewSCIMClient(logger logr.Logger, config *Config) (ISCIMClient, error) { Password: config.BasicAuth.Password, Next: http.DefaultTransport, } - case BearerToken: + case greenhousev1alpha1.AuthTypeBearerToken: if config.BearerToken == nil { return nil, errors.New("could not create http scim client, BearerToken Config missing") } diff --git a/internal/scim/scim_client_test.go b/internal/scim/scim_client_test.go index 3d2e2db9d..c08096f97 100644 --- a/internal/scim/scim_client_test.go +++ b/internal/scim/scim_client_test.go @@ -6,13 +6,13 @@ package scim import ( "context" "fmt" - - ctrl "sigs.k8s.io/controller-runtime" - "net/http" "testing" "github.com/stretchr/testify/assert" + ctrl "sigs.k8s.io/controller-runtime" + + greenhousev1alpha1 "github.com/cloudoperators/greenhouse/api/v1alpha1" ) func Test_SCIM_Client(t *testing.T) { @@ -20,14 +20,14 @@ func Test_SCIM_Client(t *testing.T) { testTable := []struct { name string - authType AuthType + authType greenhousev1alpha1.AuthType basicAuthConfig *BasicAuthConfig bearerTokenConfig *BearerTokenConfig withError bool }{ { name: "it should successfully create a basic auth client", - authType: Basic, + authType: greenhousev1alpha1.AuthTypeBasic, basicAuthConfig: &BasicAuthConfig{ Username: "some-username", Password: "some-password", @@ -35,7 +35,7 @@ func Test_SCIM_Client(t *testing.T) { }, { name: "it should fail to create a basic auth client, when no username is provided", - authType: Basic, + authType: greenhousev1alpha1.AuthTypeBasic, basicAuthConfig: &BasicAuthConfig{ Password: "some-password", }, @@ -43,7 +43,7 @@ func Test_SCIM_Client(t *testing.T) { }, { name: "it should fail to create a basic auth client, when no password is provided", - authType: Basic, + authType: greenhousev1alpha1.AuthTypeBasic, basicAuthConfig: &BasicAuthConfig{ Username: "some-username", }, @@ -51,19 +51,19 @@ func Test_SCIM_Client(t *testing.T) { }, { name: "it should fail to create a basic auth client, when no username and password is provided", - authType: Basic, + authType: greenhousev1alpha1.AuthTypeBasic, withError: true, }, { name: "it should successfully create a bearer token client", - authType: BearerToken, + authType: greenhousev1alpha1.AuthTypeBearerToken, bearerTokenConfig: &BearerTokenConfig{ Token: bearerToken, }, }, { name: "it should failed to create a bearer token client, when no bearer token is provided", - authType: BearerToken, + authType: greenhousev1alpha1.AuthTypeBearerToken, withError: true, bearerTokenConfig: &BearerTokenConfig{}, }, @@ -111,7 +111,7 @@ func TestClient_GetGroups(t *testing.T) { }) scimClient, err := NewSCIMClient(logger, &Config{ URL: server.URL + baseURLPath, - AuthType: Basic, + AuthType: greenhousev1alpha1.AuthTypeBasic, BasicAuth: &BasicAuthConfig{ Username: "some-username", Password: "some-password", @@ -199,7 +199,7 @@ func TestClient_GetUsers(t *testing.T) { // Create the SCIM client scimClient, err := NewSCIMClient(logger, &Config{ URL: server.URL + baseURLPath, - AuthType: Basic, + AuthType: greenhousev1alpha1.AuthTypeBasic, BasicAuth: &BasicAuthConfig{ Username: "some-username", Password: "some-password", @@ -294,7 +294,7 @@ func TestClient_GetPaginatedUsers(t *testing.T) { // Create the SCIM client scimClient, err := NewSCIMClient(logger, &Config{ URL: server.URL + baseURLPath, - AuthType: Basic, + AuthType: greenhousev1alpha1.AuthTypeBasic, BasicAuth: &BasicAuthConfig{ Username: "some-username", Password: "some-password", diff --git a/internal/scim/scim_types.go b/internal/scim/scim_types.go index f6494fac2..3fd7fe3de 100644 --- a/internal/scim/scim_types.go +++ b/internal/scim/scim_types.go @@ -9,13 +9,6 @@ import ( "strings" ) -type AuthType string - -const ( - Basic AuthType = "basic" - BearerToken AuthType = "token" -) - const ( InitialStartID = "initial" ) diff --git a/internal/util/scim_config.go b/internal/util/scim_config.go index 67e480455..45c25c1f4 100644 --- a/internal/util/scim_config.go +++ b/internal/util/scim_config.go @@ -9,18 +9,18 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - greenhouseapisv1alpha1 "github.com/cloudoperators/greenhouse/api/v1alpha1" + greenhousev1alpha1 "github.com/cloudoperators/greenhouse/api/v1alpha1" "github.com/cloudoperators/greenhouse/internal/clientutil" "github.com/cloudoperators/greenhouse/internal/scim" ) -func GreenhouseSCIMConfigToSCIMConfig(ctx context.Context, k8sClient client.Client, config *greenhouseapisv1alpha1.SCIMConfig, namespace string) (*scim.Config, error) { +func GreenhouseSCIMConfigToSCIMConfig(ctx context.Context, k8sClient client.Client, config *greenhousev1alpha1.SCIMConfig, namespace string) (*scim.Config, error) { cfg := &scim.Config{ URL: config.BaseURL, AuthType: config.AuthType, } switch cfg.AuthType { - case scim.Basic: + case greenhousev1alpha1.AuthTypeBasic: var err error username, err := clientutil.GetSecretKeyFromSecretKeyReference(ctx, k8sClient, namespace, *config.BasicAuthUser.Secret) if err != nil { @@ -34,7 +34,7 @@ func GreenhouseSCIMConfigToSCIMConfig(ctx context.Context, k8sClient client.Clie Username: username, Password: password, } - case scim.BearerToken: + case greenhousev1alpha1.AuthTypeBearerToken: var err error token, err := clientutil.GetSecretKeyFromSecretKeyReference(ctx, k8sClient, namespace, *config.BearerToken.Secret) if err != nil { diff --git a/internal/webhook/v1alpha1/organization_webhook.go b/internal/webhook/v1alpha1/organization_webhook.go index d8ab3201a..f0ac471a7 100644 --- a/internal/webhook/v1alpha1/organization_webhook.go +++ b/internal/webhook/v1alpha1/organization_webhook.go @@ -13,7 +13,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook/admission" greenhousev1alpha1 "github.com/cloudoperators/greenhouse/api/v1alpha1" - "github.com/cloudoperators/greenhouse/internal/scim" "github.com/cloudoperators/greenhouse/internal/webhook" ) @@ -99,14 +98,14 @@ func validateSCIMConfig(org *greenhousev1alpha1.Organization) field.ErrorList { } switch scimCfg.AuthType { - case scim.Basic: + case greenhousev1alpha1.AuthTypeBasic: if scimCfg.BasicAuthUser == nil || scimCfg.BasicAuthUser.Secret == nil { errs = append(errs, field.Required(scimPath.Child("basicAuthUser"), "basicAuthUser and its secret are required")) } if scimCfg.BasicAuthPw == nil || scimCfg.BasicAuthPw.Secret == nil { errs = append(errs, field.Required(scimPath.Child("basicAuthPw"), "basicAuthPw and its secret are required")) } - case scim.BearerToken: + case greenhousev1alpha1.AuthTypeBearerToken: if scimCfg.BearerToken == nil || scimCfg.BearerToken.Secret == nil { errs = append(errs, field.Required(scimPath.Child("bearerToken"), "bearerToken and its secret are required")) } diff --git a/internal/webhook/v1alpha1/organization_webhook_test.go b/internal/webhook/v1alpha1/organization_webhook_test.go index 3f317cab8..0411367e8 100644 --- a/internal/webhook/v1alpha1/organization_webhook_test.go +++ b/internal/webhook/v1alpha1/organization_webhook_test.go @@ -11,7 +11,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" greenhousev1alpha1 "github.com/cloudoperators/greenhouse/api/v1alpha1" - "github.com/cloudoperators/greenhouse/internal/scim" ) var _ = Describe("Validate Organization Defaulting Webhook", func() { @@ -53,7 +52,7 @@ var _ = Describe("Validate Organization Webhook", func() { Authentication: &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: "https://example.org", - AuthType: scim.Basic, + AuthType: greenhousev1alpha1.AuthTypeBasic, BasicAuthUser: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "test-secret", @@ -76,7 +75,7 @@ var _ = Describe("Validate Organization Webhook", func() { Authentication: &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: "https://example.org", - AuthType: scim.BearerToken, + AuthType: greenhousev1alpha1.AuthTypeBearerToken, BearerToken: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "test-secret", @@ -93,7 +92,7 @@ var _ = Describe("Validate Organization Webhook", func() { Authentication: &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: "https://example.org", - AuthType: scim.Basic, + AuthType: greenhousev1alpha1.AuthTypeBasic, BearerToken: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "test-secret", @@ -110,7 +109,7 @@ var _ = Describe("Validate Organization Webhook", func() { Authentication: &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: "https://example.org", - AuthType: scim.BearerToken, + AuthType: greenhousev1alpha1.AuthTypeBearerToken, BasicAuthUser: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "test-secret", @@ -172,7 +171,7 @@ var _ = Describe("Validate Organization Webhook", func() { Authentication: &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: "https://example.org", - AuthType: scim.Basic, + AuthType: greenhousev1alpha1.AuthTypeBasic, BasicAuthUser: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "test-secret", @@ -195,7 +194,7 @@ var _ = Describe("Validate Organization Webhook", func() { Authentication: &greenhousev1alpha1.Authentication{ SCIMConfig: &greenhousev1alpha1.SCIMConfig{ BaseURL: "https://example.org", - AuthType: scim.BearerToken, + AuthType: greenhousev1alpha1.AuthTypeBearerToken, BearerToken: &greenhousev1alpha1.ValueFromSource{ Secret: &greenhousev1alpha1.SecretKeyReference{ Name: "test-secret", diff --git a/types/typescript/schema.d.ts b/types/typescript/schema.d.ts index 5f3987e5c..b5f0ba862 100644 --- a/types/typescript/schema.d.ts +++ b/types/typescript/schema.d.ts @@ -842,7 +842,12 @@ export interface components { clusterOptionOverrides?: { clusterName: string; overrides: { - /** @description Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions. */ + /** + * @description Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions. + * + * Deprecated: Expression is deprecated on standalone Plugins and will be removed in a future release. + * Consider using a PluginPreset to deploy Plugins utilizing the Expression field. + */ expression?: string; /** @description Name of the values. */ name: string; @@ -850,7 +855,12 @@ export interface components { value?: unknown; /** @description ValueFrom references value in another source. */ valueFrom?: { - /** @description Ref references values defined in another resource (Plugin, PluginPreset) */ + /** + * @description Ref references values defined in another resource (Plugin, PluginPreset) + * + * Deprecated: Ref is deprecated on standalone Plugins and will be removed in a future release. + * Consider using a PluginPreset to deploy Plugins utilizing the Ref field. + */ ref?: { /** @description Expression is a CEL expression to extract the value from the referenced resource */ expression: string; @@ -944,8 +954,6 @@ export interface components { deletionPolicy: "Delete" | "Retain"; /** @description PluginSpec is the spec of the plugin to be deployed by the PluginPreset. */ plugin: { - /** @description ClusterName is the name of the cluster the plugin is deployed to. If not set, the plugin is deployed to the greenhouse cluster. */ - clusterName?: string; /** * @description DeletionPolicy defines how Helm Releases created by a Plugin are handled upon deletion of the Plugin. * Supported values are "Delete" and "Retain". If not set, defaults to "Delete". @@ -974,7 +982,12 @@ export interface components { }[]; /** @description Values are the values for a PluginDefinition instance. */ optionValues?: { - /** @description Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions. */ + /** + * @description Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions. + * + * Deprecated: Expression is deprecated on standalone Plugins and will be removed in a future release. + * Consider using a PluginPreset to deploy Plugins utilizing the Expression field. + */ expression?: string; /** @description Name of the values. */ name: string; @@ -982,7 +995,12 @@ export interface components { value?: unknown; /** @description ValueFrom references value in another source. */ valueFrom?: { - /** @description Ref references values defined in another resource (Plugin, PluginPreset) */ + /** + * @description Ref references values defined in another resource (Plugin, PluginPreset) + * + * Deprecated: Ref is deprecated on standalone Plugins and will be removed in a future release. + * Consider using a PluginPreset to deploy Plugins utilizing the Ref field. + */ ref?: { /** @description Expression is a CEL expression to extract the value from the referenced resource */ expression: string; @@ -1059,16 +1077,6 @@ export interface components { * Defaults to the Greenhouse managed namespace if not set. */ releaseNamespace?: string; - /** @description WaitFor defines other Plugins to wait for before installing this Plugin. */ - waitFor?: { - /** @description PluginRef defines a reference to the Plugin. */ - pluginRef: { - /** @description Name of the Plugin. */ - name?: string; - /** @description PluginPreset is the name of the PluginPreset which creates the Plugin. */ - pluginPreset?: string; - }; - }[]; }; /** @description WaitFor defines other Plugins to wait for before creating the Plugin. */ waitFor?: { @@ -1198,7 +1206,12 @@ export interface components { }[]; /** @description Values are the values for a PluginDefinition instance. */ optionValues?: { - /** @description Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions. */ + /** + * @description Expression is a YAML string with ${...} placeholders that will be evaluated as CEL expressions. + * + * Deprecated: Expression is deprecated on standalone Plugins and will be removed in a future release. + * Consider using a PluginPreset to deploy Plugins utilizing the Expression field. + */ expression?: string; /** @description Name of the values. */ name: string; @@ -1206,7 +1219,12 @@ export interface components { value?: unknown; /** @description ValueFrom references value in another source. */ valueFrom?: { - /** @description Ref references values defined in another resource (Plugin, PluginPreset) */ + /** + * @description Ref references values defined in another resource (Plugin, PluginPreset) + * + * Deprecated: Ref is deprecated on standalone Plugins and will be removed in a future release. + * Consider using a PluginPreset to deploy Plugins utilizing the Ref field. + */ ref?: { /** @description Expression is a CEL expression to extract the value from the referenced resource */ expression: string;