Skip to content

Commit

Permalink
Add ExternalRules to RoleTemplate (#1356)
Browse files Browse the repository at this point in the history
Signed-off-by: raul <[email protected]>
Co-authored-by: Matt Trachier <[email protected]>
  • Loading branch information
raulcabello and matttrach authored Jun 27, 2024
1 parent 642464a commit a24b588
Show file tree
Hide file tree
Showing 9 changed files with 408 additions and 805 deletions.
1 change: 1 addition & 0 deletions docs/data-sources/role_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The following attributes are exported:
* `default_role` - (Computed) Default role template for new created cluster or project (bool)
* `description` - (Computed) Role template description (string)
* `external` - (Computed) External role template (bool)
* `external_rules` - (Computed) External rules used for authorization. (list)
* `hidden` - (Computed) Hidden role template (bool)
* `locked` - (Computed) Locked role template (bool)
* `role_template_ids` - (Computed) Inherit role template IDs (list)
Expand Down
1 change: 1 addition & 0 deletions docs/resources/role_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ The following arguments are supported:
* `default_role` - (Optional) Default role template for new created cluster or project. Default `false` (bool)
* `description` - (Optional/Computed) Role template description (string)
* `external` - (Optional) External role template. Default `false` (bool)
* `external_rules` - (Optional/Computed) External rules used for authorization. This field is required when `external=true` and no underlying ClusterRole exists. (list)
* `hidden` - (Optional) Hidden role template. Default `false` (bool)
* `locked` - (Optional) Locked role template. Default `false` (bool)
* `role_template_ids` - (Optional/Computed) Inherit role template IDs (list)
Expand Down
220 changes: 111 additions & 109 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
module github.com/rancher/terraform-provider-rancher2

go 1.19
go 1.21

require (
github.com/emicklei/go-restful v2.16.0+incompatible
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-20230426211126-d3552b018687
github.com/rancher/rancher v0.0.0-20230525094739-ff2e09449efc
github.com/rancher/norman v0.0.0-20240206180703-6eda4bc94b4c
github.com/rancher/rancher v0.0.0-20240618132447-2145c8e9d603
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
golang.org/x/crypto v0.14.0
golang.org/x/sync v0.3.0
golang.org/x/crypto v0.23.0
golang.org/x/sync v0.7.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.25.12
k8s.io/apimachinery v0.25.12
k8s.io/apiserver v0.25.4
k8s.io/api v0.28.8
k8s.io/apimachinery v0.28.8
k8s.io/apiserver v0.28.8
k8s.io/client-go v12.0.0+incompatible
)

require (
cloud.google.com/go v0.110.2 // indirect
cloud.google.com/go/compute v1.20.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.13.0 // indirect
cloud.google.com/go/storage v1.29.0 // indirect
cloud.google.com/go v0.110.10 // indirect
cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
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.44.300 // indirect
github.com/aws/aws-sdk-go v1.49.24 // 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
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
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.1 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // 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
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/go-github/v29 v29.0.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.5.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
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand All @@ -84,18 +84,18 @@ require (
github.com/hashicorp/terraform-plugin-test/v2 v2.2.1 // indirect
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
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.15.11 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matryer/moq v0.0.0-20200607124540-4638a53893e6 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/matryer/moq v0.3.2 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/cli v1.1.2 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
Expand All @@ -111,95 +111,97 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rancher/aks-operator v1.2.0-rc2 // indirect
github.com/rancher/apiserver v0.0.0-20230120214941-e88c32739dc7 // indirect
github.com/rancher/channelserver v0.5.1-0.20220405170618-28c9b37deff1 // indirect
github.com/rancher/eks-operator v1.2.2-rc3 // indirect
github.com/rancher/fleet/pkg/apis v0.0.0-20230810121238-9d0ee7f56848 // indirect
github.com/rancher/gke-operator v1.1.6-rc2 // indirect
github.com/rancher/lasso v0.0.0-20230629200414-8a54b32e6792 // indirect
github.com/rancher/rke v1.5.0-rc2 // indirect
github.com/rancher/wrangler v1.1.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.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/channelserver v0.6.1-0.20240212155841-07630c8295da // indirect
github.com/rancher/eks-operator v1.3.2 // 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/lasso v0.0.0-20240123150939-7055397d6dfa // indirect
github.com/rancher/rke v1.5.11-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
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.13.0 // indirect
github.com/zclconf/go-cty-yaml v1.0.2 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.20.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/api v0.130.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529 // indirect
google.golang.org/grpc v1.56.1 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
google.golang.org/api v0.153.0 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.25.4 // indirect
k8s.io/component-base v0.25.4 // indirect
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/kubernetes v1.25.4 // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
sigs.k8s.io/cli-utils v0.27.0 // indirect
sigs.k8s.io/cluster-api v1.2.12 // indirect
sigs.k8s.io/controller-runtime v0.12.3 // 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/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
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
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

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-20230901132600-5e1ee2611616
github.com/rancher/rancher/pkg/client => github.com/rancher/rancher/pkg/client v0.0.0-20230901132600-5e1ee2611616
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/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
k8s.io/api => k8s.io/api v0.25.4
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.4
k8s.io/apimachinery => k8s.io/apimachinery v0.25.4
k8s.io/apiserver => k8s.io/apiserver v0.25.4
k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.4
k8s.io/client-go => github.com/rancher/client-go v1.25.4-rancher1
k8s.io/cloud-provider => k8s.io/cloud-provider v0.25.4
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.25.4
k8s.io/code-generator => k8s.io/code-generator v0.25.4
k8s.io/component-base => k8s.io/component-base v0.25.4
k8s.io/component-helpers => k8s.io/component-helpers v0.25.4
k8s.io/controller-manager => k8s.io/controller-manager v0.25.4
k8s.io/cri-api => k8s.io/cri-api v0.25.4
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.25.4
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.25.4
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.25.4
k8s.io/kube-proxy => k8s.io/kube-proxy v0.25.4
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.25.4
k8s.io/kubectl => k8s.io/kubectl v0.25.4
k8s.io/kubelet => k8s.io/kubelet v0.25.4
k8s.io/kubernetes => k8s.io/kubernetes v1.25.4
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.25.4
k8s.io/metrics => k8s.io/metrics v0.25.4
k8s.io/mount-utils => k8s.io/mount-utils v0.25.4
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.25.4
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.25.4
k8s.io/api => k8s.io/api v0.28.6
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.28.6
k8s.io/apimachinery => k8s.io/apimachinery v0.28.6
k8s.io/apiserver => k8s.io/apiserver v0.28.6
k8s.io/cli-runtime => k8s.io/cli-runtime v0.28.6
k8s.io/client-go => github.com/rancher/client-go v1.28.6-rancher1
k8s.io/cloud-provider => k8s.io/cloud-provider v0.28.6
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.28.6
k8s.io/code-generator => k8s.io/code-generator v0.28.6
k8s.io/component-base => k8s.io/component-base v0.28.6
k8s.io/component-helpers => k8s.io/component-helpers v0.28.6
k8s.io/controller-manager => k8s.io/controller-manager v0.28.6
k8s.io/cri-api => k8s.io/cri-api v0.28.6
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.28.6
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.28.6
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.28.6
k8s.io/kube-proxy => k8s.io/kube-proxy v0.28.6
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.28.6
k8s.io/kubectl => k8s.io/kubectl v0.28.6
k8s.io/kubelet => k8s.io/kubelet v0.28.6
k8s.io/kubernetes => k8s.io/kubernetes v1.28.6
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.28.6
k8s.io/metrics => k8s.io/metrics v0.28.6
k8s.io/mount-utils => k8s.io/mount-utils v0.28.6
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.28.6
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.28.6
launchpad.net/gocheck => github.com/go-check/check v0.0.0-20200227125254-8fa46927fb4f
)
Loading

0 comments on commit a24b588

Please sign in to comment.