diff --git a/docs/data-sources/global_role.md b/docs/data-sources/global_role.md index bc5457f1..00831e9a 100644 --- a/docs/data-sources/global_role.md +++ b/docs/data-sources/global_role.md @@ -32,3 +32,4 @@ The following attributes are exported: * `annotations` - (Computed) Annotations for global role object (map) * `labels` - (Computed) Labels for global role object (map) * `inherited_cluster_roles` - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list) +* `namespaced_rules` - (Optional) Rules that are active in specific namespaces in the local cluster. (list) diff --git a/docs/resources/global_role.md b/docs/resources/global_role.md index 47df35b1..28219b8a 100644 --- a/docs/resources/global_role.md +++ b/docs/resources/global_role.md @@ -34,6 +34,7 @@ The following arguments are supported: * `annotations` - (Optional/Computed) Annotations for global role object (map) * `labels` - (Optional/Computed) Labels for global role object (map) * `inherited_cluster_roles` - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list) +* `namespaced_rules` - (Optional) Rules that are active in specific namespaces in the local cluster. (list) ## Attributes Reference diff --git a/go.mod b/go.mod index 9b3b7f6b..432552e1 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,18 @@ module github.com/rancher/terraform-provider-rancher2 -go 1.21 +go 1.22 + +toolchain go1.22.5 require ( github.com/ghodss/yaml v1.0.0 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/terraform-plugin-sdk v1.17.2 - github.com/rancher/norman v0.0.0-20240206180703-6eda4bc94b4c - github.com/rancher/rancher v0.0.0-20240618132447-2145c8e9d603 + github.com/rancher/norman v0.0.0-20240207153100-3bb70b772b52 + github.com/rancher/rancher v0.0.0-20240506132424-2b53406a5497 github.com/rancher/rancher/pkg/apis v0.0.0 github.com/rancher/rancher/pkg/client v0.0.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 golang.org/x/crypto v0.23.0 golang.org/x/sync v0.7.0 gopkg.in/yaml.v2 v2.4.0 @@ -32,7 +34,7 @@ require ( github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect - github.com/aws/aws-sdk-go v1.49.24 // indirect + github.com/aws/aws-sdk-go v1.50.34 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect @@ -49,7 +51,7 @@ require ( github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/go-test/deep v1.0.7 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -60,7 +62,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/s2a-go v0.1.7 // indirect - github.com/google/uuid v1.5.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect @@ -89,7 +91,7 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.16.6 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/matryer/moq v0.3.2 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -115,14 +117,14 @@ require ( github.com/prometheus/client_model v0.4.0 // indirect github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect - github.com/rancher/aks-operator v1.2.2 // indirect - github.com/rancher/apiserver v0.0.0-20240207153744-69b3c2b56f3f // indirect + github.com/rancher/aks-operator v1.3.0-rc12 // indirect + github.com/rancher/apiserver v0.0.0-20240207153957-4fd7d821d952 // indirect github.com/rancher/channelserver v0.6.1-0.20240212155841-07630c8295da // indirect - github.com/rancher/eks-operator v1.3.2 // indirect + github.com/rancher/eks-operator v1.4.0-rc9 // indirect github.com/rancher/fleet/pkg/apis v0.9.1-rc.2.0.20240213164401-2c6b1019687c // indirect - github.com/rancher/gke-operator v1.2.2 // indirect + github.com/rancher/gke-operator v1.3.0-rc6 // indirect github.com/rancher/lasso v0.0.0-20240123150939-7055397d6dfa // indirect - github.com/rancher/rke v1.5.11-rc1 // indirect + github.com/rancher/rke v1.6.0-rc1 // indirect github.com/rancher/wrangler/v2 v2.1.4 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect @@ -155,11 +157,11 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.28.8 // indirect k8s.io/component-base v0.28.8 // indirect - k8s.io/gengo v0.0.0-20230306165830-ab3349d207d4 // indirect + k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/kubernetes v1.28.8 // indirect - k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect + k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect sigs.k8s.io/cli-utils v0.28.0 // indirect sigs.k8s.io/cluster-api v1.5.5 // indirect sigs.k8s.io/controller-runtime v0.15.3 // indirect @@ -172,8 +174,8 @@ replace ( github.com/crewjam/saml => github.com/crewjam/saml v0.4.5 github.com/docker/distribution => github.com/docker/distribution v2.8.1+incompatible github.com/docker/docker => github.com/docker/docker v20.10.17+incompatible - github.com/rancher/rancher/pkg/apis => github.com/rancher/rancher/pkg/apis v0.0.0-20240611034301-19a4362e2243 - github.com/rancher/rancher/pkg/client => github.com/rancher/rancher/pkg/client v0.0.0-20240611034301-19a4362e2243 + github.com/rancher/rancher/pkg/apis => github.com/rancher/rancher/pkg/apis v0.0.0-20240506132424-2b53406a5497 + github.com/rancher/rancher/pkg/client => github.com/rancher/rancher/pkg/client v0.0.0-20240506132424-2b53406a5497 github.com/spf13/afero => github.com/spf13/afero v1.2.2 go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v0.31.0 helm.sh/helm/v3 => github.com/rancher/helm/v3 v3.9.0-rancher1 diff --git a/go.sum b/go.sum index c6875624..f47c848f 100644 --- a/go.sum +++ b/go.sum @@ -227,8 +227,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= -github.com/aws/aws-sdk-go v1.49.24 h1:2ekq9ZvaoB2aRbTDfARzgVGUBB9N8XD2QYhFmTBlp+c= -github.com/aws/aws-sdk-go v1.49.24/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.50.34 h1:J1LjHzWNN/yVxQDTr0NIlI5vz9xRPvWiNCjQ4+5wh58= +github.com/aws/aws-sdk-go v1.50.34/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= @@ -315,11 +315,11 @@ github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -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/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.7 h1:/VSMRlnY/JSyqxQUzQLKVMAskpY/NZKFA5j2P+0pP2M= github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= @@ -414,16 +414,16 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20230502171905-255e3b9b56de h1:6bMcLOeKoNo0+mTOb1ee3McF6CCKGixjLR3EDQY1Jik= +github.com/google/pprof v0.0.0-20230502171905-255e3b9b56de/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -542,8 +542,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk= +github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -617,10 +617,10 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.17.3 h1:oJcvKpIb7/8uLpDDtnQuf18xVnwKp8DTD7DQ6gTd/MU= -github.com/onsi/ginkgo/v2 v2.17.3/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= -github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= -github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +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.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE= +github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -640,38 +640,38 @@ github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdO github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= -github.com/rancher/aks-operator v1.2.2 h1:OnIXmM+TYJPsfezs+8lfRQrwgdMh6stjrsP9KPHogfc= -github.com/rancher/aks-operator v1.2.2/go.mod h1:vNaRJh/cqPB19OrY14CaHzyGH3KmRv1k3LcAo+AdqQ4= -github.com/rancher/apiserver v0.0.0-20240207153744-69b3c2b56f3f h1:51aGoMMuPO+JsoglWmXYgA9xLWPv/bnpT0/6zErgaIU= -github.com/rancher/apiserver v0.0.0-20240207153744-69b3c2b56f3f/go.mod h1:RBcpQs/KjClGntgKCd5XcrUX5J2Rz9sW5DGEMd7H5bw= +github.com/rancher/aks-operator v1.3.0-rc12 h1:xrCMp5dipfXQMB+LB6ogeqAkmEQqsBiPisLvKDRu164= +github.com/rancher/aks-operator v1.3.0-rc12/go.mod h1:bdUAZAf8mOJKRSqvzdgZ2a7bsid6hEgXs3uzIl6Kgfo= +github.com/rancher/apiserver v0.0.0-20240207153957-4fd7d821d952 h1:lMf1jIqD/igkGv1V2ibBKsGLJWhWbJ4cy85U6FGLqaQ= +github.com/rancher/apiserver v0.0.0-20240207153957-4fd7d821d952/go.mod h1:RBcpQs/KjClGntgKCd5XcrUX5J2Rz9sW5DGEMd7H5bw= github.com/rancher/channelserver v0.6.1-0.20240212155841-07630c8295da h1:M7p9bmFBw5kKgoBtkPXjDZTGoj94ZWt6NaTa/7jglB4= github.com/rancher/channelserver v0.6.1-0.20240212155841-07630c8295da/go.mod h1:DuOeweH+bHP22OVq7mgQwDMVJjMmPNn8WzF1IHAU39U= github.com/rancher/client-go v1.28.6-rancher1 h1:nSoGKs12BuPviZtzemO7wTX8jxABaLqfYKFLRBV8MI0= github.com/rancher/client-go v1.28.6-rancher1/go.mod h1:+nu0Yp21Oeo/cBCsprNVXB2BfJTV51lFfe5tXl2rUL8= -github.com/rancher/eks-operator v1.3.2 h1:0FWtfAhcOFHYR/GA+LiVcvzQ1TsOmaluCEP6tEpeZcM= -github.com/rancher/eks-operator v1.3.2/go.mod h1:cnkOlgkrVal9XZtH6xUE/57VvP0psK4i7fwwfZINkrA= +github.com/rancher/eks-operator v1.4.0-rc9 h1:y6HEoLWjBws5ZKhk5xLXQPsTeworyjZy9OE0DectF6w= +github.com/rancher/eks-operator v1.4.0-rc9/go.mod h1:Ua3t87IsXfGKcaF1pxWecMJzpDIO+5dbLQ7tW3iJTeA= github.com/rancher/fleet/pkg/apis v0.9.1-rc.2.0.20240213164401-2c6b1019687c h1:Oza71YDPN+jE9WY8xRVthD3MYkVYHHgsTOAxGSb9OLs= github.com/rancher/fleet/pkg/apis v0.9.1-rc.2.0.20240213164401-2c6b1019687c/go.mod h1:KNDEr0BQU33vw4UEYR0v33HwIcyrykcI5UksJwJOmpM= -github.com/rancher/gke-operator v1.2.2 h1:bT8uijPD7lCdwkvclCh3CeuQPFj2vbZomKJpfRwTK/M= -github.com/rancher/gke-operator v1.2.2/go.mod h1:CNdldUK2fKZyN9jxhbnaTMigWA+rVZVzbnWfCvnhPJU= +github.com/rancher/gke-operator v1.3.0-rc6 h1:RryW0LIWhekv76kjpsspAIeBdtXddM762OhVJpNLHJA= +github.com/rancher/gke-operator v1.3.0-rc6/go.mod h1:il6z4YBNWG0z4ZCpk0t+ZBo3U2dS3bHV2mFm3/1A924= github.com/rancher/lasso v0.0.0-20240123150939-7055397d6dfa h1:eRhvQJjIpPxJunlS3e1J3qTghUy9MIrMjQa2aXYSC3k= github.com/rancher/lasso v0.0.0-20240123150939-7055397d6dfa/go.mod h1:utdskbIL7kdVvPCUFPEJQDWJwPHGFpUCRfVkX2G2Xxg= -github.com/rancher/norman v0.0.0-20240206180703-6eda4bc94b4c h1:ayqZqJ4AYYVaZGlBztLBij81z/QRsSFbQfxs9bzA+Tg= -github.com/rancher/norman v0.0.0-20240206180703-6eda4bc94b4c/go.mod h1:WbNpu/HwChwKk54W0rWBdioxYVVZwVVz//UX84m/NvY= -github.com/rancher/rancher v0.0.0-20240618132447-2145c8e9d603 h1:epA64furT74i2TEdHmjJ50V7biNyaqDPkfBWu81wK/4= -github.com/rancher/rancher v0.0.0-20240618132447-2145c8e9d603/go.mod h1:gYLd9oGi802+StsGyafR2l2Em8lHo3CK0ibxlWBOW30= -github.com/rancher/rancher/pkg/apis v0.0.0-20240611034301-19a4362e2243 h1:lDdMkc0klQ/0jA8l3QWRzKpK21nO6E4qIagaOBq2KdA= -github.com/rancher/rancher/pkg/apis v0.0.0-20240611034301-19a4362e2243/go.mod h1:5FRNHrG/G92wZ7XYKr9eFl/Sf2XqHown8CozHk+pmmU= -github.com/rancher/rancher/pkg/client v0.0.0-20240611034301-19a4362e2243 h1:QDsw8rmLzUz6qCXPf+2Bjq70jsVJgFVU6k06bOf6gIc= -github.com/rancher/rancher/pkg/client v0.0.0-20240611034301-19a4362e2243/go.mod h1:iZL8Yvm0q8mGUHJlkWUyw/1tyE+GP/1TZf/2JHo9R+A= -github.com/rancher/rke v1.5.11-rc1 h1:rggj6LNk06BMGQ8FFoMa5F+8m0/M11s2WdgqtXIzwgw= -github.com/rancher/rke v1.5.11-rc1/go.mod h1:/z9oyKqYpFwgRBV9rfLxqUdjydz/VMCTcjld4uUt7uM= +github.com/rancher/norman v0.0.0-20240207153100-3bb70b772b52 h1:k9QmFfME7e92jP7X5iTtPHoOrM9Z/zXZQpAh5jzk6dE= +github.com/rancher/norman v0.0.0-20240207153100-3bb70b772b52/go.mod h1:WbNpu/HwChwKk54W0rWBdioxYVVZwVVz//UX84m/NvY= +github.com/rancher/rancher v0.0.0-20240506132424-2b53406a5497 h1:CwXilVSwJI3cmK+rQHWcgIbz1tJDFsN9ZreXJ9s7GJc= +github.com/rancher/rancher v0.0.0-20240506132424-2b53406a5497/go.mod h1:9Ds1RXBIML/i/RqJz7OaiQS20sJuyCb35xlEOR0O9F4= +github.com/rancher/rancher/pkg/apis v0.0.0-20240506132424-2b53406a5497 h1:dv0xqLJpk/IHOOyWWDqT8dEHzf8Mxw5afGm8IKpexsE= +github.com/rancher/rancher/pkg/apis v0.0.0-20240506132424-2b53406a5497/go.mod h1:JY9b8/9I2RwMd4ef3dIAAbWIaTXB6NTY8TXijq1C0mk= +github.com/rancher/rancher/pkg/client v0.0.0-20240506132424-2b53406a5497 h1:3W9Fp4L+tnmTtqtK4hbTSTsXOZ5UyfGt88Yawi1KukE= +github.com/rancher/rancher/pkg/client v0.0.0-20240506132424-2b53406a5497/go.mod h1:GwKKrJEdrnPs3zXAr0MUssgaLLzGDRmU84OIE6jc3ZE= +github.com/rancher/rke v1.6.0-rc1 h1:4aYfGiG4gxL5k44M3jpDoKfQqI1lxdl4GAVPRMvKMj8= +github.com/rancher/rke v1.6.0-rc1/go.mod h1:vojhOf8U8VCmw7y17OENWXSIfEFPEbXCMQcmI7xN7i8= github.com/rancher/wrangler/v2 v2.1.4 h1:ohov0i6A9dJHHO6sjfsH4Dqv93ZTdm5lIJVJdPzVdQc= github.com/rancher/wrangler/v2 v2.1.4/go.mod h1:af5OaGU/COgreQh1mRbKiUI64draT2NN34uk+PALFY8= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -706,8 +706,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= @@ -1336,8 +1336,8 @@ k8s.io/apiserver v0.28.6 h1:SfS5v4I5UGvh0q/1rzvNwLFsK+r7YzcsixnUc0NwoEk= k8s.io/apiserver v0.28.6/go.mod h1:8n0aerS3kPm9usyB8B+an6/BZ5+Fa9fNqlASFdDDVwk= k8s.io/component-base v0.28.6 h1:G4T8VrcQ7xZou3by/fY5NU5mfxOBlWaivS2lPrEltAo= k8s.io/component-base v0.28.6/go.mod h1:Dg62OOG3ALu2P4nAG00UdsuHoNLQJ5VsUZKQlLDcS+E= -k8s.io/gengo v0.0.0-20230306165830-ab3349d207d4 h1:aClvVG6GbX10ISHcc24J+tqbr0S7fEe1MWkFJ7cWWCI= -k8s.io/gengo v0.0.0-20230306165830-ab3349d207d4/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4 h1:izq7u3SJBdOAuA5YYe1/PIp9jczrih/jGlKRRt0G7bQ= +k8s.io/gengo v0.0.0-20240129211411-f967bbeff4b4/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= @@ -1345,8 +1345,8 @@ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5Ohx k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= k8s.io/kubernetes v1.28.6 h1:Nn2fXNjaqmKyXeFq6verbdqzlj1aqUpBcyeC1OhRFa4= k8s.io/kubernetes v1.28.6/go.mod h1:0qpyGJTR3blkbQOmZA3Z0u1VDZJNxJM8ifLUVNJN0X8= -k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU= -k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/rancher2/data_source_rancher2_global_role.go b/rancher2/data_source_rancher2_global_role.go index f0afa0b0..186da6c0 100644 --- a/rancher2/data_source_rancher2_global_role.go +++ b/rancher2/data_source_rancher2_global_role.go @@ -56,6 +56,11 @@ func dataSourceRancher2GlobalRole() *schema.Resource { Type: schema.TypeString, }, }, + "namespaced_rules": { + Type: schema.TypeMap, + Optional: true, + Description: "Rules that are active in specific namespaces in the local cluster", + }, }, } } diff --git a/rancher2/resource_rancher2_global_role.go b/rancher2/resource_rancher2_global_role.go index 3b144c00..31c55613 100644 --- a/rancher2/resource_rancher2_global_role.go +++ b/rancher2/resource_rancher2_global_role.go @@ -102,6 +102,7 @@ func resourceRancher2GlobalRoleUpdate(d *schema.ResourceData, meta interface{}) "annotations": toMapString(d.Get("annotations").(map[string]interface{})), "labels": toMapString(d.Get("labels").(map[string]interface{})), "inheritedClusterRoles": toArrayString(d.Get("inherited_cluster_roles").([]interface{})), + "namespacedRules": toMapString(d.Get("namespaced_rules").(map[string]interface{})), } if _, err = client.GlobalRole.Update(globalRole, update); err != nil { diff --git a/rancher2/schema_global_role.go b/rancher2/schema_global_role.go index b60d3818..ee815929 100644 --- a/rancher2/schema_global_role.go +++ b/rancher2/schema_global_role.go @@ -47,6 +47,11 @@ func globalRoleFields() map[string]*schema.Schema { Type: schema.TypeString, }, }, + "namespaced_rules": { + Type: schema.TypeMap, + Optional: true, + Description: "Rules that are active in specific namespaces in the local cluster", + }, } for k, v := range commonAnnotationLabelFields() { diff --git a/rancher2/structure_global_role.go b/rancher2/structure_global_role.go index d59d11d6..baa183fb 100644 --- a/rancher2/structure_global_role.go +++ b/rancher2/structure_global_role.go @@ -45,6 +45,14 @@ func flattenGlobalRole(d *schema.ResourceData, in *managementClient.GlobalRole) } } + if len(in.NamespacedRules) > 0 { + obj := make(map[string][]interface{}) + for ns, rules := range in.NamespacedRules { + obj[ns] = flattenPolicyRules(rules) + } + err = d.Set("namespaced_rules", obj) + } + return nil } @@ -83,5 +91,13 @@ func expandGlobalRole(in *schema.ResourceData) *managementClient.GlobalRole { obj.InheritedClusterRoles = toArrayString(v) } + if v, ok := in.Get("namespaced_rules").(map[string][]interface{}); ok && len(v) > 0 { + nsRules := make(map[string][]managementClient.PolicyRule) + for ns, rules := range v { + nsRules[ns] = expandPolicyRules(rules) + } + obj.NamespacedRules = nsRules + } + return obj } diff --git a/rancher2/structure_global_role_test.go b/rancher2/structure_global_role_test.go index f84f8ce3..aaa3fb46 100644 --- a/rancher2/structure_global_role_test.go +++ b/rancher2/structure_global_role_test.go @@ -15,6 +15,9 @@ var ( testGlobalRoleInterface map[string]interface{} testGlobalRoleWithInheritedClusterRolesConf *managementClient.GlobalRole testGlobalRoleWithInheritedClusterRolesInterface map[string]interface{} + testGlobalRoleNamespacedRules *managementClient.GlobalRole + testGlobalRoleNamespacedRulesConf map[string][]managementClient.PolicyRule + testGlobalRoleNamespacedRulesInterface map[string][]interface{} ) func init() { @@ -66,12 +69,65 @@ func init() { }, }, } + testGlobalRoleNamespacedRulesConf = map[string][]managementClient.PolicyRule{ + "namespace1": { + { + APIGroups: []string{ + "api_group1", + "api_group2", + }, + NonResourceURLs: []string{ + "non_resource_urls1", + "non_resource_urls2", + }, + ResourceNames: []string{ + "resource_names1", + "resource_names2", + }, + Resources: []string{ + "resources1", + "resources2", + }, + Verbs: []string{ + "verbs1", + "verbs2", + }, + }, + }, + } + testGlobalRoleNamespacedRulesInterface = map[string][]interface{}{ + "namespace1": { + map[string]interface{}{ + "api_groups": []interface{}{ + "api_group1", + "api_group2", + }, + "non_resource_urls": []interface{}{ + "non_resource_urls1", + "non_resource_urls2", + }, + "resource_names": []interface{}{ + "resource_names1", + "resource_names2", + }, + "resources": []interface{}{ + "resources1", + "resources2", + }, + "verbs": []interface{}{ + "verbs1", + "verbs2", + }, + }, + }, + } testGlobalRoleConf = &managementClient.GlobalRole{ - Description: "description", - Name: "name", - NewUserDefault: true, - Rules: testGlobalRolePolicyRulesConf, + Description: "description", + Name: "name", + NewUserDefault: true, + Rules: testGlobalRolePolicyRulesConf, + NamespacedRules: testGlobalRoleNamespacedRulesConf, Annotations: map[string]string{ "node_one": "one", "node_two": "two", @@ -86,6 +142,7 @@ func init() { "description": "description", "name": "name", "rules": testGlobalRolePolicyRulesInterface, + "namespaced_rules": testGlobalRoleNamespacedRulesInterface, "annotations": map[string]interface{}{ "node_one": "one", "node_two": "two",