diff --git a/go.mod b/go.mod index 1801fc961..08018bfa0 100644 --- a/go.mod +++ b/go.mod @@ -1,76 +1,81 @@ module github.com/rancher/terraform-provider-rancher2 -go 1.23.4 - -toolchain go1.23.6 +go 1.24.0 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.5.2 - github.com/rancher/rancher v0.0.0-20250227174106-7829dbe62d7f + github.com/rancher/norman v0.7.1 + github.com/rancher/rancher v0.0.0-20251022154639-6291f0239b7f github.com/rancher/rancher/pkg/apis v0.0.0 github.com/rancher/rancher/pkg/client v0.0.0 - github.com/stretchr/testify v1.10.0 - golang.org/x/crypto v0.33.0 - golang.org/x/sync v0.11.0 + github.com/stretchr/testify v1.11.1 + golang.org/x/crypto v0.43.0 + golang.org/x/sync v0.17.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.32.2 - k8s.io/apimachinery v0.32.2 - k8s.io/apiserver v0.32.2 + k8s.io/api v0.34.1 + k8s.io/apimachinery v0.34.1 + k8s.io/apiserver v0.34.1 k8s.io/client-go v12.0.0+incompatible ) require ( - cloud.google.com/go v0.112.2 // indirect - cloud.google.com/go/auth v0.14.1 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect - cloud.google.com/go/compute/metadata v0.6.0 // indirect - cloud.google.com/go/iam v1.1.6 // indirect - cloud.google.com/go/storage v1.39.1 // indirect + cel.dev/expr v0.24.0 // indirect + cloud.google.com/go v0.120.0 // indirect + cloud.google.com/go/auth v0.17.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect + cloud.google.com/go/compute/metadata v0.9.0 // indirect + cloud.google.com/go/iam v1.5.2 // indirect + cloud.google.com/go/monitoring v1.24.2 // indirect + cloud.google.com/go/storage v1.50.0 // indirect dario.cat/mergo v1.0.1 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/Masterminds/sprig/v3 v3.3.0 // 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.55.5 // indirect + github.com/aws/aws-sdk-go v1.55.8 // 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.3.0 // indirect + github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/go-restful/v3 v3.12.1 // indirect + github.com/emicklei/go-restful/v3 v3.12.2 // indirect + github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect + github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect github.com/evanphx/json-patch v5.9.11+incompatible // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/go-jose/go-jose/v4 v4.1.1 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // 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.4 // indirect - github.com/google/gnostic-models v0.6.9 // indirect - github.com/google/go-cmp v0.6.0 // indirect + github.com/google/gnostic-models v0.7.0 // indirect + github.com/google/go-cmp v0.7.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.9 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect - github.com/googleapis/gax-go/v2 v2.14.1 // indirect - github.com/gorilla/handlers v1.5.1 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect + github.com/googleapis/gax-go/v2 v2.15.0 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/mux v1.8.1 // indirect - github.com/gorilla/websocket v1.5.3 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // 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 @@ -90,11 +95,10 @@ require ( 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.5.0 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // 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.17.9 // indirect + github.com/klauspost/compress v1.18.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -107,109 +111,117 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/oklog/run v1.0.0 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/posener/complete v1.2.3 // indirect - github.com/prometheus/client_golang v1.20.5 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.55.0 // indirect - github.com/prometheus/procfs v0.15.1 // indirect - github.com/rancher/aks-operator v1.11.0-rc.4 // indirect - github.com/rancher/apiserver v0.5.2 // indirect + github.com/prometheus/client_golang v1.23.2 // indirect + github.com/prometheus/client_model v0.6.2 // indirect + github.com/prometheus/common v0.66.1 // indirect + github.com/prometheus/procfs v0.17.0 // indirect + github.com/rancher/aks-operator v1.13.0-rc.1 // indirect + github.com/rancher/ali-operator v0.0.3-0.20251001142421-ca64da576db5 // indirect + github.com/rancher/apiserver v0.7.6 // indirect github.com/rancher/channelserver v0.7.0 // indirect - github.com/rancher/eks-operator v1.11.0-rc.3 // indirect - github.com/rancher/fleet/pkg/apis v0.12.0-alpha.2 // indirect - github.com/rancher/gke-operator v1.11.0-rc.2 // indirect - github.com/rancher/lasso v0.2.1 // indirect - github.com/rancher/rke v1.8.0-rc.2 // indirect - github.com/rancher/wrangler/v3 v3.2.0-rc.3 // indirect + github.com/rancher/eks-operator v1.13.0-rc.1 // indirect + github.com/rancher/fleet/pkg/apis v0.14.0-beta.1 // indirect + github.com/rancher/gke-operator v1.13.0-rc.1 // indirect + github.com/rancher/lasso v0.2.5 // indirect + github.com/rancher/rke v1.8.0-rc.4 // indirect + github.com/rancher/wrangler/v3 v3.3.1 // indirect github.com/shopspring/decimal v1.4.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/cast v1.7.0 // indirect - github.com/spf13/cobra v1.8.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/afero v1.12.0 // indirect + github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/pflag v1.0.9 // indirect + github.com/spiffe/go-spiffe/v2 v2.5.0 // 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/x448/float16 v0.8.4 // 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 + github.com/zeebo/errs v1.4.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect - go.opentelemetry.io/otel v1.34.0 // indirect - go.opentelemetry.io/otel/metric v1.34.0 // indirect - go.opentelemetry.io/otel/trace v1.34.0 // indirect - golang.org/x/net v0.35.0 // indirect - golang.org/x/oauth2 v0.26.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/term v0.29.0 // indirect - golang.org/x/text v0.22.0 // indirect - golang.org/x/time v0.10.0 // indirect - google.golang.org/api v0.221.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250207221924-e9438ea467c6 // indirect - google.golang.org/grpc v1.70.0 // indirect - google.golang.org/protobuf v1.36.5 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect + go.opentelemetry.io/otel v1.38.0 // indirect + go.opentelemetry.io/otel/metric v1.38.0 // indirect + go.opentelemetry.io/otel/sdk v1.38.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect + go.opentelemetry.io/otel/trace v1.38.0 // indirect + go.yaml.in/yaml/v2 v2.4.2 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/net v0.46.0 // indirect + golang.org/x/oauth2 v0.32.0 // indirect + golang.org/x/sys v0.37.0 // indirect + golang.org/x/term v0.36.0 // indirect + golang.org/x/text v0.30.0 // indirect + golang.org/x/time v0.13.0 // indirect + google.golang.org/api v0.252.0 // indirect + google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797 // indirect + google.golang.org/grpc v1.75.1 // indirect + google.golang.org/protobuf v1.36.10 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.32.2 // indirect - k8s.io/component-base v0.32.2 // indirect + k8s.io/apiextensions-apiserver v0.34.1 // indirect + k8s.io/component-base v0.34.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect - k8s.io/kubernetes v1.32.2 // indirect - k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect - sigs.k8s.io/cluster-api v1.9.5 // indirect - sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.3 // indirect - sigs.k8s.io/yaml v1.4.0 // indirect + k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect + k8s.io/kubernetes v1.34.1 // indirect + k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect + sigs.k8s.io/cluster-api v1.10.6 // 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.0 // indirect + sigs.k8s.io/yaml v1.6.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-20250227174106-7829dbe62d7f - github.com/rancher/rancher/pkg/client => github.com/rancher/rancher/pkg/client v0.0.0-20250227174106-7829dbe62d7f + github.com/rancher/rancher/pkg/apis => github.com/rancher/rancher/pkg/apis v0.0.0-20251023101703-73e6898b0472 + github.com/rancher/rancher/pkg/client => github.com/rancher/rancher/pkg/client v0.0.0-20251023101703-73e6898b0472 github.com/spf13/afero => github.com/spf13/afero v1.2.2 go.qase.io/client => github.com/rancher/qase-go/client v0.0.0-20231114201952-65195ec001fa helm.sh/helm/v3 => github.com/rancher/helm/v3 v3.9.0-rancher1 - k8s.io/api => k8s.io/api v0.32.2 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.32.2 - k8s.io/apimachinery => k8s.io/apimachinery v0.32.2 - k8s.io/apiserver => k8s.io/apiserver v0.32.2 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.32.2 - k8s.io/client-go => k8s.io/client-go v0.32.2 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.32.2 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.32.2 - k8s.io/code-generator => k8s.io/code-generator v0.32.2 - k8s.io/component-base => k8s.io/component-base v0.32.2 - k8s.io/component-helpers => k8s.io/component-helpers v0.32.2 - k8s.io/controller-manager => k8s.io/controller-manager v0.32.2 - k8s.io/cri-api => k8s.io/cri-api v0.32.2 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.32.2 - k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.32.2 - k8s.io/endpointslice => k8s.io/endpointslice v0.32.2 - k8s.io/kms => k8s.io/kms v0.32.2 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.32.2 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.32.2 - k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.32.2 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.32.2 - k8s.io/kubectl => k8s.io/kubectl v0.32.2 - k8s.io/kubelet => k8s.io/kubelet v0.32.2 + k8s.io/api => k8s.io/api v0.34.1 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.34.1 + k8s.io/apimachinery => k8s.io/apimachinery v0.34.1 + k8s.io/apiserver => k8s.io/apiserver v0.34.1 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.34.1 + k8s.io/client-go => k8s.io/client-go v0.34.1 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.34.1 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.34.1 + k8s.io/code-generator => k8s.io/code-generator v0.34.1 + k8s.io/component-base => k8s.io/component-base v0.34.1 + k8s.io/component-helpers => k8s.io/component-helpers v0.34.1 + k8s.io/controller-manager => k8s.io/controller-manager v0.34.1 + k8s.io/cri-api => k8s.io/cri-api v0.34.1 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.34.1 + k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.34.1 + k8s.io/endpointslice => k8s.io/endpointslice v0.34.1 + k8s.io/kms => k8s.io/kms v0.34.1 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.34.1 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.34.1 + k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b + k8s.io/kube-proxy => k8s.io/kube-proxy v0.34.1 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.34.1 + k8s.io/kubectl => k8s.io/kubectl v0.34.1 + k8s.io/kubelet => k8s.io/kubelet v0.34.1 k8s.io/kubernetes => k8s.io/kubernetes v1.30.1 - k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.32.2 - k8s.io/metrics => k8s.io/metrics v0.32.2 - k8s.io/mount-utils => k8s.io/mount-utils v0.32.2 - k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.32.2 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.32.2 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.34.1 + k8s.io/metrics => k8s.io/metrics v0.34.1 + k8s.io/mount-utils => k8s.io/mount-utils v0.34.1 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.34.1 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.34.1 launchpad.net/gocheck => github.com/go-check/check v0.0.0-20200227125254-8fa46927fb4f ) diff --git a/go.sum b/go.sum index 16a9391de..79cd9b624 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= +cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -30,8 +32,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.112.2 h1:ZaGT6LiG7dBzi6zNOvVZwacaXlmf3lRqnC4DQzqyRQw= -cloud.google.com/go v0.112.2/go.mod h1:iEqjp//KquGIJV/m+Pk3xecgKNhV+ry+vVTsy4TbDms= +cloud.google.com/go v0.120.0 h1:wc6bgG9DHyKqF5/vQvX1CiZrtHnxJjBlKUyF9nP6meA= +cloud.google.com/go v0.120.0/go.mod h1:/beW32s8/pGRuj4IILWQNd4uuebeT4dkOhKmkfit64Q= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -46,10 +48,10 @@ cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjby cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= -cloud.google.com/go/auth v0.14.1 h1:AwoJbzUdxA/whv1qj3TLKwh3XX5sikny2fc40wUl+h0= -cloud.google.com/go/auth v0.14.1/go.mod h1:4JHUxlGXisL0AW8kXPtUF6ztuOksyfUQNFjfsOCXkPM= -cloud.google.com/go/auth/oauth2adapt v0.2.7 h1:/Lc7xODdqcEw8IrZ9SvwnlLX6j9FHQM74z6cBk9Rw6M= -cloud.google.com/go/auth/oauth2adapt v0.2.7/go.mod h1:NTbTTzfvPl1Y3V1nPpOgl2w6d/FjO7NNUQaWSox6ZMc= +cloud.google.com/go/auth v0.17.0 h1:74yCm7hCj2rUyyAocqnFzsAYXgJhrG26XCFimrc/Kz4= +cloud.google.com/go/auth v0.17.0/go.mod h1:6wv/t5/6rOPAX4fJiRjKkJCvswLwdet7G8+UGXt7nCQ= +cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= +cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= @@ -72,8 +74,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= -cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= +cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= +cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= @@ -111,18 +113,24 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= +cloud.google.com/go/iam v1.5.2 h1:qgFRAGEmd8z6dJ/qyEchAuL9jpswyODjA2lS+w234g8= +cloud.google.com/go/iam v1.5.2/go.mod h1:SE1vg0N81zQqLzQEwxL2WI6yhetBdbNQuTvIKCSkUHE= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/logging v1.13.0 h1:7j0HgAp0B94o1YRDqiqm26w4q1rDMH7XNRU34lJXHYc= +cloud.google.com/go/logging v1.13.0/go.mod h1:36CoKh6KA/M0PbhPKMq6/qety2DCAErbhXT62TuXALA= +cloud.google.com/go/longrunning v0.6.7 h1:IGtfDWHhQCgCjwQjV9iiLnUta9LBCo8R9QmAFsS/PrE= +cloud.google.com/go/longrunning v0.6.7/go.mod h1:EAFV3IZAKmM56TyiE6VAP3VoTzhZzySwI/YI1s/nRsY= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/monitoring v1.24.2 h1:5OTsoJ1dXYIiMiuL+sYscLc9BumrL3CarVLL7dd7lHM= +cloud.google.com/go/monitoring v1.24.2/go.mod h1:x7yzPWcgDRnPEv3sI+jJGBkwl5qINf+6qY4eq0I9B4U= cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= @@ -173,10 +181,12 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.39.1 h1:MvraqHKhogCOTXTlct/9C3K3+Uy2jBmFYb3/Sp6dVtY= -cloud.google.com/go/storage v1.39.1/go.mod h1:xK6xZmxZmo+fyP7+DEF6FhNc24/JAe95OLyOHCXFH1o= +cloud.google.com/go/storage v1.50.0 h1:3TbVkzTooBvnZsk7WaAQfOsNrdoM8QHusXA1cpk6QJs= +cloud.google.com/go/storage v1.50.0/go.mod h1:l7XeiD//vx5lfqE3RavfmU9yvk5Pp0Zhcv482poyafY= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4= +cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= @@ -191,13 +201,21 @@ dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0 h1:UQUsRi8WTzhZntp5313l+CHIAT95ojUI2lpP/ExlZa4= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.29.0/go.mod h1:Cz6ft6Dkn3Et6l2v2a9/RpN7epQ1GtDlO6lj8bEcOvw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0 h1:5IT7xOdq17MtcdtL/vtl6mGfzhaq4m4vpollPRmlsBQ= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0/go.mod h1:ZV4VOm0/eHR06JLrXWe09068dHpr3TRpY9Uo7T+anuA= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.50.0 h1:nNMpRpnkWDAaqcpxMJvxa/Ud98gjbYwayJY4/9bdjiU= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.50.0/go.mod h1:SZiPHWGOOk3bl8tkevxkoiwPgsIl6CwrWcbwjfHZpdM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0 h1:ig/FpDD2JofP/NExKQUbn7uOSZzJAQqogfqluZK4ed4= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0/go.mod h1:otE2jQekW/PqXk1Awf5lmfokJx4uwuqcj1ab5SpGeW0= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= -github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +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/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs= @@ -207,8 +225,8 @@ github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugX github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= -github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= +github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= @@ -234,8 +252,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.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= -github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ= +github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk= 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= @@ -256,8 +274,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= +github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -267,16 +285,17 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 h1:aQ3y1lwWyqYPiWZThqv1aFbZMiM9vblcSArJRf2Irls= +github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM= -github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= +github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= +github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= 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.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= -github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU= +github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= @@ -289,20 +308,27 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.13.4 h1:zEqyPVyku6IvWCFwux4x9RxkLOMUL+1vC9xUFv5l2/M= +github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA= +github.com/envoyproxy/go-control-plane/envoy v1.32.4 h1:jb83lalDRZSpPWW2Z7Mck/8kXZ5CQAFYVjQcdVIr83A= +github.com/envoyproxy/go-control-plane/envoy v1.32.4/go.mod h1:Gzjc5k8JcJswLjAx1Zm+wSYE20UrLtt7JZMWiWQXQEw= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.2.1 h1:DEo3O99U8j4hBFwbJfrz9VtgcDfUKS7KJ7spH3d86P8= +github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8= github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= -github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +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/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -311,18 +337,20 @@ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66D github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= +github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw= -github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= -github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-git/go-git/v5 v5.13.0 h1:vLn5wlGIh/X78El6r3Jr+30W16Blk0CTcxTYcYPWi5E= +github.com/go-git/go-git/v5 v5.13.0/go.mod h1:Wjo7/JyVKtQgUNdXYXIepzWfJQkUEIGvkvVkiXRR/zw= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-jose/go-jose/v4 v4.1.1 h1:JYhSgy4mXXzAdF3nUx3ygx347LRXJRrpgyU3adRmkAI= +github.com/go-jose/go-jose/v4 v4.1.1/go.mod h1:BdsZGqgdO3b6tTc6LSE56wcDbMMLuPsw5d4ZD5f94kA= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +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-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= @@ -379,8 +407,8 @@ github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= -github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= +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.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -396,23 +424,21 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/go-github/v29 v29.0.3 h1:IktKCTwU//aFHnpA+2SLIi7Oo9uhAzgsdZNbcAqhgdc= github.com/google/go-github/v29 v29.0.3/go.mod h1:CHKiKKPHJ0REzfwc14QMklvtHwCveD0PxlMjLlzAM5E= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= -github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= +github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -427,8 +453,8 @@ 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-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= -github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= @@ -440,8 +466,8 @@ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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= -github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= -github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= +github.com/googleapis/enterprise-certificate-proxy v0.3.6 h1:GW/XbdyBFQ8Qe+YAmFU9uHLo7OnF5tL52HFAgMmyrf4= +github.com/googleapis/enterprise-certificate-proxy v0.3.6/go.mod h1:MkHOF77EYAE7qfSuSS9PU6g4Nt4e11cnsDUowfwewLA= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -451,15 +477,15 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q= -github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA= +github.com/googleapis/gax-go/v2 v2.15.0 h1:SyjDc1mGgZU5LncH8gimWo9lW1DtIfPibOG81vgd/bo= +github.com/googleapis/gax-go/v2 v2.15.0/go.mod h1:zVVkkxAQHa1RQpg9z2AUCMnKhi0Qld9rcmyfL1OZhoc= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= -github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= @@ -528,8 +554,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= @@ -554,8 +578,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.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= 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.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -614,23 +638,26 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx 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 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= 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/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= 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/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU= -github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk= -github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= -github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= +github.com/onsi/ginkgo/v2 v2.26.0 h1:1J4Wut1IlYZNEAWIV3ALrT9NfiaGW2cDCJQSFQMs/gE= +github.com/onsi/ginkgo/v2 v2.26.0/go.mod h1:qhEywmzWTBUY88kfO0BRvX4py7scov9yR+Az2oavUzw= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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= @@ -638,46 +665,47 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= -github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= +github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= -github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rancher/aks-operator v1.11.0-rc.4 h1:pAN9Aq43GJriWKGWzE8MavtylPGDMzpP4Oaf76qdRts= -github.com/rancher/aks-operator v1.11.0-rc.4/go.mod h1:iipTP7sdC7XgmwMgTa+dkmzNFwabkrlAwbC0rIsbmH4= -github.com/rancher/apiserver v0.5.2 h1:K7b+7m8TOyGJGwYwq95O5tSkn/bb/k0PRBtcMqyReao= -github.com/rancher/apiserver v0.5.2/go.mod h1:Tc4+kkh5mO7M1sZYaqlunx4S/YVcz9AapvbScS3hQRg= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/common v0.66.1 h1:h5E0h5/Y8niHc5DlaLlWLArTQI7tMrsfQjHV+d9ZoGs= +github.com/prometheus/common v0.66.1/go.mod h1:gcaUsgf3KfRSwHY4dIMXLPV0K/Wg1oZ8+SbZk/HH/dA= +github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0= +github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw= +github.com/rancher/aks-operator v1.13.0-rc.1 h1:Vy83SjeSm9q7kI18+nkSOR0hyeydDj398KGTo3XEuS4= +github.com/rancher/aks-operator v1.13.0-rc.1/go.mod h1:xu0BJ01Ynzs4wLMDf2V5eaazEf1/kndX0AeqqsTFVfQ= +github.com/rancher/ali-operator v0.0.3-0.20251001142421-ca64da576db5 h1:phyZ6BUqR/XnZNAHfSpYyGxclxu/ZTLGCc3wpcTjcmM= +github.com/rancher/ali-operator v0.0.3-0.20251001142421-ca64da576db5/go.mod h1:aJNM8GVaKCO1jH70Ds4qH8lE5tZlzOxWFbyOFOBHu5k= +github.com/rancher/apiserver v0.7.6 h1:bLS+pxNfGv5Zq5exxMUZr9z5X8kXOOY27RGmVv2k2rM= +github.com/rancher/apiserver v0.7.6/go.mod h1:Wb+Z8ktNyIuqt9hw30geFBQFJQucWTqgu6trxxMtcyM= github.com/rancher/channelserver v0.7.0 h1:ZN5o8aD4mD31uhjEEW2e9yQXa3eOb+4Cp6DcWm7W/Lc= github.com/rancher/channelserver v0.7.0/go.mod h1:Mwd7hlMSu9X4FnZKj+0mA5ak8nTyJZtZsVX33G62Gzc= -github.com/rancher/eks-operator v1.11.0-rc.3 h1:IA9b/tUb2h8QuxUfkRd6zSiKgyXVee51VnEuXruKJak= -github.com/rancher/eks-operator v1.11.0-rc.3/go.mod h1:WOafIiTaGAG9H2sWuM47tWkXEoSQPq0FcBdefaLlYbM= -github.com/rancher/fleet/pkg/apis v0.12.0-alpha.2 h1:bHgFWuz2vy0uaBBmHbR6xYjJTLaeAuXDUrL8PiYXpxs= -github.com/rancher/fleet/pkg/apis v0.12.0-alpha.2/go.mod h1:kWdjnTs14K8pinSAFb3votOgoEUHhAZ0onLIw9Tv404= -github.com/rancher/gke-operator v1.11.0-rc.2 h1:6uohg1FzkM1qQ+wDEIjWqt74qyvy1rAvpLkfaV7Zt5s= -github.com/rancher/gke-operator v1.11.0-rc.2/go.mod h1:a6OTHbCb+J3TNqqOnXwQ7Ld3pYZ8MU9I5KQMotEjuvs= -github.com/rancher/lasso v0.2.1 h1:SZTqMVQn8cAOqvwGBd1/EYOIJ/MGN+UfJrOWvHd4jHU= -github.com/rancher/lasso v0.2.1/go.mod h1:KSV3jBXfdXqdCuMm2uC8kKB9q/wuDYb3h0eHZoRjShM= -github.com/rancher/norman v0.5.2 h1:rwUKZ0QeVKJEtznhRdNQUMJtKjSoLYbFuPQGXm6xTxw= -github.com/rancher/norman v0.5.2/go.mod h1:lDO9ylAYBwch9FiYyuuWlYd7+IxgRgh0ioDJBweC7t4= -github.com/rancher/rancher v0.0.0-20250227174106-7829dbe62d7f h1:QrrAOEW9yrzYkOLA44pVAN+bd2axsgT2shAQFVWZlnI= -github.com/rancher/rancher v0.0.0-20250227174106-7829dbe62d7f/go.mod h1:LzHsYyz5OmMp6m+DNaxqjxOhW5zgL/xlSmbEHUeTjCc= -github.com/rancher/rancher/pkg/apis v0.0.0-20250227174106-7829dbe62d7f h1:M7wGsM4hfTpYvIcIKA3r0aMwbvByWcHaU+IP19T93GU= -github.com/rancher/rancher/pkg/apis v0.0.0-20250227174106-7829dbe62d7f/go.mod h1:3QHwbdrEA5XWWJbEW8+byOzktsucQ5GRIWmf7+A59ZE= -github.com/rancher/rancher/pkg/client v0.0.0-20250227174106-7829dbe62d7f h1:iKq0sAReuiPLCeC+cVJBZ+R1EqyCs84Sn0We+j9HxyQ= -github.com/rancher/rancher/pkg/client v0.0.0-20250227174106-7829dbe62d7f/go.mod h1:8uj341n3iMsNlch0+T1nuvo3NYgZFd28AJjQYx78DeY= -github.com/rancher/rke v1.8.0-rc.2 h1:kW6Or5YFanUkz82p1u4up5PenLZrTuUZg8xCzLmjJUk= -github.com/rancher/rke v1.8.0-rc.2/go.mod h1:x9N1abruzDFMwTpqq2cnaDYpKCptlNoW8VraNWB6Pc4= -github.com/rancher/wrangler/v3 v3.2.0-rc.3 h1:MySHWLxLLrGrM2sq5YYp7Ol1kQqYt9lvIzjGR50UZ+c= -github.com/rancher/wrangler/v3 v3.2.0-rc.3/go.mod h1:0C5QyvSrQOff8gQQzpB/L/FF03EQycjR3unSJcKCHno= +github.com/rancher/eks-operator v1.13.0-rc.1 h1:IbimIq+TuC88RQ3KF1Ez882XFP2nDnihbeqVPXLvuLk= +github.com/rancher/eks-operator v1.13.0-rc.1/go.mod h1:tj6ioCe9v5J1HM0ZXR3/K5InoEjOfjCvSHMuXMj2x4M= +github.com/rancher/fleet/pkg/apis v0.14.0-beta.1 h1:UoWkP6tiVx6xbOU6lG0EQXf3caEyBAYd5c88FFBULSg= +github.com/rancher/fleet/pkg/apis v0.14.0-beta.1/go.mod h1:oc+QHbx4P9guY34dr6UbzCOgt17Q9eSZhlyOs7xSinY= +github.com/rancher/gke-operator v1.13.0-rc.1 h1:VViWerZyc9iMmWTxK5FapRmMnBp8cq3CgqjbM+bvyaQ= +github.com/rancher/gke-operator v1.13.0-rc.1/go.mod h1:xW0iUqGMqUTPLzC4i+UKeydh9N9zYdM0BqC+7wiDfec= +github.com/rancher/lasso v0.2.5 h1:K++lWDDdfeN98Ixc1kCfUq0/q6tLjoHN++Np6QntXw0= +github.com/rancher/lasso v0.2.5/go.mod h1:71rWfv+KkdSmSxZ9Ly5QYhxAu0nEUcaq9N2ByjcHqAM= +github.com/rancher/norman v0.7.1 h1:OfmYfN4YeJ4qosXTAbOTPgCrb5GE8W6wFWnDxWcuKCo= +github.com/rancher/norman v0.7.1/go.mod h1:vZ5qL+eKodJ7zOMQYdl6jwMrSFrqTKpA+KYSFEKew2M= +github.com/rancher/rancher v0.0.0-20251022154639-6291f0239b7f h1:TIVU0VhKFD4vRJV4Koae9QiDtvRoLpBQluKpMpN9Iiw= +github.com/rancher/rancher v0.0.0-20251022154639-6291f0239b7f/go.mod h1:jzUABuDzxEfOoepEMld0JiCypVY+GBAmRFjSSu/fd1g= +github.com/rancher/rancher/pkg/apis v0.0.0-20251023101703-73e6898b0472 h1:8iE2Bd0x5OkVq8jQCB0DvTYNEaBvhtLE50O2E7S5Tqs= +github.com/rancher/rancher/pkg/apis v0.0.0-20251023101703-73e6898b0472/go.mod h1:H+KsnFeYVNUyLBAl1kqyKTM8KjuV1TNWDrZ2HT9ou/4= +github.com/rancher/rancher/pkg/client v0.0.0-20251023101703-73e6898b0472 h1:Mubagflz1JmYvVMQMHcDdloB+qbpUoP25KjBamr/eIs= +github.com/rancher/rancher/pkg/client v0.0.0-20251023101703-73e6898b0472/go.mod h1:kN5U1qD97yp9EUzm6LeoPENApyZsMzQdYES1GTJJbJw= +github.com/rancher/rke v1.8.0-rc.4 h1:jowVyaF3LsJonC7vNsAwWf3MONHAtEFUD/j3UzNSE5U= +github.com/rancher/rke v1.8.0-rc.4/go.mod h1:x9N1abruzDFMwTpqq2cnaDYpKCptlNoW8VraNWB6Pc4= +github.com/rancher/wrangler/v3 v3.3.1 h1:YFqRfhxjuLNudUrvWrn+64wUPZ8pnn2KWbTsha75JLg= +github.com/rancher/wrangler/v3 v3.3.1/go.mod h1:0D4kZDaOUkP5W2Zfww/75tQwF9w7kaZgzpZG+4XQDAI= 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.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 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= @@ -690,35 +718,32 @@ github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+D github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= -github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= +github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= -github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= -github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= +github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spiffe/go-spiffe/v2 v2.5.0 h1:N2I01KCUkv1FAjZXJMwh95KK1ZIQLYbPfhaxw8WS0hE= +github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -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.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +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/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= @@ -753,6 +778,8 @@ github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY3 github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0= github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= +github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM= +github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -760,27 +787,37 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 h1:PS8wXpbyaDJQ2VDHHncMe9Vct0Zn1fEjpsjrLxGJoSc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0/go.mod h1:HDBUsEjOuRC0EzKZ1bSaRGZWUBAzo+MhAcUUORSr4D0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= -go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= -go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= -go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= -go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= -go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= -go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= -go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= -go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= -go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= -go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/contrib/detectors/gcp v1.36.0 h1:F7q2tNlCaHY9nMKHR6XH9/qkp8FktLnIcy6jJNyOCQw= +go.opentelemetry.io/contrib/detectors/gcp v1.36.0/go.mod h1:IbBN8uAIIx734PTonTPxAxnjc2pQTxWNkwfstZ+6H2k= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q= +go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= +go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= +go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= +go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= +go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= +go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= +go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= +go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= -go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= +go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= +go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= +go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= +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/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -792,8 +829,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= -golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= +golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= +golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -830,6 +867,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/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.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= +golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -881,8 +920,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= -golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4= +golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -908,8 +947,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE= -golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= +golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -924,8 +963,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -998,13 +1037,13 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= +golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q= +golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1015,13 +1054,13 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k= +golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4= -golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.13.0 h1:eUlYslOIt32DgYD6utsuUeHs4d7AsEYLuIAdg7FlYgI= +golang.org/x/time v0.13.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1077,8 +1116,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= -golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= +golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= +golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= 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= @@ -1087,8 +1126,8 @@ golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= -golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1138,8 +1177,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.221.0 h1:qzaJfLhDsbMeFee8zBRdt/Nc+xmOuafD/dbdgGfutOU= -google.golang.org/api v0.221.0/go.mod h1:7sOU2+TL4TxUTdbi0gWgAIg7tH5qBXxoyhtL+9x3biQ= +google.golang.org/api v0.252.0 h1:xfKJeAJaMwb8OC9fesr369rjciQ704AjU/psjkKURSI= +google.golang.org/api v0.252.0/go.mod h1:dnHOv81x5RAmumZ7BWLShB/u7JZNeyalImxHmtTHxqw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1249,12 +1288,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= -google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250207221924-e9438ea467c6 h1:2duwAxN2+k0xLNpjnHTXoMUgnv6VPSp5fiqTuwSxjmI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250207221924-e9438ea467c6/go.mod h1:8BS3B93F/U1juMFq9+EDk+qOT5CO1R9IzXxG3PTqiRk= +google.golang.org/genproto v0.0.0-20250603155806-513f23925822 h1:rHWScKit0gvAPuOnu87KpaYtjK5zBMLcULh7gxkCXu4= +google.golang.org/genproto v0.0.0-20250603155806-513f23925822/go.mod h1:HubltRL7rMh0LfnQPkMH4NPDFEWp0jw3vixw7jEM53s= +google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5 h1:BIRfGDEjiHRrk0QKZe3Xv2ieMhtgRGeLcZQ0mIVn4EY= +google.golang.org/genproto/googleapis/api v0.0.0-20250825161204-c5933d9347a5/go.mod h1:j3QtIyytwqGr1JUDtYXwtMXWPKsEa5LtzIFN1Wn5WvE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797 h1:CirRxTOwnRWVLKzDNrs0CXAaVozJoR4G9xvdRecrdpk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797/go.mod h1:HSkG/KdJWusxU1F6CNrwNDjBMgisKxGnc5dAZfT0mjQ= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1292,8 +1331,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ= -google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw= +google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI= +google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1310,8 +1349,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= -google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/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-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1343,34 +1382,36 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.32.2 h1:bZrMLEkgizC24G9eViHGOPbW+aRo9duEISRIJKfdJuw= -k8s.io/api v0.32.2/go.mod h1:hKlhk4x1sJyYnHENsrdCWw31FEmCijNGPJO5WzHiJ6Y= -k8s.io/apiextensions-apiserver v0.32.2 h1:2YMk285jWMk2188V2AERy5yDwBYrjgWYggscghPCvV4= -k8s.io/apiextensions-apiserver v0.32.2/go.mod h1:GPwf8sph7YlJT3H6aKUWtd0E+oyShk/YHWQHf/OOgCA= -k8s.io/apimachinery v0.32.2 h1:yoQBR9ZGkA6Rgmhbp/yuT9/g+4lxtsGYwW6dR6BDPLQ= -k8s.io/apimachinery v0.32.2/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/apiserver v0.32.2 h1:WzyxAu4mvLkQxwD9hGa4ZfExo3yZZaYzoYvvVDlM6vw= -k8s.io/apiserver v0.32.2/go.mod h1:PEwREHiHNU2oFdte7BjzA1ZyjWjuckORLIK/wLV5goM= -k8s.io/client-go v0.32.2 h1:4dYCD4Nz+9RApM2b/3BtVvBHw54QjMFUl1OLcJG5yOA= -k8s.io/client-go v0.32.2/go.mod h1:fpZ4oJXclZ3r2nDOv+Ux3XcJutfrwjKTCHz2H3sww94= -k8s.io/component-base v0.32.2 h1:1aUL5Vdmu7qNo4ZsE+569PV5zFatM9hl+lb3dEea2zU= -k8s.io/component-base v0.32.2/go.mod h1:PXJ61Vx9Lg+P5mS8TLd7bCIr+eMJRQTyXe8KvkrvJq0= +k8s.io/api v0.34.1 h1:jC+153630BMdlFukegoEL8E/yT7aLyQkIVuwhmwDgJM= +k8s.io/api v0.34.1/go.mod h1:SB80FxFtXn5/gwzCoN6QCtPD7Vbu5w2n1S0J5gFfTYk= +k8s.io/apiextensions-apiserver v0.34.1 h1:NNPBva8FNAPt1iSVwIE0FsdrVriRXMsaWFMqJbII2CI= +k8s.io/apiextensions-apiserver v0.34.1/go.mod h1:hP9Rld3zF5Ay2Of3BeEpLAToP+l4s5UlxiHfqRaRcMc= +k8s.io/apimachinery v0.34.1 h1:dTlxFls/eikpJxmAC7MVE8oOeP1zryV7iRyIjB0gky4= +k8s.io/apimachinery v0.34.1/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw= +k8s.io/apiserver v0.34.1 h1:U3JBGdgANK3dfFcyknWde1G6X1F4bg7PXuvlqt8lITA= +k8s.io/apiserver v0.34.1/go.mod h1:eOOc9nrVqlBI1AFCvVzsob0OxtPZUCPiUJL45JOTBG0= +k8s.io/client-go v0.34.1 h1:ZUPJKgXsnKwVwmKKdPfw4tB58+7/Ik3CrjOEhsiZ7mY= +k8s.io/client-go v0.34.1/go.mod h1:kA8v0FP+tk6sZA0yKLRG67LWjqufAoSHA2xVGKw9Of8= +k8s.io/component-base v0.34.1 h1:v7xFgG+ONhytZNFpIz5/kecwD+sUhVE6HU7qQUiRM4A= +k8s.io/component-base v0.34.1/go.mod h1:mknCpLlTSKHzAQJJnnHVKqjxR7gBeHRv0rPXA7gdtQ0= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= -k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= +k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOPolHyvO06MXG5TUIj2mNAA= +k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts= k8s.io/kubernetes v1.30.1 h1:XlqS6KslLEA5mQzLK2AJrhr4Z1m8oJfkhHiWJ5lue+I= k8s.io/kubernetes v1.30.1/go.mod h1:yPbIk3MhmhGigX62FLJm+CphNtjxqCvAIFQXup6RKS0= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= -k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck= +k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/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= -sigs.k8s.io/cluster-api v1.9.5 h1:68164Q201Y5ANVkhyrOZenoMbfL2SEBjVYZs/ihhSro= -sigs.k8s.io/cluster-api v1.9.5/go.mod h1:DyqyZ4jRvKGKewDRn1Q4OCHaVjsdTogymbO6mrgHEDI= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= -sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= -sigs.k8s.io/structured-merge-diff/v4 v4.4.3 h1:sCP7Vv3xx/CWIuTPVN38lUPx0uw0lcLfzaiDa8Ja01A= -sigs.k8s.io/structured-merge-diff/v4 v4.4.3/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= -sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= -sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sigs.k8s.io/cluster-api v1.10.6 h1:0bnLTpT47R8KIvGZ3tTGek0DwMIc8fZi6IxA3Mlqq4g= +sigs.k8s.io/cluster-api v1.10.6/go.mod h1:vymugs3Jm3gxHVMuVqdzgp6BVy/SEqQVyUg/UM7bnT4= +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.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco= +sigs.k8s.io/structured-merge-diff/v6 v6.3.0/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/rancher2/data_source_rancher2_cluster_template.go b/rancher2/data_source_rancher2_cluster_template.go deleted file mode 100644 index 9ec1bd4e2..000000000 --- a/rancher2/data_source_rancher2_cluster_template.go +++ /dev/null @@ -1,93 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func dataSourceRancher2ClusterTemplate() *schema.Resource { - return &schema.Resource{ - Read: dataSourceRancher2ClusterTemplateRead, - - Schema: map[string]*schema.Schema{ - "default_revision_id": { - Type: schema.TypeString, - Computed: true, - Description: "Default cluster template revision ID", - }, - "description": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Cluster template description", - }, - "members": { - Type: schema.TypeList, - Computed: true, - Description: "Cluster template members", - Elem: &schema.Resource{ - Schema: memberFields(), - }, - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Cluster template name", - }, - "template_revisions": { - Type: schema.TypeList, - Computed: true, - Description: "Cluster template revisions", - Elem: &schema.Resource{ - Schema: clusterTemplateRevisionFieldsData(), - }, - }, - "annotations": { - Type: schema.TypeMap, - Optional: true, - Computed: true, - }, - "labels": { - Type: schema.TypeMap, - Optional: true, - Computed: true, - }, - }, - } -} - -func dataSourceRancher2ClusterTemplateRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - name := d.Get("name").(string) - description := d.Get("description").(string) - - filters := map[string]interface{}{ - "name": name, - } - if len(description) > 0 { - filters["description"] = description - } - listOpts := NewListOpts(filters) - - clusterTemplates, err := client.ClusterTemplate.List(listOpts) - if err != nil { - return err - } - - count := len(clusterTemplates.Data) - if count <= 0 { - return fmt.Errorf("[ERROR] cluster template with name \"%s\" not found", name) - } - if count > 1 { - return fmt.Errorf("[ERROR] found %d cluster template with name \"%s\"", count, name) - } - - d.SetId(clusterTemplates.Data[0].ID) - - return resourceRancher2ClusterTemplateRead(d, meta) -} diff --git a/rancher2/data_source_rancher2_etcd_backup.go b/rancher2/data_source_rancher2_etcd_backup.go deleted file mode 100644 index 4bdf7a4a7..000000000 --- a/rancher2/data_source_rancher2_etcd_backup.go +++ /dev/null @@ -1,85 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func dataSourceRancher2EtcdBackup() *schema.Resource { - return &schema.Resource{ - Read: dataSourceRancher2EtcdBackupRead, - - Schema: map[string]*schema.Schema{ - "cluster_id": { - Type: schema.TypeString, - Required: true, - }, - "name": { - Type: schema.TypeString, - Required: true, - }, - "backup_config": { - Type: schema.TypeList, - MaxItems: 1, - Computed: true, - Elem: &schema.Resource{ - Schema: clusterRKEConfigServicesEtcdBackupConfigFields(), - }, - }, - "filename": { - Type: schema.TypeString, - Computed: true, - }, - "manual": { - Type: schema.TypeBool, - Computed: true, - }, - "namespace_id": { - Type: schema.TypeString, - Computed: true, - }, - "annotations": { - Type: schema.TypeMap, - Computed: true, - Description: descriptions["annotations"], - }, - "labels": { - Type: schema.TypeMap, - Computed: true, - Description: descriptions["labels"], - }, - }, - } -} - -func dataSourceRancher2EtcdBackupRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - clusterID := d.Get("cluster_id").(string) - name := d.Get("name").(string) - - filters := map[string]interface{}{ - "clusterId": clusterID, - "name": name, - } - listOpts := NewListOpts(filters) - - etcdBackups, err := client.EtcdBackup.List(listOpts) - if err != nil { - return err - } - - count := len(etcdBackups.Data) - if count <= 0 { - return fmt.Errorf("[ERROR] etcd backup with name \"%s\" on cluster ID \"%s\" not found", name, clusterID) - } - if count > 1 { - return fmt.Errorf("[ERROR] found %d etcd backup with name \"%s\" on cluster ID \"%s\"", count, name, clusterID) - } - - return flattenEtcdBackup(d, &etcdBackups.Data[0]) -} diff --git a/rancher2/data_source_rancher2_node_template.go b/rancher2/data_source_rancher2_node_template.go deleted file mode 100644 index d135ec188..000000000 --- a/rancher2/data_source_rancher2_node_template.go +++ /dev/null @@ -1,203 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func dataSourceRancher2NodeTemplate() *schema.Resource { - return &schema.Resource{ - Read: dataSourceRancher2NodeTemplateRead, - - Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "cloud_credential_id": { - Type: schema.TypeString, - Computed: true, - }, - "description": { - Type: schema.TypeString, - Computed: true, - }, - "driver": { - Type: schema.TypeString, - Computed: true, - }, - "engine_env": { - Type: schema.TypeMap, - Computed: true, - }, - "engine_insecure_registry": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "engine_install_url": { - Type: schema.TypeString, - Computed: true, - }, - "engine_label": { - Type: schema.TypeMap, - Computed: true, - }, - "engine_opt": { - Type: schema.TypeMap, - Computed: true, - }, - "engine_registry_mirror": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "engine_storage_driver": { - Type: schema.TypeString, - Computed: true, - }, - "node_taints": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: taintFields(), - }, - }, - "use_internal_ip_address": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "annotations": { - Type: schema.TypeMap, - Computed: true, - }, - "labels": { - Type: schema.TypeMap, - Computed: true, - }, - }, - } -} - -func dataSourceRancher2NodeTemplateRead(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - name := d.Get("name").(string) - - filters := map[string]interface{}{ - "name": name, - } - listOpts := NewListOpts(filters) - - nodeTemplates, err := client.NodeTemplate.List(listOpts) - if err != nil { - return err - } - - count := len(nodeTemplates.Data) - if count <= 0 { - return fmt.Errorf("[ERROR] node template with name \"%s\" not found", name) - } - if count > 1 { - return fmt.Errorf("[ERROR] found %d node template with name \"%s\" ", count, name) - } - - return flattenDataSourceNodeTemplate(d, &nodeTemplates.Data[0]) -} - -func flattenDataSourceNodeTemplate(d *schema.ResourceData, in *managementClient.NodeTemplate) error { - if in == nil { - return nil - } - - d.SetId(in.ID) - d.Set("name", in.Name) - d.Set("driver", in.Driver) - - if len(in.AuthCertificateAuthority) > 0 { - d.Set("auth_certificate_authority", in.AuthCertificateAuthority) - } - - if len(in.AuthKey) > 0 { - d.Set("auth_key", in.AuthKey) - } - - if len(in.CloudCredentialID) > 0 { - d.Set("cloud_credential_id", in.CloudCredentialID) - } - - if len(in.Description) > 0 { - d.Set("description", in.Description) - } - - if len(in.EngineEnv) > 0 { - err := d.Set("engine_env", toMapInterface(in.EngineEnv)) - if err != nil { - return err - } - } - - if len(in.EngineInsecureRegistry) > 0 { - err := d.Set("engine_insecure_registry", toArrayInterface(in.EngineInsecureRegistry)) - if err != nil { - return err - } - } - - if len(in.EngineInstallURL) > 0 { - d.Set("engine_install_url", in.EngineInstallURL) - } - - if len(in.EngineLabel) > 0 { - err := d.Set("engine_label", toMapInterface(in.EngineLabel)) - if err != nil { - return err - } - } - - if len(in.EngineOpt) > 0 { - err := d.Set("engine_opt", toMapInterface(in.EngineOpt)) - if err != nil { - return err - } - } - - if len(in.EngineRegistryMirror) > 0 { - err := d.Set("engine_registry_mirror", toArrayInterface(in.EngineRegistryMirror)) - if err != nil { - return err - } - } - - if len(in.EngineStorageDriver) > 0 { - d.Set("engine_storage_driver", in.EngineStorageDriver) - } - - d.Set("use_internal_ip_address", *in.UseInternalIPAddress) - - if len(in.Annotations) > 0 { - err := d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - } - - if len(in.Labels) > 0 { - err := d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - } - - return nil -} diff --git a/rancher2/import_rancher2_cluster_template.go b/rancher2/import_rancher2_cluster_template.go deleted file mode 100644 index 4f97c9e15..000000000 --- a/rancher2/import_rancher2_cluster_template.go +++ /dev/null @@ -1,14 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func resourceRancher2ClusterTemplateImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - err := resourceRancher2ClusterTemplateRead(d, meta) - if err != nil { - return []*schema.ResourceData{}, err - } - - return []*schema.ResourceData{d}, nil -} diff --git a/rancher2/import_rancher2_etcd_backup.go b/rancher2/import_rancher2_etcd_backup.go deleted file mode 100644 index aa2799205..000000000 --- a/rancher2/import_rancher2_etcd_backup.go +++ /dev/null @@ -1,23 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func resourceRancher2EtcdBackupImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return []*schema.ResourceData{}, err - } - clusterDriver, err := client.EtcdBackup.ByID(d.Id()) - if err != nil { - return []*schema.ResourceData{}, err - } - - err = flattenEtcdBackup(d, clusterDriver) - if err != nil { - return []*schema.ResourceData{}, err - } - - return []*schema.ResourceData{d}, nil -} diff --git a/rancher2/import_rancher2_node_template.go b/rancher2/import_rancher2_node_template.go deleted file mode 100644 index 891bd5745..000000000 --- a/rancher2/import_rancher2_node_template.go +++ /dev/null @@ -1,25 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2NodeTemplateImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return []*schema.ResourceData{}, err - } - nodeTemplate := &NodeTemplate{} - err = client.APIBaseClient.ByID(managementClient.NodeTemplateType, d.Id(), nodeTemplate) - if err != nil { - return []*schema.ResourceData{}, err - } - - err = flattenNodeTemplate(d, nodeTemplate) - if err != nil { - return []*schema.ResourceData{}, err - } - - return []*schema.ResourceData{d}, nil -} diff --git a/rancher2/provider.go b/rancher2/provider.go index 4979c056f..0aeacf646 100644 --- a/rancher2/provider.go +++ b/rancher2/provider.go @@ -127,10 +127,8 @@ func Provider() terraform.ResourceProvider { "rancher2_cluster_driver": resourceRancher2ClusterDriver(), "rancher2_cluster_role_template_binding": resourceRancher2ClusterRoleTemplateBinding(), "rancher2_cluster_sync": resourceRancher2ClusterSync(), - "rancher2_cluster_template": resourceRancher2ClusterTemplate(), "rancher2_config_map_v2": resourceRancher2ConfigMapV2(), "rancher2_custom_user_token": resourceRancher2CustomUserToken(), - "rancher2_etcd_backup": resourceRancher2EtcdBackup(), "rancher2_feature": resourceRancher2Feature(), "rancher2_global_role": resourceRancher2GlobalRole(), "rancher2_global_role_binding": resourceRancher2GlobalRoleBinding(), @@ -138,7 +136,6 @@ func Provider() terraform.ResourceProvider { "rancher2_namespace": resourceRancher2Namespace(), "rancher2_node_driver": resourceRancher2NodeDriver(), "rancher2_node_pool": resourceRancher2NodePool(), - "rancher2_node_template": resourceRancher2NodeTemplate(), "rancher2_pod_security_admission_configuration_template": resourceRancher2PodSecurityAdmissionConfigurationTemplate(), "rancher2_project": resourceRancher2Project(), "rancher2_project_role_template_binding": resourceRancher2ProjectRoleTemplateBinding(), @@ -160,15 +157,12 @@ func Provider() terraform.ResourceProvider { "rancher2_cluster_v2": dataSourceRancher2ClusterV2(), "rancher2_cluster_driver": dataSourceRancher2ClusterDriver(), "rancher2_cluster_role_template_binding": dataSourceRancher2ClusterRoleTemplateBinding(), - "rancher2_cluster_template": dataSourceRancher2ClusterTemplate(), "rancher2_config_map_v2": dataSourceRancher2ConfigMapV2(), - "rancher2_etcd_backup": dataSourceRancher2EtcdBackup(), "rancher2_global_role": dataSourceRancher2GlobalRole(), "rancher2_global_role_binding": dataSourceRancher2GlobalRoleBinding(), "rancher2_namespace": dataSourceRancher2Namespace(), "rancher2_node_driver": dataSourceRancher2NodeDriver(), "rancher2_node_pool": dataSourceRancher2NodePool(), - "rancher2_node_template": dataSourceRancher2NodeTemplate(), "rancher2_pod_security_admission_configuration_template": dataSourceRancher2PodSecurityAdmissionConfigurationTemplate(), "rancher2_principal": dataSourceRancher2Principal(), "rancher2_project": dataSourceRancher2Project(), diff --git a/rancher2/question_fields.go b/rancher2/question_fields.go new file mode 100644 index 000000000..19194397c --- /dev/null +++ b/rancher2/question_fields.go @@ -0,0 +1,108 @@ +package rancher2 + +import ( + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" +) + +const ( + questionTypeInt = "int" + questionTypeBool = "boolean" + questionTypeString = "string" + questionTypePassword = "password" +) + +var ( + questionTypeKinds = []string{questionTypeInt, questionTypeBool, questionTypeString, questionTypePassword} +) + +func getConflicts(fieldNames []string, fieldName string) []string { + conflicts := make([]string, 0, len(fieldNames)-1) + for _, name := range fieldNames { + if name != fieldName { + conflicts = append(conflicts, name) + } + } + return conflicts +} + +func questionFields() map[string]*schema.Schema { + s := map[string]*schema.Schema{ + "default": { + Type: schema.TypeString, + Required: true, + Description: "Default variable value", + }, + "required": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Required variable", + }, + "type": { + Type: schema.TypeString, + Optional: true, + Default: questionTypeString, + Description: "Variable type", + ValidateFunc: validation.StringInSlice(questionTypeKinds, true), + }, + "variable": { + Type: schema.TypeString, + Required: true, + Description: "Variable name", + }, + } + + return s +} + +func expandQuestions(p []interface{}) []managementClient.Question { + if len(p) == 0 || p[0] == nil { + return nil + } + + obj := make([]managementClient.Question, len(p)) + + for i := range p { + in := p[i].(map[string]interface{}) + + if v, ok := in["default"].(string); ok && len(v) > 0 { + obj[i].Default = v + } + + if v, ok := in["required"].(bool); ok { + obj[i].Required = v + } + + if v, ok := in["type"].(string); ok && len(v) > 0 { + obj[i].Type = v + } + + if v, ok := in["variable"].(string); ok && len(v) > 0 { + obj[i].Variable = v + } + } + + return obj +} + +func flattenQuestions(p []managementClient.Question) []interface{} { + if len(p) == 0 { + return []interface{}{} + } + + out := make([]interface{}, len(p)) + for i, in := range p { + obj := make(map[string]interface{}) + + obj["default"] = in.Default + obj["required"] = in.Required + obj["type"] = in.Type + obj["variable"] = in.Variable + + out[i] = obj + } + + return out +} diff --git a/rancher2/resource_rancher2_cloud_credential.go b/rancher2/resource_rancher2_cloud_credential.go index cce9ea281..03449c489 100644 --- a/rancher2/resource_rancher2_cloud_credential.go +++ b/rancher2/resource_rancher2_cloud_credential.go @@ -11,6 +11,16 @@ import ( managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" ) +const ( + amazonec2ConfigDriver = "amazonec2" + azureConfigDriver = "azure" + digitaloceanConfigDriver = "digitalocean" + harvesterConfigDriver = "harvester" + linodeConfigDriver = "linode" + openstackConfigDriver = "openstack" + vmwarevsphereConfigDriver = "vmwarevsphere" +) + func resourceRancher2CloudCredential() *schema.Resource { return &schema.Resource{ Create: resourceRancher2CloudCredentialCreate, diff --git a/rancher2/resource_rancher2_cluster_template.go b/rancher2/resource_rancher2_cluster_template.go deleted file mode 100644 index e58f6e1c4..000000000 --- a/rancher2/resource_rancher2_cluster_template.go +++ /dev/null @@ -1,447 +0,0 @@ -package rancher2 - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - - "github.com/hashicorp/terraform-plugin-sdk/helper/customdiff" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2ClusterTemplate() *schema.Resource { - return &schema.Resource{ - Create: resourceRancher2ClusterTemplateCreate, - Read: resourceRancher2ClusterTemplateRead, - Update: resourceRancher2ClusterTemplateUpdate, - Delete: resourceRancher2ClusterTemplateDelete, - Importer: &schema.ResourceImporter{ - State: resourceRancher2ClusterTemplateImport, - }, - Schema: clusterTemplateFields(), - SchemaVersion: 1, - StateUpgraders: []schema.StateUpgrader{ - { - Type: resourceRancher2ClusterTemplateResourceV0().CoreConfigSchema().ImpliedType(), - Upgrade: resourceRancher2ClusterTemplateStateUpgradeV0, - Version: 0, - }, - }, - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - CustomizeDiff: customdiff.Sequence( - customdiff.IfValueChange("template_revisions", - func(old, new, meta interface{}) bool { - return true - }, - func(d *schema.ResourceDiff, meta interface{}) error { - if !d.HasChange("template_revisions") { - return nil - } - old, new := d.GetChange("template_revisions") - oldInput := old.([]interface{}) - oldInputLen := len(oldInput) - newInput := new.([]interface{}) - newInputLen := len(newInput) - // Indexing old and new inout by ID - oldInputIndexName := map[string]int{} - for i := range oldInput { - if row, ok := oldInput[i].(map[string]interface{}); ok { - if v, ok := row["name"].(string); ok { - oldInputIndexName[v] = i - } - } - } - // Sorting new input - sortedNewInput := make([]interface{}, len(newInput)) - newRows := []interface{}{} - lastIndex := 0 - for i := range newInput { - if row, ok := newInput[i].(map[string]interface{}); ok { - if name, ok := row["name"].(string); ok { - if v, ok := oldInputIndexName[name]; ok { - if oldRow, ok := oldInput[v].(map[string]interface{}); ok { - oldRow["default"] = row["default"] - row = oldRow - } - if v > i && oldInputLen > newInputLen { - v = v - (v - i) - } - sortedNewInput[v] = row - lastIndex++ - continue - } - } - row["id"] = "" - newRows = append(newRows, row) - } - } - for i := range newRows { - sortedNewInput[lastIndex+i] = newRows[i] - } - return d.SetNew("template_revisions", sortedNewInput) - }), - customdiff.ValidateValue("template_revisions", func(val, meta interface{}) error { - hasDefault := false - names := map[string]int{} - input := val.([]interface{}) - for i := range input { - if obj, ok := input[i].(map[string]interface{}); ok { - if v, ok := obj["default"].(bool); ok && v { - if hasDefault { - return fmt.Errorf("[ERROR] Validating cluster template revisions: more than one default defined") - } - hasDefault = true - } - if v, ok := obj["name"].(string); ok && len(v) > 0 { - names[v]++ - if names[v] > 1 { - return fmt.Errorf("[ERROR] Validating cluster template revisions: name \"%s\" is repeated", v) - } - } - } - } - if !hasDefault { - return fmt.Errorf("[ERROR] Validating cluster template revisions: NO default defined") - } - return nil - }), - ), - } -} - -func resourceRancher2ClusterTemplateResourceV0() *schema.Resource { - return &schema.Resource{ - Schema: clusterTemplateFieldsV0(), - } -} - -func resourceRancher2ClusterTemplateStateUpgradeV0(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { - if tmplRevisions, ok := rawState["template_revisions"].([]interface{}); ok && len(tmplRevisions) > 0 { - for i1 := range tmplRevisions { - if tmplRevision, ok := tmplRevisions[i1].(map[string]interface{}); ok && len(tmplRevision) > 0 { - if clusterConfigs, ok := tmplRevision["cluster_config"].([]interface{}); ok && len(clusterConfigs) > 0 { - for i2 := range clusterConfigs { - if clusterConfig, ok := clusterConfigs[i2].(map[string]interface{}); ok && len(clusterConfig) > 0 { - newValue, err := resourceRancher2ClusterStateUpgradeV0(clusterConfig, meta) - if err != nil { - return nil, fmt.Errorf("Upgrading Cluster Template schema V0: %v", err) - } - rawState["template_revisions"].([]interface{})[i1].(map[string]interface{})["cluster_config"].([]interface{})[i2] = newValue - } - } - } - } - } - } - return rawState, nil -} - -func resourceRancher2ClusterTemplateCreate(d *schema.ResourceData, meta interface{}) error { - ctrIndex, clusterTemplate, clusterTemplateRevisions, err := expandClusterTemplate(d) - if err != nil { - return err - } - - log.Printf("[INFO] Creating Cluster Template %s", clusterTemplate.Name) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - newClusterTemplate, err := client.ClusterTemplate.Create(clusterTemplate) - if err != nil { - return resource.NonRetryableError(err) - } - - newClusterTemplateRevisions, err := clusterTemplateRevisionsCreate(client, newClusterTemplate.ID, clusterTemplateRevisions) - if err != nil { - return resource.NonRetryableError(err) - } - - d.SetId(newClusterTemplate.ID) - - // Update defaultRevisionId if needed - if len(newClusterTemplateRevisions) > 0 { - update := map[string]interface{}{ - "defaultRevisionId": newClusterTemplateRevisions[ctrIndex].ID, - } - - if _, err = client.ClusterTemplate.Update(newClusterTemplate, update); err != nil { - return resource.NonRetryableError(err) - } - } - - if err = resourceRancher2ClusterTemplateRead(d, meta); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2ClusterTemplateRead(d *schema.ResourceData, meta interface{}) error { - id := d.Id() - log.Printf("[INFO] Refreshing Cluster Template ID %s", id) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutRead), func() *resource.RetryError { - clusterTemplate, err := client.ClusterTemplate.ByID(id) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Cluster Template ID %s not found.", clusterTemplate.ID) - d.SetId("") - return nil - } - return resource.NonRetryableError(err) - } - - clusterTemplateRevisions, err := clusterTemplateRevisionsRead(client, id) - if err != nil { - return resource.NonRetryableError(err) - } - - if err = flattenClusterTemplate(d, clusterTemplate, clusterTemplateRevisions); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2ClusterTemplateUpdate(d *schema.ResourceData, meta interface{}) error { - id := d.Id() - log.Printf("[INFO] Updating Cluster Template ID %s", id) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - clusterTemplate, err := client.ClusterTemplate.ByID(id) - if err != nil { - return resource.NonRetryableError(err) - } - - clusterTemplateRevisions := make([]managementClient.ClusterTemplateRevision, 0) - if d.HasChange("template_revisions") { - defaultRevisionID, templateRevisions, err := clusterTemplateRevisionsUpdate(client, id, d) - if err != nil { - return resource.NonRetryableError(err) - } - clusterTemplateRevisions = templateRevisions - d.Set("default_revision_id", defaultRevisionID) - } - - update := map[string]interface{}{ - "defaultRevisionId": d.Get("default_revision_id").(string), - "description": d.Get("description").(string), - "members": expandMembers(d.Get("members").([]interface{})), - "name": d.Get("name").(string), - "annotations": toMapString(d.Get("annotations").(map[string]interface{})), - "labels": toMapString(d.Get("labels").(map[string]interface{})), - } - - newClusterTemplate, err := client.ClusterTemplate.Update(clusterTemplate, update) - if err != nil { - return resource.NonRetryableError(err) - } - - if len(clusterTemplateRevisions) > 0 { - err = flattenClusterTemplate(d, newClusterTemplate, clusterTemplateRevisions) - if err != nil { - return resource.NonRetryableError(err) - } - // Delete removed clusterTemplateRevisions - err = clusterTemplateRevisionsDelete(client, id, clusterTemplateRevisions) - if err != nil { - return resource.NonRetryableError(err) - } - } - - if err = resourceRancher2ClusterTemplateRead(d, meta); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2ClusterTemplateDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Deleting Cluster Template ID %s", d.Id()) - id := d.Id() - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { - clusterTemplate, err := client.ClusterTemplate.ByID(id) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Cluster Template ID %s not found.", d.Id()) - d.SetId("") - return nil - } - return resource.NonRetryableError(err) - } - - err = client.ClusterTemplate.Delete(clusterTemplate) - if err != nil { - return resource.NonRetryableError(fmt.Errorf("[ERROR] Error removing Cluster Template: %s", err)) - } - - d.SetId("") - return nil - }) -} - -func clusterTemplateRevisionsCreate(client *managementClient.Client, ctID string, ctrs []managementClient.ClusterTemplateRevision) ([]managementClient.ClusterTemplateRevision, error) { - if len(ctID) == 0 { - return nil, fmt.Errorf("[ERROR] Creating revision: cluster Template ID can't be empty") - } - - clusterTemplateRevisions := make([]managementClient.ClusterTemplateRevision, len(ctrs)) - - for i := range ctrs { - ctrs[i].ClusterTemplateID = ctID - clusterTemplateRevision, err := client.ClusterTemplateRevision.Create(&ctrs[i]) - if err != nil { - return nil, err - } - clusterTemplateRevisions[i] = *clusterTemplateRevision - } - - return clusterTemplateRevisions, nil -} - -func clusterTemplateRevisionsRead(client *managementClient.Client, ctID string) ([]managementClient.ClusterTemplateRevision, error) { - if len(ctID) == 0 { - return nil, fmt.Errorf("[ERROR] Reading revision: Cluster Template ID can't be empty") - } - filters := map[string]interface{}{} - filters["clusterTemplateId"] = ctID - - clusterTemplateRevisions, err := client.ClusterTemplateRevision.List(NewListOpts(filters)) - return clusterTemplateRevisions.Data, err -} - -func clusterTemplateRevisionsUpdate(client *managementClient.Client, ctID string, d *schema.ResourceData) (string, []managementClient.ClusterTemplateRevision, error) { - if len(ctID) == 0 { - return "", nil, fmt.Errorf("[ERROR] Updating revision: Cluster Template ID can't be empty") - } - - old, new := d.GetChange("template_revisions") - oldData, _ := old.([]interface{}) - data, _ := new.([]interface{}) - indexDefault, ctrs, err := expandClusterTemplateRevisions(data) - if err != nil { - return "", nil, err - } - clusterTemplateRevisions := make([]managementClient.ClusterTemplateRevision, len(data)) - oldDataIndexName := map[string]int{} - for i := range oldData { - if row, ok := oldData[i].(map[string]interface{}); ok { - if v, ok := row["name"].(string); ok { - oldDataIndexName[v] = i - } - } - } - dataIndexName := map[string]int{} - for i := range data { - if row, ok := data[i].(map[string]interface{}); ok { - if v, ok := row["name"].(string); ok { - dataIndexName[v] = i - } - } - } - for i := range data { - // Create new clusterTemplateRevisions - if len(ctrs[i].ID) == 0 { - ctrs[i].ClusterTemplateID = ctID - newCtr, err := client.ClusterTemplateRevision.Create(&ctrs[i]) - if err != nil { - return "", nil, err - } - clusterTemplateRevisions[i] = *newCtr - continue - } - // Update existing clusterTemplateRevisions if changed - oldIndex, oldOK := oldDataIndexName[ctrs[i].Name] - newIndex, newOK := dataIndexName[ctrs[i].Name] - if oldOK && newOK { - oldRow, oldOK := oldData[oldIndex].(map[string]interface{}) - in, oldOK := data[newIndex].(map[string]interface{}) - if oldOK && newOK { - oldRow["default"] = in["default"] - if !AreEqual(oldRow, in) { - clusterConfig, err := expandClusterSpecBase(in["cluster_config"].([]interface{})) - if err != nil { - return "", nil, err - } - enabled := in["enabled"].(bool) - update := map[string]interface{}{ - "clusterConfig": clusterConfig, - "enabled": &enabled, - "name": in["name"].(string), - "questions": expandQuestions(in["questions"].([]interface{})), - "annotations": toMapString(in["annotations"].(map[string]interface{})), - "labels": toMapString(in["labels"].(map[string]interface{})), - } - ctr, err := client.ClusterTemplateRevision.ByID(ctrs[i].ID) - if err != nil { - return "", nil, fmt.Errorf("Getting ClusterTemplateRevision %s: %v", ctrs[i].ID, err) - } - newCtr, err := client.ClusterTemplateRevision.Update(ctr, update) - if err != nil { - return "", nil, fmt.Errorf("Updating ClusterTemplateRevision %s: %v", ctr.ID, err) - } - clusterTemplateRevisions[i] = *newCtr - continue - } - } - } - clusterTemplateRevisions[i] = ctrs[i] - } - return clusterTemplateRevisions[indexDefault].ID, clusterTemplateRevisions, err -} - -func clusterTemplateRevisionsDelete(client *managementClient.Client, ctID string, ctrs []managementClient.ClusterTemplateRevision) error { - readClusterTemplateRevisions, err := clusterTemplateRevisionsRead(client, ctID) - if err != nil { - return err - } - - if len(readClusterTemplateRevisions) != len(ctrs) { - for _, readCtr := range readClusterTemplateRevisions { - found := false - for _, ctr := range ctrs { - if readCtr.ID == ctr.ID { - found = true - break - } - } - if !found { - err = client.ClusterTemplateRevision.Delete(&readCtr) - if err != nil { - return fmt.Errorf("Error removing Cluster Template Revision [%s]: %s", readCtr.ID, err) - } - } - } - } - - return nil -} diff --git a/rancher2/resource_rancher2_etcd_backup.go b/rancher2/resource_rancher2_etcd_backup.go deleted file mode 100644 index 87a6e86fe..000000000 --- a/rancher2/resource_rancher2_etcd_backup.go +++ /dev/null @@ -1,202 +0,0 @@ -package rancher2 - -import ( - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2EtcdBackup() *schema.Resource { - return &schema.Resource{ - Create: resourceRancher2EtcdBackupCreate, - Read: resourceRancher2EtcdBackupRead, - Update: resourceRancher2EtcdBackupUpdate, - Delete: resourceRancher2EtcdBackupDelete, - Importer: &schema.ResourceImporter{ - State: resourceRancher2EtcdBackupImport, - }, - - Schema: etcdBackupFields(), - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - } -} - -func resourceRancher2EtcdBackupCreate(d *schema.ResourceData, meta interface{}) error { - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - etcdBackup, err := expandEtcdBackup(d) - if err != nil { - return err - } - - log.Printf("[INFO] Creating Etcd Backup") - - err = meta.(*Config).ClusterExist(etcdBackup.ClusterID) - if err != nil { - return err - } - - newEtcdBackup, err := client.EtcdBackup.Create(etcdBackup) - if err != nil { - return err - } - - d.SetId(newEtcdBackup.ID) - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active", "activating"}, - Refresh: etcdBackupStateRefreshFunc(client, newEtcdBackup.ID), - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf("[ERROR] waiting for etcd backup (%s) to be created: %s", newEtcdBackup.ID, waitErr) - } - - return resourceRancher2EtcdBackupRead(d, meta) -} - -func resourceRancher2EtcdBackupRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Refreshing Etcd Backup ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutRead), func() *resource.RetryError { - etcdBackup, err := client.EtcdBackup.ByID(d.Id()) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Etcd Backup ID %s not found.", d.Id()) - d.SetId("") - return nil - } - return resource.NonRetryableError(err) - } - - if err = flattenEtcdBackup(d, etcdBackup); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2EtcdBackupUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating Etcd Backup ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - etcdBackup, err := client.EtcdBackup.ByID(d.Id()) - if err != nil { - return err - } - - backupConfig, err := expandClusterRKEConfigServicesEtcdBackupConfig(d.Get("backup_config").([]interface{})) - if err != nil { - return err - } - - update := map[string]interface{}{ - "backup_config": backupConfig, - "filename": d.Get("filename").(string), - "manual": d.Get("manual").(bool), - "annotations": toMapString(d.Get("annotations").(map[string]interface{})), - "labels": toMapString(d.Get("labels").(map[string]interface{})), - } - - newEtcdBackup, err := client.EtcdBackup.Update(etcdBackup, update) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"active", "activating"}, - Target: []string{"active", "activating"}, - Refresh: etcdBackupStateRefreshFunc(client, newEtcdBackup.ID), - Timeout: d.Timeout(schema.TimeoutUpdate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for etcd backup (%s) to be updated: %s", newEtcdBackup.ID, waitErr) - } - - return resourceRancher2EtcdBackupRead(d, meta) -} - -func resourceRancher2EtcdBackupDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Deleting Etcd Backup ID %s", d.Id()) - id := d.Id() - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - etcdBackup, err := client.EtcdBackup.ByID(id) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Etcd Backup ID %s not found.", id) - d.SetId("") - return nil - } - return err - } - - err = client.EtcdBackup.Delete(etcdBackup) - if err != nil { - return fmt.Errorf("Error removing Etcd Backup: %s", err) - } - - log.Printf("[DEBUG] Waiting for etcd backup (%s) to be removed", id) - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"removed"}, - Refresh: etcdBackupStateRefreshFunc(client, id), - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf("[ERROR] waiting for etcd backup (%s) to be removed: %s", id, waitErr) - } - - d.SetId("") - return nil -} - -// etcdBackupStateRefreshFunc returns a resource.StateRefreshFunc, used to watch a Rancher EtcdBackup. -func etcdBackupStateRefreshFunc(client *managementClient.Client, nodePoolID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - obj, err := client.EtcdBackup.ByID(nodePoolID) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - return obj, "removed", nil - } - return nil, "", err - } - - return obj, obj.State, nil - } -} diff --git a/rancher2/resource_rancher2_node_template.go b/rancher2/resource_rancher2_node_template.go deleted file mode 100644 index 628cd048d..000000000 --- a/rancher2/resource_rancher2_node_template.go +++ /dev/null @@ -1,256 +0,0 @@ -package rancher2 - -import ( - "context" - "fmt" - "log" - "time" - - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - norman "github.com/rancher/norman/types" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -func resourceRancher2NodeTemplate() *schema.Resource { - return &schema.Resource{ - Create: resourceRancher2NodeTemplateCreate, - Read: resourceRancher2NodeTemplateRead, - Update: resourceRancher2NodeTemplateUpdate, - Delete: resourceRancher2NodeTemplateDelete, - Importer: &schema.ResourceImporter{ - State: resourceRancher2NodeTemplateImport, - }, - - Schema: nodeTemplateFields(), - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(10 * time.Minute), - Update: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), - }, - } -} - -func resourceRancher2NodeTemplateCreate(d *schema.ResourceData, meta interface{}) error { - nodeTemplate := expandNodeTemplate(d) - - log.Printf("[INFO] Creating Node Template %s", nodeTemplate.Name) - - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - driverID := d.Get("driver_id").(string) - - err = meta.(*Config).activateNodeDriver(driverID, d.Timeout(schema.TimeoutCreate)) - if err != nil { - return err - } - - newNodeTemplate := &NodeTemplate{} - - err = client.APIBaseClient.Create(managementClient.NodeTemplateType, nodeTemplate, newNodeTemplate) - if err != nil { - return err - } - - d.SetId(newNodeTemplate.ID) - - stateConf := &resource.StateChangeConf{ - Pending: []string{}, - Target: []string{"active"}, - Refresh: nodeTemplateStateRefreshFunc(client, newNodeTemplate.ID), - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf("[ERROR] waiting for node template (%s) to be created: %s", newNodeTemplate.ID, waitErr) - } - - return resourceRancher2NodeTemplateRead(d, meta) -} - -func resourceRancher2NodeTemplateRead(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Refreshing Node Template ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - return resource.Retry(d.Timeout(schema.TimeoutRead), func() *resource.RetryError { - // Normalize node-template ID due to API change - d.SetId(meta.(*Config).fixNodeTemplateID(d.Id())) - - nodeTemplate := &NodeTemplate{} - - err = client.APIBaseClient.ByID(managementClient.NodeTemplateType, d.Id(), nodeTemplate) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Node template ID %s not found.", d.Id()) - d.SetId("") - return nil - } - return resource.NonRetryableError(err) - } - - if err = flattenNodeTemplate(d, nodeTemplate); err != nil { - return resource.NonRetryableError(err) - } - - return nil - }) -} - -func resourceRancher2NodeTemplateUpdate(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Updating Node Template ID %s", d.Id()) - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - nodeTemplate := &norman.Resource{} - err = client.APIBaseClient.ByID(managementClient.NodeTemplateType, d.Id(), nodeTemplate) - if err != nil { - return err - } - - useInternalIPAddress := d.Get("use_internal_ip_address").(bool) - update := map[string]interface{}{ - "name": d.Get("name").(string), - "authCertificateAuthority": d.Get("auth_certificate_authority").(string), - "authKey": d.Get("auth_key").(string), - "cloudCredentialId": d.Get("cloud_credential_id").(string), - "description": d.Get("description").(string), - "engineEnv": toMapString(d.Get("engine_env").(map[string]interface{})), - "engineInsecureRegistry": toArrayString(d.Get("engine_insecure_registry").([]interface{})), - "engineInstallURL": d.Get("engine_install_url").(string), - "engineLabel": toMapString(d.Get("engine_label").(map[string]interface{})), - "engineOpt": toMapString(d.Get("engine_opt").(map[string]interface{})), - "engineRegistryMirror": toArrayString(d.Get("engine_registry_mirror").([]interface{})), - "engineStorageDriver": d.Get("engine_storage_driver").(string), - "nodeTaints": expandTaints(d.Get("node_taints").([]interface{})), - "useInternalIpAddress": &useInternalIPAddress, - "annotations": toMapString(d.Get("annotations").(map[string]interface{})), - "labels": toMapString(d.Get("labels").(map[string]interface{})), - } - - switch driver := d.Get("driver").(string); driver { - case amazonec2ConfigDriver: - update["amazonec2Config"] = expandAmazonec2Config(d.Get("amazonec2_config").([]interface{})) - case azureConfigDriver: - update["azureConfig"] = expandAzureConfig(d.Get("azure_config").([]interface{})) - case digitaloceanConfigDriver: - update["digitaloceanConfig"] = expandDigitaloceanConfig(d.Get("digitalocean_config").([]interface{})) - case harvesterConfigDriver: - update["harvesterConfig"] = expandHarvestercloudConfig(d.Get("harvester_config").([]interface{})) - case hetznerConfigDriver: - update["hetznerConfig"] = expandHetznercloudConfig(d.Get("hetzner_config").([]interface{})) - case linodeConfigDriver: - update["linodeConfig"] = expandLinodeConfig(d.Get("linode_config").([]interface{})) - case openstackConfigDriver: - update["openstackConfig"] = expandOpenstackConfig(d.Get("openstack_config").([]interface{})) - case opennebulaConfigDriver: - update["opennebulaConfig"] = expandOpennebulaConfig(d.Get("opennebula_config").([]interface{})) - case vmwarevsphereConfigDriver: - update["vmwarevsphereConfig"] = expandVsphereConfig(d.Get("vsphere_config").([]interface{})) - case outscaleConfigDriver: - update["outscaleConfig"] = expandOutscaleConfig(d.Get("outscale_config").([]interface{})) - } - - newNodeTemplate := &NodeTemplate{} - err = client.APIBaseClient.Update(managementClient.NodeTemplateType, nodeTemplate, update, newNodeTemplate) - if err != nil { - return err - } - - stateConf := &resource.StateChangeConf{ - Pending: []string{"active"}, - Target: []string{"active"}, - Refresh: nodeTemplateStateRefreshFunc(client, newNodeTemplate.ID), - Timeout: d.Timeout(schema.TimeoutUpdate), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf( - "[ERROR] waiting for node template (%s) to be updated: %s", newNodeTemplate.ID, waitErr) - } - - return resourceRancher2NodeTemplateRead(d, meta) -} - -func resourceRancher2NodeTemplateDelete(d *schema.ResourceData, meta interface{}) error { - log.Printf("[INFO] Deleting Node Template ID %s", d.Id()) - id := d.Id() - client, err := meta.(*Config).ManagementClient() - if err != nil { - return err - } - - nodeTemplate := &norman.Resource{} - err = client.APIBaseClient.ByID(managementClient.NodeTemplateType, id, nodeTemplate) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - log.Printf("[INFO] Node Template ID %s not found.", id) - d.SetId("") - return nil - } - return err - } - - ctx, cancel := context.WithTimeout(context.Background(), meta.(*Config).Timeout) - defer cancel() - for { - err = client.APIBaseClient.Delete(nodeTemplate) - if err == nil { - break - } - if !IsNotAllowed(err) { - return fmt.Errorf("[ERROR] removing Node Template: %s", err) - } - select { - case <-time.After(rancher2RetriesWait * time.Second): - case <-ctx.Done(): - return fmt.Errorf("[ERROR] timeout removing Node Template: %s", err) - } - } - - log.Printf("[DEBUG] Waiting for node template (%s) to be removed", id) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"removing"}, - Target: []string{"removed"}, - Refresh: nodeTemplateStateRefreshFunc(client, id), - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 1 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, waitErr := stateConf.WaitForState() - if waitErr != nil { - return fmt.Errorf("[ERROR] waiting for node template (%s) to be removed: %s", id, waitErr) - } - - d.SetId("") - return nil -} - -// nodeTemplateStateRefreshFunc returns a resource.StateRefreshFunc, used to watch a Rancher NodeTemplate. -func nodeTemplateStateRefreshFunc(client *managementClient.Client, nodePoolID string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - obj := &NodeTemplate{} - err := client.APIBaseClient.ByID(managementClient.NodeTemplateType, nodePoolID, obj) - if err != nil { - if IsNotFound(err) || IsForbidden(err) { - return obj, "removed", nil - } - return nil, "", err - } - - return obj, obj.State, nil - } -} diff --git a/rancher2/resource_rancher2_user.go b/rancher2/resource_rancher2_user.go index 6cb5347bd..154ada696 100644 --- a/rancher2/resource_rancher2_user.go +++ b/rancher2/resource_rancher2_user.go @@ -191,6 +191,6 @@ func userStateRefreshFunc(client *managementClient.Client, userID string) resour } return nil, "", err } - return obj, obj.State, nil + return obj, "active", nil } } diff --git a/rancher2/schema_cluster_template.go b/rancher2/schema_cluster_template.go deleted file mode 100644 index 52f0dd6da..000000000 --- a/rancher2/schema_cluster_template.go +++ /dev/null @@ -1,506 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" -) - -const ( - questionTypeInt = "int" - questionTypeBool = "boolean" - questionTypeString = "string" - questionTypePassword = "password" -) - -var ( - questionTypeKinds = []string{questionTypeInt, questionTypeBool, questionTypeString, questionTypePassword} -) - -//Schemas - -func questionFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "default": { - Type: schema.TypeString, - Required: true, - Description: "Default variable value", - }, - "required": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Required variable", - }, - "type": { - Type: schema.TypeString, - Optional: true, - Default: questionTypeString, - Description: "Variable type", - ValidateFunc: validation.StringInSlice(questionTypeKinds, true), - }, - "variable": { - Type: schema.TypeString, - Required: true, - Description: "Variable name", - }, - } - - return s -} - -func clusterSpecBaseFieldsV0() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cluster_auth_endpoint": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Description: "Local cluster auth endpoint", - Elem: &schema.Resource{ - Schema: clusterAuthEndpoint(), - }, - }, - "default_cluster_role_for_project_members": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default cluster role for project members", - }, - "default_pod_security_admission_configuration_template_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default pod security admission configuration template name", - }, - "desired_agent_image": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Desired agent image", - }, - "desired_auth_image": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Desired auth image", - }, - "docker_root_dir": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Docker Root Dir", - }, - "enable_network_policy": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable project network isolation", - }, - "rke_config": { - Type: schema.TypeList, - MaxItems: 1, - Required: true, - Description: "Rancher Kubernetes Engine Config", - Elem: &schema.Resource{ - Schema: clusterRKEConfigFieldsV0(), - }, - }, - "windows_prefered_cluster": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Windows prefered cluster", - }, - } - - return s -} - -func clusterSpecBaseFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cluster_auth_endpoint": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Description: "Local cluster auth endpoint", - Elem: &schema.Resource{ - Schema: clusterAuthEndpoint(), - }, - }, - "default_cluster_role_for_project_members": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default cluster role for project members", - }, - "default_pod_security_admission_configuration_template_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default pod security admission configuration template name", - }, - "desired_agent_image": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Desired agent image", - }, - "desired_auth_image": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Desired auth image", - }, - "docker_root_dir": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Docker Root Dir", - }, - "enable_network_policy": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable project network isolation", - }, - "rke_config": { - Type: schema.TypeList, - MaxItems: 1, - Required: true, - Description: "Rancher Kubernetes Engine Config", - Elem: &schema.Resource{ - Schema: clusterRKEConfigFields(), - }, - }, - "windows_prefered_cluster": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Windows prefered cluster", - }, - } - - return s -} - -// Used by datasource -func clusterSpecBaseFieldsData() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cluster_auth_endpoint": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Description: "Local cluster auth endpoint", - Elem: &schema.Resource{ - Schema: clusterAuthEndpoint(), - }, - }, - "default_cluster_role_for_project_members": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default cluster role for project members", - }, - "default_pod_security_admission_configuration_template_name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Default pod security admission configuration template name", - }, - "desired_agent_image": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Desired agent image", - }, - "desired_auth_image": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Desired auth image", - }, - "docker_root_dir": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "Docker Root Dir", - }, - "enable_network_policy": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable project network isolation", - }, - "rke_config": { - Type: schema.TypeList, - MaxItems: 1, - Required: true, - Description: "Rancher Kubernetes Engine Config", - Elem: &schema.Resource{ - Schema: clusterRKEConfigFieldsData(), - }, - }, - "windows_prefered_cluster": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Windows prefered cluster", - }, - } - - return s -} - -func clusterTemplateRevisionFieldsV0() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cluster_config": { - Type: schema.TypeList, - MaxItems: 1, - Required: true, - Description: "Cluster configuration", - Elem: &schema.Resource{ - Schema: clusterSpecBaseFieldsV0(), - }, - }, - "cluster_template_id": { - Type: schema.TypeString, - Computed: true, - Description: "Cluster template ID", - }, - "default": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Default cluster template revision", - }, - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - Description: "Enable cluster template revision", - }, - "id": { - Type: schema.TypeString, - Computed: true, - Description: "Cluster template revision ID", - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Cluster template revision name", - }, - "questions": { - Type: schema.TypeList, - Optional: true, - Description: "Cluster template questions", - Elem: &schema.Resource{ - Schema: questionFields(), - }, - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} - -func clusterTemplateRevisionFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cluster_config": { - Type: schema.TypeList, - MaxItems: 1, - Required: true, - Description: "Cluster configuration", - Elem: &schema.Resource{ - Schema: clusterSpecBaseFields(), - }, - }, - "cluster_template_id": { - Type: schema.TypeString, - Computed: true, - Description: "Cluster template ID", - }, - "default": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Default cluster template revision", - }, - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - Description: "Enable cluster template revision", - }, - "id": { - Type: schema.TypeString, - Computed: true, - Description: "Cluster template revision ID", - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Cluster template revision name", - }, - "questions": { - Type: schema.TypeList, - Optional: true, - Description: "Cluster template questions", - Elem: &schema.Resource{ - Schema: questionFields(), - }, - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} - -// Used by datasource -func clusterTemplateRevisionFieldsData() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cluster_config": { - Type: schema.TypeList, - MaxItems: 1, - Required: true, - Description: "Cluster configuration", - Elem: &schema.Resource{ - Schema: clusterSpecBaseFieldsData(), - }, - }, - "cluster_template_id": { - Type: schema.TypeString, - Computed: true, - Description: "Cluster template ID", - }, - "default": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Default cluster template revision", - }, - "enabled": { - Type: schema.TypeBool, - Optional: true, - Default: true, - Description: "Enable cluster template revision", - }, - "id": { - Type: schema.TypeString, - Computed: true, - Description: "Cluster template revision ID", - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Cluster template revision name", - }, - "questions": { - Type: schema.TypeList, - Optional: true, - Description: "Cluster template questions", - Elem: &schema.Resource{ - Schema: questionFields(), - }, - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} - -func clusterTemplateFieldsV0() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "default_revision_id": { - Type: schema.TypeString, - Computed: true, - Description: "Default cluster template revision ID", - }, - "description": { - Type: schema.TypeString, - Optional: true, - Description: "Cluster template description", - }, - "members": { - Type: schema.TypeList, - Optional: true, - Description: "Cluster template members", - Elem: &schema.Resource{ - Schema: memberFields(), - }, - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Cluster template name", - }, - "template_revisions": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Description: "Cluster template revisions", - Elem: &schema.Resource{ - Schema: clusterTemplateRevisionFieldsV0(), - }, - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} - -func clusterTemplateFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "default_revision_id": { - Type: schema.TypeString, - Computed: true, - Description: "Default cluster template revision ID", - }, - "description": { - Type: schema.TypeString, - Optional: true, - Description: "Cluster template description", - }, - "members": { - Type: schema.TypeList, - Optional: true, - Description: "Cluster template members", - Elem: &schema.Resource{ - Schema: memberFields(), - }, - }, - "name": { - Type: schema.TypeString, - Required: true, - Description: "Cluster template name", - }, - "template_revisions": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Description: "Cluster template revisions", - Elem: &schema.Resource{ - Schema: clusterTemplateRevisionFields(), - }, - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} diff --git a/rancher2/schema_etcd_backup.go b/rancher2/schema_etcd_backup.go deleted file mode 100644 index 6aec7da20..000000000 --- a/rancher2/schema_etcd_backup.go +++ /dev/null @@ -1,54 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -//Schemas - -func etcdBackupFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "cluster_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "backup_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - Computed: true, - Elem: &schema.Resource{ - Schema: clusterRKEConfigServicesEtcdBackupConfigFields(), - }, - }, - "filename": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "manual": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "name": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "namespace_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} diff --git a/rancher2/schema_node_template.go b/rancher2/schema_node_template.go deleted file mode 100644 index fb5dc372b..000000000 --- a/rancher2/schema_node_template.go +++ /dev/null @@ -1,225 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -//Types - -type NodeTemplate struct { - managementClient.NodeTemplate - Amazonec2Config *amazonec2Config `json:"amazonec2Config,omitempty" yaml:"amazonec2Config,omitempty"` - AzureConfig *azureConfig `json:"azureConfig,omitempty" yaml:"azureConfig,omitempty"` - DigitaloceanConfig *digitaloceanConfig `json:"digitaloceanConfig,omitempty" yaml:"digitaloceanConfig,omitempty"` - HarvesterConfig *harvesterConfig `json:"harvesterConfig,omitempty" yaml:"harvesterConfig,omitempty"` - HetznerConfig *hetznerConfig `json:"hetznerConfig,omitempty" yaml:"hetznerConfig,omitempty"` - LinodeConfig *linodeConfig `json:"linodeConfig,omitempty" yaml:"linodeConfig,omitempty"` - OpennebulaConfig *opennebulaConfig `json:"opennebulaConfig,omitempty" yaml:"opennebulaConfig,omitempty"` - OpenstackConfig *openstackConfig `json:"openstackConfig,omitempty" yaml:"openstackConfig,omitempty"` - VmwarevsphereConfig *vmwarevsphereConfig `json:"vmwarevsphereConfig,omitempty" yaml:"vmwarevsphereConfig,omitempty"` - OutscaleConfig *outscaleConfig `json:"outscaleConfig,omitempty" yaml:"outscaleConfig,omitempty"` -} - -//Schemas - -var allNodeTemplateDriverConfigFields = []string{ - "amazonec2_config", - "azure_config", - "digitalocean_config", - "harvester_config", - "hetzner_config", - "linode_config", - "opennebula_config", - "openstack_config", - "vsphere_config", - "outscale_config"} - -func getConflicts(fieldNames []string, fieldName string) []string { - conflicts := make([]string, 0, len(fieldNames)-1) - for _, name := range fieldNames { - if name != fieldName { - conflicts = append(conflicts, name) - } - } - return conflicts -} - -func nodeTemplateFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - "amazonec2_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "amazonec2_config"), - Elem: &schema.Resource{ - Schema: amazonec2ConfigFields(), - }, - }, - "auth_certificate_authority": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - }, - "auth_key": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - }, - "azure_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "azure_config"), - Elem: &schema.Resource{ - Schema: azureConfigFields(), - }, - }, - "cloud_credential_id": { - Type: schema.TypeString, - Optional: true, - }, - "description": { - Type: schema.TypeString, - Optional: true, - }, - "digitalocean_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "digitalocean_config"), - Elem: &schema.Resource{ - Schema: digitaloceanConfigFields(), - }, - }, - "driver": { - Type: schema.TypeString, - Computed: true, - }, - "driver_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "engine_env": { - Type: schema.TypeMap, - Optional: true, - }, - "engine_insecure_registry": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "engine_install_url": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "engine_label": { - Type: schema.TypeMap, - Optional: true, - }, - "engine_opt": { - Type: schema.TypeMap, - Optional: true, - }, - "engine_registry_mirror": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "engine_storage_driver": { - Type: schema.TypeString, - Optional: true, - }, - "harvester_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "harvester_config"), - Elem: &schema.Resource{ - Schema: harvesterConfigFields(), - }, - }, - "hetzner_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "hetzner_config"), - Elem: &schema.Resource{ - Schema: hetznerConfigFields(), - }, - }, - "linode_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "linode_config"), - Elem: &schema.Resource{ - Schema: linodeConfigFields(), - }, - }, - "node_taints": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Resource{ - Schema: taintFields(), - }, - }, - "opennebula_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "opennebula_config"), - Elem: &schema.Resource{ - Schema: opennebulaConfigFields(), - }, - }, - "openstack_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "openstack_config"), - Elem: &schema.Resource{ - Schema: openstackConfigFields(), - }, - }, - "outscale_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "outscale_config"), - Elem: &schema.Resource{ - Schema: outscaleConfigFields(), - }, - }, - "use_internal_ip_address": { - Type: schema.TypeBool, - Optional: true, - Default: true, - }, - "vsphere_config": { - Type: schema.TypeList, - MaxItems: 1, - Optional: true, - ConflictsWith: getConflicts(allNodeTemplateDriverConfigFields, "vsphere_config"), - Elem: &schema.Resource{ - Schema: vsphereConfigFields(), - }, - }, - } - - for k, v := range commonAnnotationLabelFields() { - s[k] = v - } - - return s -} diff --git a/rancher2/schema_node_template_amazonec2.go b/rancher2/schema_node_template_amazonec2.go deleted file mode 100644 index 521492dbb..000000000 --- a/rancher2/schema_node_template_amazonec2.go +++ /dev/null @@ -1,252 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - amazonec2ConfigDriver = "amazonec2" -) - -//Types - -type amazonec2Config struct { - AccessKey string `json:"accessKey,omitempty" yaml:"accessKey,omitempty"` - Ami string `json:"ami,omitempty" yaml:"ami,omitempty"` - BlockDurationMinutes string `json:"blockDurationMinutes,omitempty" yaml:"blockDurationMinutes,omitempty"` - DeviceName string `json:"deviceName,omitempty" yaml:"deviceName,omitempty"` - EncryptEbsVolume bool `json:"encryptEbsVolume,omitempty" yaml:"encryptEbsVolume,omitempty"` - Endpoint string `json:"endpoint,omitempty" yaml:"endpoint,omitempty"` - HTTPEndpoint string `json:"httpEndpoint,omitempty" yaml:"httpEndpoint,omitempty"` - HTTPTokens string `json:"httpTokens,omitempty" yaml:"httpTokens,omitempty"` - IamInstanceProfile string `json:"iamInstanceProfile,omitempty" yaml:"iamInstanceProfile,omitempty"` - InsecureTransport bool `json:"insecureTransport,omitempty" yaml:"insecureTransport,omitempty"` - InstanceType string `json:"instanceType,omitempty" yaml:"instanceType,omitempty"` - KmsKey string `json:"kmsKey,omitempty" yaml:"kmsKey,omitempty"` - Monitoring bool `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` - OpenPort []string `json:"openPort,omitempty" yaml:"openPort,omitempty"` - PrivateAddressOnly bool `json:"privateAddressOnly,omitempty" yaml:"privateAddressOnly,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - RequestSpotInstance bool `json:"requestSpotInstance,omitempty" yaml:"requestSpotInstance,omitempty"` - Retries string `json:"retries,omitempty" yaml:"retries,omitempty"` - RootSize string `json:"rootSize,omitempty" yaml:"rootSize,omitempty"` - SecretKey string `json:"secretKey,omitempty" yaml:"secretKey,omitempty"` - SecurityGroup []string `json:"securityGroup,omitempty" yaml:"securityGroup,omitempty"` - SecurityGroupReadonly bool `json:"securityGroupReadonly,omitempty" yaml:"securityGroupReadonly,omitempty"` - SessionToken string `json:"sessionToken,omitempty" yaml:"sessionToken,omitempty"` - SpotPrice string `json:"spotPrice,omitempty" yaml:"spotPrice,omitempty"` - SSHKeypath string `json:"sshKeypath,omitempty" yaml:"sshKeypath,omitempty"` - SSHUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"` - SubnetID string `json:"subnetId,omitempty" yaml:"subnetId,omitempty"` - Tags string `json:"tags,omitempty" yaml:"tags,omitempty"` - UseEbsOptimizedInstance bool `json:"useEbsOptimizedInstance,omitempty" yaml:"useEbsOptimizedInstance,omitempty"` - UsePrivateAddress bool `json:"usePrivateAddress,omitempty" yaml:"usePrivateAddress,omitempty"` - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` - VolumeType string `json:"volumeType,omitempty" yaml:"volumeType,omitempty"` - VpcID string `json:"vpcId,omitempty" yaml:"vpcId,omitempty"` - Zone string `json:"zone,omitempty" yaml:"zone,omitempty"` -} - -//Schemas - -func amazonec2ConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "ami": { - Type: schema.TypeString, - Required: true, - Description: "AWS machine image", - }, - "region": { - Type: schema.TypeString, - Required: true, - Description: "AWS Region", - }, - "security_group": { - Type: schema.TypeList, - Required: true, - Description: "AWS VPC security group", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "subnet_id": { - Type: schema.TypeString, - Required: true, - Description: "AWS VPC subnet id", - }, - "vpc_id": { - Type: schema.TypeString, - Required: true, - Description: "AWS VPC id", - }, - "zone": { - Type: schema.TypeString, - Required: true, - Description: "AWS zone for instance (i.e. a,b,c,d,e)", - }, - "access_key": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "AWS Access Key", - }, - "block_duration_minutes": { - Type: schema.TypeString, - Optional: true, - Default: "0", - Description: "AWS spot instance duration in minutes (60, 120, 180, 240, 300, or 360)", - }, - "device_name": { - Type: schema.TypeString, - Optional: true, - Default: "/dev/sda1", - Description: "AWS root device name", - }, - "encrypt_ebs_volume": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Encrypt EBS volume", - }, - "endpoint": { - Type: schema.TypeString, - Optional: true, - Description: "Optional endpoint URL (hostname only or fully qualified URI)", - }, - "http_endpoint": { - Type: schema.TypeString, - Optional: true, - Description: "Enables or disables the HTTP metadata endpoint on your instances", - }, - "http_tokens": { - Type: schema.TypeString, - Optional: true, - Description: "The state of token usage for your instance metadata requests", - }, - "iam_instance_profile": { - Type: schema.TypeString, - Optional: true, - Description: "AWS IAM Instance Profile", - }, - "insecure_transport": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Disable SSL when sending requests", - }, - "instance_type": { - Type: schema.TypeString, - Optional: true, - Default: "t2.micro", - Description: "AWS instance type", - }, - "kms_key": { - Type: schema.TypeString, - Optional: true, - Description: "Custom KMS key ID using the AWS Managed CMK", - }, - "monitoring": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Set this flag to enable CloudWatch monitoring", - }, - "open_port": { - Type: schema.TypeList, - Optional: true, - Description: "Make the specified port number accessible from the Internet", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "private_address_only": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Only use a private IP address", - }, - "request_spot_instance": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Set this flag to request spot instance", - }, - "retries": { - Type: schema.TypeString, - Optional: true, - Default: "5", - Description: "Set retry count for recoverable failures (use -1 to disable)", - }, - "root_size": { - Type: schema.TypeString, - Optional: true, - Default: "16", - Description: "AWS root disk size (in GB)", - }, - "secret_key": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "AWS Secret Key", - }, - "security_group_readonly": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Skip adding default rules to security groups", - }, - "session_token": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "AWS Session Token", - }, - "spot_price": { - Type: schema.TypeString, - Optional: true, - Default: "0.50", - Description: "AWS spot instance bid price (in dollar)", - }, - "ssh_keypath": { - Type: schema.TypeString, - Optional: true, - Description: "SSH Key for Instance", - }, - "ssh_user": { - Type: schema.TypeString, - Optional: true, - Default: "ubuntu", - Description: "Set the name of the ssh user", - }, - "tags": { - Type: schema.TypeString, - Optional: true, - Description: "AWS Tags (e.g. key1,value1,key2,value2)", - }, - "use_ebs_optimized_instance": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Create an EBS optimized instance", - }, - "use_private_address": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Force the usage of private IP address", - }, - "userdata": { - Type: schema.TypeString, - Optional: true, - Description: "Path to file with cloud-init user data", - }, - "volume_type": { - Type: schema.TypeString, - Optional: true, - Default: "gp2", - Description: "Amazon EBS volume type", - }, - } - - return s -} diff --git a/rancher2/schema_node_template_azure.go b/rancher2/schema_node_template_azure.go deleted file mode 100644 index a5eb1cdbf..000000000 --- a/rancher2/schema_node_template_azure.go +++ /dev/null @@ -1,245 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - azureConfigDriver = "azure" -) - -//Types - -type azureConfig struct { - AvailabilitySet string `json:"availabilitySet,omitempty" yaml:"availabilitySet,omitempty"` - ClientID string `json:"clientId,omitempty" yaml:"clientId,omitempty"` - ClientSecret string `json:"clientSecret,omitempty" yaml:"clientSecret,omitempty"` - CustomData string `json:"customData,omitempty" yaml:"customData,omitempty"` - DiskSize string `json:"diskSize,omitempty" yaml:"diskSize,omitempty"` - DNS string `json:"dns,omitempty" yaml:"dns,omitempty"` - Environment string `json:"environment,omitempty" yaml:"environment,omitempty"` - FaultDomainCount string `json:"faultDomainCount,omitempty" yaml:"faultDomainCount,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - Location string `json:"location,omitempty" yaml:"location,omitempty"` - ManagedDisks bool `json:"managedDisks,omitempty" yaml:"managedDisks,omitempty"` - NoPublicIP bool `json:"noPublicIp,omitempty" yaml:"noPublicIp,omitempty"` - NSG string `json:"nsg,omitempty" yaml:"nsg,omitempty"` - Plan string `json:"plan,omitempty" yaml:"plan,omitempty"` - OpenPort []string `json:"openPort,omitempty" yaml:"openPort,omitempty"` - PrivateAddressOnly bool `json:"privateAddressOnly,omitempty" yaml:"privateAddressOnly,omitempty"` - PrivateIPAddress string `json:"privateIpAddress,omitempty" yaml:"privateIpAddress,omitempty"` - ResourceGroup string `json:"resourceGroup,omitempty" yaml:"resourceGroup,omitempty"` - Size string `json:"size,omitempty" yaml:"size,omitempty"` - SSHUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"` - StaticPublicIP bool `json:"staticPublicIp,omitempty" yaml:"staticPublicIp,omitempty"` - StorageType string `json:"storageType,omitempty" yaml:"storageType,omitempty"` - Subnet string `json:"subnet,omitempty" yaml:"subnet,omitempty"` - SubnetPrefix string `json:"subnetPrefix,omitempty" yaml:"subnetPrefix,omitempty"` - SubscriptionID string `json:"subscriptionId,omitempty" yaml:"subscriptionId,omitempty"` - UpdateDomainCount string `json:"updateDomainCount,omitempty" yaml:"updateDomainCount,omitempty"` - UsePrivateIP bool `json:"usePrivateIp,omitempty" yaml:"usePrivateIp,omitempty"` - Vnet string `json:"vnet,omitempty" yaml:"vnet,omitempty"` - Tags string `json:"tags,omitempty" yaml:"tags,omitempty"` - AcceleratedNetworking bool `json:"acceleratedNetworking,omitempty" yaml:"acceleratedNetworking,omitempty"` - AvailabilityZone string `json:"availabilityZone,omitempty" yaml:"availabilityZone,omitempty"` - UsePublicIPStandardSKU bool `json:"enablePublicIpStandardSku,omitempty" yaml:"enablePublicIpStandardSku,omitempty"` -} - -//Schemas - -func azureConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "availability_set": { - Type: schema.TypeString, - Optional: true, - Default: "docker-machine", - Description: "Azure Availability Set to place the virtual machine into", - }, - "client_id": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "Azure Service Principal Account ID (optional, browser auth is used if not specified)", - }, - "client_secret": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "Azure Service Principal Account password (optional, browser auth is used if not specified)", - }, - "custom_data": { - Type: schema.TypeString, - Optional: true, - Description: "Path to file with custom-data", - }, - "disk_size": { - Type: schema.TypeString, - Optional: true, - Default: "30", - Description: "Disk size if using managed disk", - }, - "dns": { - Type: schema.TypeString, - Optional: true, - Description: "A unique DNS label for the public IP adddress", - }, - "docker_port": { - Type: schema.TypeString, - Optional: true, - Default: "2376", - Description: "Port number for Docker engine", - }, - "environment": { - Type: schema.TypeString, - Optional: true, - Default: "AzurePublicCloud", - Description: "Azure environment (e.g. AzurePublicCloud, AzureChinaCloud)", - }, - "fault_domain_count": { - Type: schema.TypeString, - Optional: true, - Default: "3", - Description: "Fault domain count to use for availability set", - }, - "image": { - Type: schema.TypeString, - Optional: true, - Default: "canonical:ubuntu-24_04-lts:server-gen1:latest", - Description: "Azure virtual machine OS image", - }, - "location": { - Type: schema.TypeString, - Optional: true, - Default: "westus", - Description: "Azure region to create the virtual machine", - }, - "managed_disks": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Configures VM and availability set for managed disks", - }, - "no_public_ip": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Do not create a public IP address for the machine", - }, - "nsg": { - Type: schema.TypeString, - Optional: true, - Default: "docker-machine-nsg", - Description: "Azure Network Security Group to assign this node to (accepts either a name or resource ID, default is to create a new NSG for each machine)", - }, - "plan": { - Type: schema.TypeString, - Optional: true, - Description: "Purchase plan for Azure Virtual Machine (in :: format)", - }, - "open_port": { - Type: schema.TypeList, - Optional: true, - Description: "Make the specified port number accessible from the Internet", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "private_ip_address": { - Type: schema.TypeString, - Optional: true, - Description: "Specify a static private IP address for the machine", - }, - "resource_group": { - Type: schema.TypeString, - Optional: true, - Default: "docker-machine", - Description: "Azure Resource Group name (will be created if missing)", - }, - "size": { - Type: schema.TypeString, - Optional: true, - Default: "Standard_D2_v2", - Description: "Size for Azure Virtual Machine", - }, - "ssh_user": { - Type: schema.TypeString, - Optional: true, - Default: "docker-user", - Description: "Username for SSH login", - }, - "static_public_ip": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Assign a static public IP address to the machine", - }, - "storage_type": { - Type: schema.TypeString, - Optional: true, - Default: "Standard_LRS", - Description: "Type of Storage Account to host the OS Disk for the machine", - }, - "subnet": { - Type: schema.TypeString, - Optional: true, - Default: "docker-machine", - Description: "Azure Subnet Name to be used within the Virtual Network", - }, - "subnet_prefix": { - Type: schema.TypeString, - Optional: true, - Default: "192.168.0.0/16", - Description: "Private CIDR block to be used for the new subnet, should comply RFC 1918", - }, - "subscription_id": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "Azure Subscription ID", - }, - "update_domain_count": { - Type: schema.TypeString, - Optional: true, - Default: "5", - Description: "Update domain count to use for availability set", - }, - "use_private_ip": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Use private IP address of the machine to connect", - }, - "vnet": { - Type: schema.TypeString, - Optional: true, - Default: "docker-machine-vnet", - Description: "Azure Virtual Network name to connect the virtual machine (in [resourcegroup:]name format)", - }, - "tags": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: "Tags to be applied to the Azure VM instance (e.g. key1,value1,key2,value2)", - }, - "accelerated_networking": { - Type: schema.TypeBool, - Optional: true, - Default: "", - Description: "Enable Accelerated Networking when creating an Azure Network Interface", - }, - "availability_zone": { - Type: schema.TypeString, - Optional: true, - Default: "", - Description: "The Azure Availability Zone the VM should be created in", - }, - "use_public_ip_standard_sku": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Use the Standard SKU when creating a public IP for an Azure VM", - }, - } - - return s -} diff --git a/rancher2/schema_node_template_digitalocean.go b/rancher2/schema_node_template_digitalocean.go deleted file mode 100644 index dddaa6294..000000000 --- a/rancher2/schema_node_template_digitalocean.go +++ /dev/null @@ -1,119 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - digitaloceanConfigDriver = "digitalocean" -) - -//Types - -type digitaloceanConfig struct { - AccessToken string `json:"accessToken,omitempty" yaml:"accessToken,omitempty"` - Backups bool `json:"backups,omitempty" yaml:"backups,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - IPV6 bool `json:"ipv6,omitempty" yaml:"ipv6,omitempty"` - Monitoring bool `json:"monitoring,omitempty" yaml:"monitoring,omitempty"` - PrivateNetworking bool `json:"privateNetworking,omitempty" yaml:"privateNetworking,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - Size string `json:"size,omitempty" yaml:"size,omitempty"` - SSHKeyFingerprint string `json:"sshKeyFingerprint,omitempty" yaml:"sshKeyFingerprint,omitempty"` - SSHKeyPath string `json:"sshKeyPath,omitempty" yaml:"sshKeyPath,omitempty"` - SSHPort string `json:"sshPort,omitempty" yaml:"sshPort,omitempty"` - SSHUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"` - Tags string `json:"tags,omitempty" yaml:"tags,omitempty"` - Userdata string `json:"userdata,omitempty" yaml:"userdata,omitempty"` -} - -//Schemas - -func digitaloceanConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "access_token": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "Digital Ocean access token", - }, - "backups": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable backups for droplet", - }, - "image": { - Type: schema.TypeString, - Optional: true, - Default: "ubuntu-22-04-x64", - Description: "Digital Ocean Image", - }, - "ipv6": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable ipv6 for droplet", - }, - "monitoring": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable monitoring for droplet", - }, - "private_networking": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Enable private networking for droplet", - }, - "region": { - Type: schema.TypeString, - Optional: true, - Default: "nyc3", - Description: "Digital Ocean region", - }, - "size": { - Type: schema.TypeString, - Optional: true, - Default: "s-1vcpu-1gb", - Description: "Digital Ocean size", - }, - "ssh_key_fingerprint": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "SSH key fingerprint", - }, - "ssh_key_path": { - Type: schema.TypeString, - Optional: true, - Description: "SSH private key path", - }, - "ssh_port": { - Type: schema.TypeString, - Optional: true, - Default: "22", - Description: "SSH port", - }, - "ssh_user": { - Type: schema.TypeString, - Optional: true, - Default: "root", - Description: "SSH username", - }, - "tags": { - Type: schema.TypeString, - Optional: true, - Description: "Comma-separated list of tags to apply to the Droplet", - }, - "userdata": { - Type: schema.TypeString, - Optional: true, - Default: "docker-user", - Description: "Path to file with cloud-init user-data", - }, - } - - return s -} diff --git a/rancher2/schema_node_template_harvester.go b/rancher2/schema_node_template_harvester.go deleted file mode 100644 index 81d30366a..000000000 --- a/rancher2/schema_node_template_harvester.go +++ /dev/null @@ -1,163 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - harvesterConfigDriver = "harvester" - - harvesterDiskBusVIRTIO = "virtio" - harvesterDiskBusSCSI = "scsi" - harvesterDiskBusSATA = "sata" - - harvesterNetworkModelVIRTIO = "virtio" - harvesterNetworkModelE1000 = "e1000" - harvesterNetworkModelE1000E = "e1000e" - harvesterNetworkModelNE2KPCO = "ne2k_pco" - harvesterNetworkModelPCNET = "pcnet" - harvesterNetworkModelRTL8139 = "rtl8139" -) - -//Types - -type harvesterConfig struct { - VMNamespace string `json:"vmNamespace,omitempty" yaml:"vmNamespace,omitempty"` - VMAffinity string `json:"vmAffinity,omitempty" yaml:"vmAffinity,omitempty"` - CPUCount string `json:"cpuCount,omitempty" yaml:"cpuCount,omitempty"` - MemorySize string `json:"memorySize,omitempty" yaml:"memorySize,omitempty"` - DiskSize string `json:"diskSize,omitempty" yaml:"diskSize,omitempty"` - DiskBus string `json:"diskBus,omitempty" yaml:"diskBus,omitempty"` - ImageName string `json:"imageName,omitempty" yaml:"imageName,omitempty"` - DiskInfo string `json:"diskInfo,omitempty" yaml:"diskInfo,omitempty"` - SSHUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"` - SSHPassword string `json:"sshPassword,omitempty" yaml:"sshPassword,omitempty"` - NetworkName string `json:"networkName,omitempty" yaml:"networkName,omitempty"` - NetworkModel string `json:"networkModel,omitempty" yaml:"networkModel,omitempty"` - NetworkInfo string `json:"networkInfo,omitempty" yaml:"networkInfo,omitempty"` - UserData string `json:"userData,omitempty" yaml:"userData,omitempty"` - NetworkData string `json:"networkData,omitempty" yaml:"networkData,omitempty"` -} - -//Schemas - -func harvesterConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "vm_namespace": { - Type: schema.TypeString, - Required: true, - Description: "Virtual machine namespace", - }, - "vm_affinity": { - Type: schema.TypeString, - Optional: true, - Description: "VM affinity, base64 is supported", - }, - "cpu_count": { - Type: schema.TypeString, - Optional: true, - Default: "2", - Description: "CPU count", - }, - "memory_size": { - Type: schema.TypeString, - Optional: true, - Default: "4", - Description: "Memory size (in GiB)", - }, - "disk_size": { - Type: schema.TypeString, - Optional: true, - Default: "0", - ConflictsWith: []string{ - "harvester_config.0.disk_info", - }, - Description: "Disk size (in GiB)", - Deprecated: "Use disk_info instead", - }, - "disk_bus": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{ - "harvester_config.0.disk_info", - }, - Description: "Disk bus", - Deprecated: "Use disk_info instead", - }, - "image_name": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{ - "harvester_config.0.disk_info", - }, - Description: "Image name", - Deprecated: "Use disk_info instead", - }, - "disk_info": { - Type: schema.TypeString, - Optional: true, - AtLeastOneOf: []string{ - "harvester_config.0.image_name", - }, - ConflictsWith: []string{ - "harvester_config.0.disk_size", - "harvester_config.0.disk_bus", - "harvester_config.0.image_name", - }, - Description: "A JSON string specifying info for the disks e.g. `{\"disks\":[{\"imageName\":\"harvester-public/image-57hzg\",\"bootOrder\":1,\"size\":40},{\"storageClassName\":\"node-driver-test\",\"bootOrder\":2,\"size\":1}]}`", - }, - "ssh_user": { - Type: schema.TypeString, - Required: true, - Description: "SSH username", - }, - "ssh_password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "SSH password", - }, - "network_name": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{ - "harvester_config.0.network_info", - }, - Description: "Network name", - Deprecated: "Use network_info instead", - }, - "network_model": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{ - "harvester_config.0.network_info", - }, - Description: "Network model", - Deprecated: "Use network_info instead", - }, - "network_info": { - Type: schema.TypeString, - Optional: true, - AtLeastOneOf: []string{ - "harvester_config.0.network_name", - }, - ConflictsWith: []string{ - "harvester_config.0.network_name", - "harvester_config.0.network_model", - }, - Description: "A JSON string specifying info for the networks e.g. `{\"interfaces\":[{\"networkName\":\"harvester-public/vlan1\"},{\"networkName\":\"harvester-public/vlan2\"}]}`", - }, - "user_data": { - Type: schema.TypeString, - Optional: true, - Description: "UserData content of cloud-init, base64 is supported. If the image does not contain the qemu-guest-agent package, you must install and start qemu-guest-agent using userdata", - }, - "network_data": { - Type: schema.TypeString, - Optional: true, - Description: "NetworkData content of cloud-init, base64 is supported", - }, - } - - return s -} diff --git a/rancher2/schema_node_template_hetzner.go b/rancher2/schema_node_template_hetzner.go deleted file mode 100644 index f541100a6..000000000 --- a/rancher2/schema_node_template_hetzner.go +++ /dev/null @@ -1,82 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - hetznerConfigDriver = "hetzner" -) - -//Types - -type hetznerConfig struct { - APIToken string `json:"apiToken,omitempty" yaml:"apiToken,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - ServerLabels map[string]string `json:"serverLabels,omitempty" yaml:"serverLabels,omitempty"` - ServerLocation string `json:"serverLocation,omitempty" yaml:"serverLocation,omitempty"` - ServerType string `json:"serverType,omitempty" yaml:"serverType,omitempty"` - Networks []string `json:"networks,omitempty" yaml:"networks,omitempty"` - UsePrivateNetwork bool `json:"usePrivateNetwork,omitempty" yaml:"usePrivateNetwork,omitempty"` - UserData string `json:"userData,omitempty" yaml:"userData,omitempty"` - Volumes []string `json:"volumes,omitempty" yaml:"volumes,omitempty"` -} - -//Schemas - -func hetznerConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "api_token": { - Type: schema.TypeString, - Required: true, - Sensitive: true, - Description: "Hetzner Cloud project API token", - }, - "image": { - Type: schema.TypeString, - Optional: true, - Default: "ubuntu-18.04", - Description: "Hetzner Cloud server image", - }, - "server_labels": { - Type: schema.TypeMap, - Optional: true, - Description: "Map of the labels which will be assigned to the server", - }, - "server_location": { - Type: schema.TypeString, - Optional: true, - Default: "nbg1", - Description: "Hetzner Cloud datacenter", - }, - "server_type": { - Type: schema.TypeString, - Optional: true, - Default: "cx11", - Description: "Hetzner Cloud server type", - }, - "networks": { - Type: schema.TypeString, - Optional: true, - Description: "Comma-separated list of network IDs or names which should be attached to the server private network interface", - }, - "use_private_network": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Use private network", - }, - "userdata": { - Type: schema.TypeString, - Optional: true, - Description: "Path to file with cloud-init user-data", - }, - "volumes": { - Type: schema.TypeString, - Optional: true, - Description: "Comma-separated list of volume IDs or names which should be attached to the server", - }, - } - - return s -} diff --git a/rancher2/schema_node_template_linode.go b/rancher2/schema_node_template_linode.go deleted file mode 100644 index 286e6b60f..000000000 --- a/rancher2/schema_node_template_linode.go +++ /dev/null @@ -1,129 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - linodeConfigDriver = "linode" -) - -//Types - -type linodeConfig struct { - AuthorizedUsers string `json:"authorizedUsers,omitempty" yaml:"authorizedUsers,omitempty"` - CreatePrivateIP bool `json:"createPrivateIp,omitempty" yaml:"createPrivateIp,omitempty"` - DockerPort string `json:"dockerPort,omitempty" yaml:"dockerPort,omitempty"` - Image string `json:"image,omitempty" yaml:"image,omitempty"` - InstanceType string `json:"instanceType,omitempty" yaml:"instanceType,omitempty"` - Label string `json:"label,omitempty" yaml:"label,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - RootPass string `json:"rootPass,omitempty" yaml:"rootPass,omitempty"` - SSHPort string `json:"sshPort,omitempty" yaml:"sshPort,omitempty"` - SSHUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"` - StackScript string `json:"stackscript,omitempty" yaml:"stackscript,omitempty"` - StackscriptData string `json:"stackscriptData,omitempty" yaml:"stackscriptData,omitempty"` - SwapSize string `json:"swapSize,omitempty" yaml:"swapSize,omitempty"` - Tags string `json:"tags,omitempty" yaml:"tags,omitempty"` - Token string `json:"token,omitempty" yaml:"token,omitempty"` - UAPrefix string `json:"uaPrefix,omitempty" yaml:"uaPrefix,omitempty"` -} - -//Schemas - -func linodeConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "authorized_users": { - Type: schema.TypeString, - Optional: true, - Sensitive: false, - Description: "Linode user accounts (seperated by commas) whose Linode SSH keys will be permitted root access to the created node", - }, - "create_private_ip": { - Type: schema.TypeBool, - Optional: true, - Default: false, - Description: "Create private IP for the instance", - }, - "docker_port": { - Type: schema.TypeString, - Optional: true, - Default: "2376", - Description: "Docker Port", - }, - "image": { - Type: schema.TypeString, - Optional: true, - Default: "linode/ubuntu18.04", - Description: "Specifies the Linode Instance image which determines the OS distribution and base files", - }, - "instance_type": { - Type: schema.TypeString, - Optional: true, - Default: "g6-standard-4", - Description: "Specifies the Linode Instance type which determines CPU, memory, disk size, etc.", - }, - "label": { - Type: schema.TypeString, - Optional: true, - Description: "Linode Instance Label", - }, - "region": { - Type: schema.TypeString, - Optional: true, - Default: "us-east", - Description: "Specifies the region (location) of the Linode instance", - }, - "root_pass": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "Root Password", - }, - "ssh_port": { - Type: schema.TypeString, - Optional: true, - Default: "22", - Description: "Linode Instance SSH Port", - }, - "ssh_user": { - Type: schema.TypeString, - Optional: true, - Description: "Specifies the user as which docker-machine should log in to the Linode instance to install Docker.", - }, - "stackscript": { - Type: schema.TypeString, - Optional: true, - Description: "Specifies the Linode StackScript to use to create the instance", - }, - "stackscript_data": { - Type: schema.TypeString, - Optional: true, - Description: "A JSON string specifying data for the selected StackScript", - }, - "swap_size": { - Type: schema.TypeString, - Optional: true, - Default: "512", - Description: "Linode Instance Swap Size (MB)", - }, - "tags": { - Type: schema.TypeString, - Optional: true, - Description: "A comma separated list of tags to apply to the the Linode resource", - }, - "token": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "Linode API Token", - }, - "ua_prefix": { - Type: schema.TypeString, - Optional: true, - Description: "Prefix the User-Agent in Linode API calls with some 'product/version'", - }, - } - - return s -} diff --git a/rancher2/schema_node_template_opennebula.go b/rancher2/schema_node_template_opennebula.go deleted file mode 100644 index e1d072f47..000000000 --- a/rancher2/schema_node_template_opennebula.go +++ /dev/null @@ -1,119 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - opennebulaConfigDriver = "opennebula" -) - -//Types - -type opennebulaConfig struct { - B2dSize string `json:"b2dSize,omitempty" yaml:"b2dSize,omitempty"` - CPU string `json:"cpu,omitempty" yaml:"cpu,omitempty"` - DevPrefix string `json:"devPrefix,omitempty" yaml:"devPrefix,omitempty"` - DiskResize string `json:"diskResize,omitempty" yaml:"diskResize,omitempty"` - DisableVnc bool `json:"disableVnc,omitempty" yaml:"disableVnc,omitempty"` - ImageName string `json:"imageName,omitempty" yaml:"imageName,omitempty"` - ImageID string `json:"imageId,omitempty" yaml:"imageId,omitempty"` - ImageOwner string `json:"imageOwner,omitempty" yaml:"imageOwner,omitempty"` - Memory string `json:"memory,omitempty" yaml:"memory,omitempty"` - NetworkID string `json:"networkId,omitempty" yaml:"networkId,omitempty"` - NetworkName string `json:"networkName,omitempty" yaml:"networkName,omitempty"` - NetworkOwner string `json:"networkOwner,omitempty" yaml:"networkOwner,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - SSHUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"` - TemplateID string `json:"templateId,omitempty" yaml:"templateId,omitempty"` - TemplateName string `json:"templateName,omitempty" yaml:"templateName,omitempty"` - User string `json:"user,omitempty" yaml:"user,omitempty"` - Vcpu string `json:"vcpu,omitempty" yaml:"vcpu,omitempty"` - XMLRPCURL string `json:"xmlrpcurl,omitempty" yaml:"xmlrpcurl,omitempty"` -} - -//Schemas - -func opennebulaConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "password": { - Type: schema.TypeString, - Required: true, - Sensitive: true, - }, - "user": { - Type: schema.TypeString, - Required: true, - }, - "xml_rpc_url": { - Type: schema.TypeString, - Required: true, - }, - "b2d_size": { - Type: schema.TypeString, - Optional: true, - }, - "cpu": { - Type: schema.TypeString, - Optional: true, - }, - "dev_prefix": { - Type: schema.TypeString, - Optional: true, - }, - "disable_vnc": { - Type: schema.TypeBool, - Optional: true, - }, - "disk_resize": { - Type: schema.TypeString, - Optional: true, - }, - "image_id": { - Type: schema.TypeString, - Optional: true, - }, - "image_name": { - Type: schema.TypeString, - Optional: true, - }, - "image_owner": { - Type: schema.TypeString, - Optional: true, - }, - "memory": { - Type: schema.TypeString, - Optional: true, - }, - "network_name": { - Type: schema.TypeString, - Optional: true, - }, - "network_id": { - Type: schema.TypeString, - Optional: true, - }, - "network_owner": { - Type: schema.TypeString, - Optional: true, - }, - "template_id": { - Type: schema.TypeString, - Optional: true, - }, - "template_name": { - Type: schema.TypeString, - Optional: true, - }, - "ssh_user": { - Type: schema.TypeString, - Optional: true, - Default: "docker", - }, - "vcpu": { - Type: schema.TypeString, - Optional: true, - }, - } - return s -} diff --git a/rancher2/schema_node_template_openstack.go b/rancher2/schema_node_template_openstack.go deleted file mode 100644 index cf1b6a4d3..000000000 --- a/rancher2/schema_node_template_openstack.go +++ /dev/null @@ -1,223 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - openstackConfigDriver = "openstack" -) - -//Types - -type openstackConfig struct { - ActiveTimeout string `json:"activeTimeout,omitempty" yaml:"activeTimeout,omitempty"` - AuthURL string `json:"authUrl,omitempty" yaml:"authUrl,omitempty"` - AvailabilityZone string `json:"availabilityZone,omitempty" yaml:"availabilityZone,omitempty"` - CaCert string `json:"cacert,omitempty" yaml:"cacert,omitempty"` - ConfigDrive bool `json:"configDrive,omitempty" yaml:"configDrive,omitempty"` - DomainID string `json:"domainId,omitempty" yaml:"domainId,omitempty"` - DomainName string `json:"domainName,omitempty" yaml:"domainName,omitempty"` - EndpointType string `json:"endpointType,omitempty" yaml:"endpointType,omitempty"` - FlavorID string `json:"flavorId,omitempty" yaml:"flavorId,omitempty"` - FlavorName string `json:"flavorName,omitempty" yaml:"flavorName,omitempty"` - FloatingIPPool string `json:"floatingipPool,omitempty" yaml:"floatingipPool,omitempty"` - ImageID string `json:"imageId,omitempty" yaml:"imageId,omitempty"` - ImageName string `json:"imageName,omitempty" yaml:"imageName,omitempty"` - Insecure bool `json:"insecure,omitempty" yaml:"insecure,omitempty"` - IPVersion string `json:"ipVersion,omitempty" yaml:"ipVersion,omitempty"` - KeypairName string `json:"keypairName,omitempty" yaml:"keypairName,omitempty"` - NetID string `json:"netId,omitempty" yaml:"netId,omitempty"` - NetName string `json:"netName,omitempty" yaml:"netName,omitempty"` - NovaNetwork bool `json:"novaNetwork,omitempty" yaml:"novaNetwork,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - PrivateKeyFile string `json:"privateKeyFile,omitempty" yaml:"privateKeyFile,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - SecGroups string `json:"secGroups,omitempty" yaml:"secGroups,omitempty"` - SSHPort string `json:"sshPort,omitempty" yaml:"sshPort,omitempty"` - SSHUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"` - TenantID string `json:"tenantId,omitempty" yaml:"tenantId,omitempty"` - TenantName string `json:"tenantName,omitempty" yaml:"tenantName,omitempty"` - UserDataFile string `json:"userDataFile,omitempty" yaml:"userDataFile,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` - ApplicationCredentialID string `json:"applicationCredentialId,omitempty" yaml:"applicationCredentialId,omitempty"` - ApplicationCredentialName string `json:"applicationCredentialName,omitempty" yaml:"applicationCredentialName,omitempty"` - ApplicationCredentialSecret string `json:"applicationCredentialSecret,omitempty" yaml:"applicationCredentialSecret,omitempty"` - BootFromVolume bool `json:"bootFromVolume,omitempty" yaml:"bootFromVolume,omitempty"` - VolumeType string `json:"volumeType,omitempty" yaml:"volumeType,omitempty"` - VolumeSize string `json:"volumeSize,omitempty" yaml:"volumeSize,omitempty"` - VolumeID string `json:"volumeId,omitempty" yaml:"volumeId,omitempty"` - VolumeName string `json:"volumeName,omitempty" yaml:"volumeName,omitempty"` - VolumeDevicePath string `json:"volumeDevicePath,omitempty" yaml:"volumeDevicePath,omitempty"` -} - -//Schemas - -func openstackConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "auth_url": { - Type: schema.TypeString, - Required: true, - }, - "availability_zone": { - Type: schema.TypeString, - Required: true, - }, - "region": { - Type: schema.TypeString, - Required: true, - }, - "username": { - Type: schema.TypeString, - Optional: true, - }, - "active_timeout": { - Type: schema.TypeString, - Optional: true, - Default: "200", - }, - "cacert": { - Type: schema.TypeString, - Optional: true, - }, - "config_drive": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "domain_id": { - Type: schema.TypeString, - Optional: true, - }, - "domain_name": { - Type: schema.TypeString, - Optional: true, - }, - "endpoint_type": { - Type: schema.TypeString, - Optional: true, - }, - "flavor_id": { - Type: schema.TypeString, - Optional: true, - }, - "flavor_name": { - Type: schema.TypeString, - Optional: true, - }, - "floating_ip_pool": { - Type: schema.TypeString, - Optional: true, - }, - "image_id": { - Type: schema.TypeString, - Optional: true, - }, - "image_name": { - Type: schema.TypeString, - Optional: true, - }, - "insecure": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "ip_version": { - Type: schema.TypeString, - Optional: true, - Default: "4", - }, - "keypair_name": { - Type: schema.TypeString, - Optional: true, - }, - "net_id": { - Type: schema.TypeString, - Optional: true, - }, - "net_name": { - Type: schema.TypeString, - Optional: true, - }, - "nova_network": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - }, - "private_key_file": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - }, - "sec_groups": { - Type: schema.TypeString, - Optional: true, - }, - "ssh_port": { - Type: schema.TypeString, - Optional: true, - Default: "22", - }, - "ssh_user": { - Type: schema.TypeString, - Optional: true, - Default: "root", - }, - "tenant_id": { - Type: schema.TypeString, - Optional: true, - }, - "tenant_name": { - Type: schema.TypeString, - Optional: true, - }, - "user_data_file": { - Type: schema.TypeString, - Optional: true, - }, - "application_credential_id": { - Type: schema.TypeString, - Optional: true, - }, - "application_credential_name": { - Type: schema.TypeString, - Optional: true, - }, - "application_credential_secret": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - }, - "boot_from_volume": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - "volume_size": { - Type: schema.TypeString, - Optional: true, - }, - "volume_type": { - Type: schema.TypeString, - Optional: true, - }, - "volume_id": { - Type: schema.TypeString, - Optional: true, - }, - "volume_name": { - Type: schema.TypeString, - Optional: true, - }, - "volume_device_path": { - Type: schema.TypeString, - Optional: true, - }, - } - return s -} diff --git a/rancher2/schema_node_template_outscale.go b/rancher2/schema_node_template_outscale.go deleted file mode 100644 index 5a48d31c6..000000000 --- a/rancher2/schema_node_template_outscale.go +++ /dev/null @@ -1,103 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -const ( - outscaleConfigDriver = "outscale" -) - -//Types - -type outscaleConfig struct { - AccessKey string `json:"accessKey,omitempty" yaml:"accessKey,omitempty"` - SourceOmi string `json:"sourceOmi,omitempty" yaml:"sourceOmi,omitempty"` - Region string `json:"region,omitempty" yaml:"region,omitempty"` - SecretKey string `json:"secretKey,omitempty" yaml:"secretKey,omitempty"` - SecurityGroupIds []string `json:"securityGroupIds,omitempty" yaml:"securityGroupIds,omitempty"` - ExtraTagsAll []string `json:"extraTagsAll,omitempty" yaml:"extraTagsAll,omitempty"` - ExtraTagsInstances []string `json:"extraTagsInstances,omitempty" yaml:"extraTagsInstances,omitempty"` - InstanceType string `json:"instanceType,omitempty" yaml:"instanceType,omitempty"` - RootDiskType string `json:"rootDiskType,omitempty" yaml:"rootDiskType,omitempty"` - RootDiskSize int `json:"rootDiskSize,string,omitempty" yaml:"rootDiskSize,omitempty"` - RootDiskIops int `json:"rootDiskIops,string,omitempty" yaml:"rootDiskIops,omitempty"` -} - -//Schemas - -func outscaleConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "source_omi": { - Type: schema.TypeString, - Optional: true, - Default: "ami-2cf1fa3e", - Description: "Outscale Machine Image to use as bootstrap for the VM", - }, - "region": { - Type: schema.TypeString, - Optional: true, - Default: "eu-west-2", - Description: "Outscale Region", - }, - "security_group_ids": { - Type: schema.TypeList, - Optional: true, - Description: "Ids of user defined Security Groups to add to the machine", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "access_key": { - Type: schema.TypeString, - Required: true, - Sensitive: true, - Description: "Outscale Access Key", - }, - "instance_type": { - Type: schema.TypeString, - Optional: true, - Default: "tinav2.c1r2p3", - Description: "Outscale VM type", - }, - "secret_key": { - Type: schema.TypeString, - Required: true, - Sensitive: true, - Description: "Outscale Secret Key", - }, - "extra_tags_all": { - Type: schema.TypeList, - Optional: true, - Description: "Extra tags for all created resources (e.g. key1=value1,key2=value2)", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "extra_tags_instances": { - Type: schema.TypeList, - Optional: true, - Description: "Extra tags only for instances (e.g. key1=value1,key2=value2)", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "root_disk_type": { - Type: schema.TypeString, - Optional: true, - Description: "Type of the Root Disk. Possible values are :'standard', 'gp2' or 'io1'.", - }, - "root_disk_size": { - Type: schema.TypeInt, - Optional: true, - Description: "Size of the Root Disk (in GB). From 1 to 14901.", - }, - "root_disk_iops": { - Type: schema.TypeInt, - Optional: true, - Description: "Iops for io1 Root Disk. From 1 to 13000.", - }, - } - - return s -} diff --git a/rancher2/schema_node_template_vsphere.go b/rancher2/schema_node_template_vsphere.go deleted file mode 100644 index 384ef7eb3..000000000 --- a/rancher2/schema_node_template_vsphere.go +++ /dev/null @@ -1,254 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" -) - -const ( - vmwarevsphereConfigDriver = "vmwarevsphere" - vmwarevsphereConfigCreationTypeDefault = "legacy" -) - -var ( - vmwarevsphereConfigCreationType = []string{"vm", "template", "library", "legacy"} - vmwarevsphereConfigVappIpallocationpolicies = []string{"dhcp", "fixed", "transient", "fixedAllocated"} - vmwarevsphereConfigVappIpprotocols = []string{"IPv4", "IPv6"} - vmwarevsphereConfigVappTransports = []string{"iso", "com.vmware.guestInfo"} -) - -// Types - -type vmwarevsphereConfig struct { - Boot2dockerURL string `json:"boot2dockerUrl,omitempty" yaml:"boot2dockerUrl,omitempty"` - Cfgparam []string `json:"cfgparam,omitempty" yaml:"cfgparam,omitempty"` - CloneFrom string `json:"cloneFrom,omitempty" yaml:"cloneFrom,omitempty"` - CloudConfig string `json:"cloudConfig,omitempty" yaml:"cloudConfig,omitempty"` - Cloudinit string `json:"cloudinit,omitempty" yaml:"cloudinit,omitempty"` - ContentLibrary string `json:"contentLibrary,omitempty" yaml:"contentLibrary,omitempty"` - CPUCount string `json:"cpuCount,omitempty" yaml:"cpuCount,omitempty"` - CreationType string `json:"creationType,omitempty" yaml:"creationType,omitempty"` - CustomAttributes []string `json:"customAttribute,omitempty" yaml:"customAttribute,omitempty"` - Datacenter string `json:"datacenter,omitempty" yaml:"datacenter,omitempty"` - Datastore string `json:"datastore,omitempty" yaml:"datastore,omitempty"` - DatastoreCluster string `json:"datastoreCluster,omitempty" yaml:"datastoreCluster,omitempty"` - DiskSize string `json:"diskSize,omitempty" yaml:"diskSize,omitempty"` - Folder string `json:"folder,omitempty" yaml:"folder,omitempty"` - Hostsystem string `json:"hostsystem,omitempty" yaml:"hostsystem,omitempty"` - MemorySize string `json:"memorySize,omitempty" yaml:"memorySize,omitempty"` - Network []string `json:"network,omitempty" yaml:"network,omitempty"` - Password string `json:"password,omitempty" yaml:"password,omitempty"` - Pool string `json:"pool,omitempty" yaml:"pool,omitempty"` - SSHPassword string `json:"sshPassword,omitempty" yaml:"sshPassword,omitempty"` - SSHPort string `json:"sshPort,omitempty" yaml:"sshPort,omitempty"` - SSHUser string `json:"sshUser,omitempty" yaml:"sshUser,omitempty"` - SSHUserGroup string `json:"sshUserGroup,omitempty" yaml:"sshUserGroup,omitempty"` - Tags []string `json:"tag,omitempty" yaml:"tag,omitempty"` - Username string `json:"username,omitempty" yaml:"username,omitempty"` - VappIpallocationpolicy string `json:"vappIpallocationpolicy,omitempty" yaml:"vappIpallocationpolicy,omitempty"` - VappIpprotocol string `json:"vappIpprotocol,omitempty" yaml:"vappIpprotocol,omitempty"` - VappProperty []string `json:"vappProperty,omitempty" yaml:"vappProperty,omitempty"` - VappTransport string `json:"vappTransport,omitempty" yaml:"vappTransport,omitempty"` - Vcenter string `json:"vcenter,omitempty" yaml:"vcenter,omitempty"` - VcenterPort string `json:"vcenterPort,omitempty" yaml:"vcenterPort,omitempty"` - GracefulShutdownTimeout string `json:"gracefulShutdownTimeout,omitempty" yaml:"gracefulShutdownTimeout, omitempty"` -} - -// Schemas - -func vsphereConfigFields() map[string]*schema.Schema { - s := map[string]*schema.Schema{ - "boot2docker_url": { - Type: schema.TypeString, - Optional: true, - Default: "https://releases.rancher.com/os/latest/rancheros-vmware.iso", - Description: "vSphere URL for boot2docker image", - }, - "cfgparam": { - Type: schema.TypeList, - Optional: true, - Description: "vSphere vm configuration parameters (used for guestinfo)", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "clone_from": { - Type: schema.TypeString, - Optional: true, - Description: "If you choose creation type clone a name of what you want to clone is required", - }, - "cloud_config": { - Type: schema.TypeString, - Optional: true, - Description: "Filepath to a cloud-config yaml file to put into the ISO user-data", - }, - "cloudinit": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere cloud-init filepath or url to add to guestinfo", - }, - "content_library": { - Type: schema.TypeString, - Optional: true, - Description: "If you choose to clone from a content library template specify the name of the library", - }, - "cpu_count": { - Type: schema.TypeString, - Optional: true, - Default: "2", - Description: "vSphere CPU number for docker VM", - }, - "creation_type": { - Type: schema.TypeString, - Optional: true, - Default: vmwarevsphereConfigCreationTypeDefault, - ValidateFunc: validation.StringInSlice(vmwarevsphereConfigCreationType, true), - Description: "Creation type when creating a new virtual machine. Supported values: vm, template, library, legacy", - }, - "custom_attributes": { - Type: schema.TypeList, - Optional: true, - Description: "vSphere custom attributes, format key/value e.g. '200=my custom value'", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "datacenter": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere datacenter for virtual machine", - }, - "datastore": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere datastore for virtual machine", - }, - "datastore_cluster": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere datastore cluster for virtual machine", - }, - "disk_size": { - Type: schema.TypeString, - Optional: true, - Default: "20480", - Description: "vSphere size of disk for docker VM (in MB)", - }, - "folder": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere folder for the docker VM. This folder must already exist in the datacenter", - }, - "hostsystem": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere compute resource where the docker VM will be instantiated. This can be omitted if using a cluster with DRS", - }, - "memory_size": { - Type: schema.TypeString, - Optional: true, - Default: "2048", - Description: "vSphere size of memory for docker VM (in MB)", - }, - "network": { - Type: schema.TypeList, - Optional: true, - Description: "vSphere network where the virtual machine will be attached", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Description: "vSphere password", - }, - "pool": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere resource pool for docker VM", - }, - "ssh_password": { - Type: schema.TypeString, - Optional: true, - Sensitive: true, - Default: "tcuser", - Description: "If using a non-B2D image you can specify the ssh password", - }, - "ssh_port": { - Type: schema.TypeString, - Optional: true, - Default: "22", - Description: "If using a non-B2D image you can specify the ssh port", - }, - "ssh_user": { - Type: schema.TypeString, - Optional: true, - Default: "docker", - Description: "If using a non-B2D image you can specify the ssh user", - }, - "ssh_user_group": { - Type: schema.TypeString, - Optional: true, - Default: "staff", - Description: "If using a non-B2D image the uploaded keys will need chown'ed, defaults to staff e.g. docker:staff", - }, - "tags": { - Type: schema.TypeList, - Optional: true, - Description: "vSphere tags id e.g. urn:xxx", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "username": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere username", - }, - "vapp_ip_allocation_policy": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere vApp IP allocation policy. Supported values are: dhcp, fixed, transient and fixedAllocated", - ValidateFunc: validation.StringInSlice(vmwarevsphereConfigVappIpallocationpolicies, true), - }, - "vapp_ip_protocol": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere vApp IP protocol for this deployment. Supported values are: IPv4 and IPv6", - ValidateFunc: validation.StringInSlice(vmwarevsphereConfigVappIpprotocols, true), - }, - "vapp_property": { - Type: schema.TypeList, - Optional: true, - Description: "vSphere vApp properties", - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "vapp_transport": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere OVF environment transports to use for properties. Supported values are: iso and com.vmware.guestInfo", - ValidateFunc: validation.StringInSlice(vmwarevsphereConfigVappTransports, true), - }, - "vcenter": { - Type: schema.TypeString, - Optional: true, - Description: "vSphere IP/hostname for vCenter", - }, - "vcenter_port": { - Type: schema.TypeString, - Optional: true, - Default: "443", - Description: "vSphere Port for vCenter", - }, - "graceful_shutdown_timeout": { - Type: schema.TypeString, - Optional: true, - Description: "Duration in seconds before the graceful shutdown of the VM times out and the VM is destroyed. A force destroy will be performed when the value is zero", - }, - } - return s -} diff --git a/rancher2/structure_cluster_template.go b/rancher2/structure_cluster_template.go deleted file mode 100644 index c0764c953..000000000 --- a/rancher2/structure_cluster_template.go +++ /dev/null @@ -1,435 +0,0 @@ -package rancher2 - -import ( - "fmt" - "strings" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Sorters - -type ByNameClusterTemplateRevisions []managementClient.ClusterTemplateRevision - -func (a ByNameClusterTemplateRevisions) Len() int { return len(a) } -func (a ByNameClusterTemplateRevisions) Less(i, j int) bool { - return strings.Compare(a[i].Name, a[j].Name) == -1 -} -func (a ByNameClusterTemplateRevisions) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// Flatteners - -func flattenQuestions(p []managementClient.Question) []interface{} { - if len(p) == 0 { - return []interface{}{} - } - - out := make([]interface{}, len(p)) - for i, in := range p { - obj := make(map[string]interface{}) - - obj["default"] = in.Default - obj["required"] = in.Required - obj["type"] = in.Type - obj["variable"] = in.Variable - - out[i] = obj - } - - return out -} - -func flattenClusterSpecBase(in *managementClient.ClusterSpecBase, p []interface{}) ([]interface{}, error) { - var obj map[string]interface{} - if len(p) == 0 || p[0] == nil { - obj = make(map[string]interface{}) - } else { - obj = p[0].(map[string]interface{}) - } - - if in == nil { - return []interface{}{}, nil - } - - if in.LocalClusterAuthEndpoint != nil { - obj["cluster_auth_endpoint"] = flattenClusterAuthEndpoint(in.LocalClusterAuthEndpoint) - } - - if len(in.DefaultClusterRoleForProjectMembers) > 0 { - obj["default_cluster_role_for_project_members"] = in.DefaultClusterRoleForProjectMembers - } - - if len(in.DefaultPodSecurityAdmissionConfigurationTemplateName) > 0 { - obj["default_pod_security_admission_configuration_template_name"] = in.DefaultPodSecurityAdmissionConfigurationTemplateName - } - - if len(in.DesiredAgentImage) > 0 { - obj["desired_agent_image"] = in.DesiredAgentImage - } - - if len(in.DesiredAuthImage) > 0 { - obj["desired_auth_image"] = in.DesiredAuthImage - } - - if len(in.DockerRootDir) > 0 { - obj["docker_root_dir"] = in.DockerRootDir - } - - obj["enable_network_policy"] = *in.EnableNetworkPolicy - - if in.RancherKubernetesEngineConfig != nil { - v, ok := obj["rke_config"].([]interface{}) - if !ok { - v = []interface{}{} - } - rkeConfig, err := flattenClusterRKEConfig(in.RancherKubernetesEngineConfig, v) - if err != nil { - return []interface{}{}, err - } - obj["rke_config"] = rkeConfig - } - - obj["windows_prefered_cluster"] = in.WindowsPreferedCluster - - return []interface{}{obj}, nil -} - -func flattenClusterTemplateRevisions(input []managementClient.ClusterTemplateRevision, defaultCtrID string, p []interface{}) ([]interface{}, error) { - if len(input) == 0 || p == nil { - return []interface{}{}, nil - } - - if len(defaultCtrID) == 0 { - return []interface{}{}, fmt.Errorf("Default Cluster Template Revision ID can't be empty") - } - - // Sorting input array by data interface - pIndexID := map[string]int{} - pIndexName := map[string]int{} - for i := range p { - if row, ok := p[i].(map[string]interface{}); ok { - if v, ok := row["id"].(string); ok && len(v) > 0 { - pIndexID[v] = i - } - if v, ok := row["name"].(string); ok { - pIndexName[v] = i - } - } - } - inputLen := len(input) - pLen := len(p) - sortedInput := make([]managementClient.ClusterTemplateRevision, inputLen) - newCTR := []managementClient.ClusterTemplateRevision{} - lastIndex := 0 - for i := range sortedInput { - if v, ok := pIndexID[input[i].ID]; ok { - if v > i && pLen > inputLen { - v = v - (v - i) - } - sortedInput[v] = input[i] - lastIndex++ - continue - } - if v, ok := pIndexName[input[i].Name]; ok { - if v > i && pLen > inputLen { - v = v - (v - i) - } - sortedInput[v] = input[i] - lastIndex++ - continue - } - newCTR = append(newCTR, input[i]) - } - - for i := range newCTR { - sortedInput[lastIndex+i] = newCTR[i] - } - - out := make([]interface{}, len(sortedInput)) - for i, in := range sortedInput { - var obj map[string]interface{} - if v, ok := pIndexName[in.Name]; ok { - if row, ok := p[v].(map[string]interface{}); ok { - obj = row - } - } - if obj == nil { - obj = make(map[string]interface{}) - } - - obj["default"] = false - if len(in.ID) > 0 { - obj["id"] = in.ID - if in.ID == defaultCtrID { - obj["default"] = true - } - } - - if in.ClusterConfig != nil { - v, ok := obj["cluster_config"].([]interface{}) - if !ok { - v = []interface{}{} - } - clusterConfig, err := flattenClusterSpecBase(in.ClusterConfig, v) - if err != nil { - return []interface{}{}, err - } - obj["cluster_config"] = clusterConfig - } - - if len(in.ClusterTemplateID) > 0 { - obj["cluster_template_id"] = in.ClusterTemplateID - } - - if in.Enabled != nil { - obj["enabled"] = *in.Enabled - } - - if len(in.Name) > 0 { - obj["name"] = in.Name - } - - if len(in.Questions) > 0 { - obj["questions"] = flattenQuestions(in.Questions) - } - - obj["annotations"] = toMapInterface(in.Annotations) - obj["labels"] = toMapInterface(in.Labels) - - out[i] = obj - } - - return out, nil -} - -func flattenClusterTemplate(d *schema.ResourceData, in *managementClient.ClusterTemplate, revisions []managementClient.ClusterTemplateRevision) error { - if len(in.ID) > 0 { - d.SetId(in.ID) - } - - d.Set("default_revision_id", in.DefaultRevisionID) - - v, ok := d.Get("template_revisions").([]interface{}) - if !ok { - v = []interface{}{} - } - templateRevisions, err := flattenClusterTemplateRevisions(revisions, in.DefaultRevisionID, v) - if err != nil { - return err - } - d.Set("template_revisions", templateRevisions) - if len(in.Description) > 0 { - d.Set("description", in.Description) - } - - err = d.Set("members", flattenMembers(in.Members)) - if err != nil { - return err - } - - d.Set("name", in.Name) - - err = d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - - err = d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - - return nil -} - -// Expanders - -func expandQuestions(p []interface{}) []managementClient.Question { - if len(p) == 0 || p[0] == nil { - return nil - } - - obj := make([]managementClient.Question, len(p)) - - for i := range p { - in := p[i].(map[string]interface{}) - - if v, ok := in["default"].(string); ok && len(v) > 0 { - obj[i].Default = v - } - - if v, ok := in["required"].(bool); ok { - obj[i].Required = v - } - - if v, ok := in["type"].(string); ok && len(v) > 0 { - obj[i].Type = v - } - - if v, ok := in["variable"].(string); ok && len(v) > 0 { - obj[i].Variable = v - } - } - - return obj -} - -func expandClusterSpecBase(p []interface{}) (*managementClient.ClusterSpecBase, error) { - obj := &managementClient.ClusterSpecBase{} - if len(p) == 0 || p[0] == nil { - return obj, nil - } - in := p[0].(map[string]interface{}) - - if v, ok := in["cluster_auth_endpoint"].([]interface{}); ok && len(v) > 0 { - obj.LocalClusterAuthEndpoint = expandClusterAuthEndpoint(v) - } - - if v, ok := in["default_cluster_role_for_project_members"].(string); ok && len(v) > 0 { - obj.DefaultClusterRoleForProjectMembers = v - } - - if v, ok := in["default_pod_security_admission_configuration_template_name"].(string); ok && len(v) > 0 { - obj.DefaultPodSecurityAdmissionConfigurationTemplateName = v - } - - if v, ok := in["desired_agent_image"].(string); ok && len(v) > 0 { - obj.DesiredAgentImage = v - } - - if v, ok := in["desired_auth_image"].(string); ok && len(v) > 0 { - obj.DesiredAuthImage = v - } - - if v, ok := in["docker_root_dir"].(string); ok && len(v) > 0 { - obj.DockerRootDir = v - } - - if v, ok := in["enable_network_policy"].(bool); ok { - obj.EnableNetworkPolicy = &v - } - - if v, ok := in["rke_config"].([]interface{}); ok && len(v) > 0 { - rkeConfig, err := expandClusterRKEConfig(v, "") - if err != nil { - return nil, err - } - obj.RancherKubernetesEngineConfig = rkeConfig - } - - if v, ok := in["windows_prefered_cluster"].(bool); ok { - obj.WindowsPreferedCluster = v - } - - return obj, nil -} - -func expandClusterTemplateRevisions(p []interface{}) (int, []managementClient.ClusterTemplateRevision, error) { - if len(p) == 0 || p[0] == nil { - return 0, []managementClient.ClusterTemplateRevision{}, nil - } - - obj := make([]managementClient.ClusterTemplateRevision, len(p)) - - indexDefault := 0 - hasDefault := false - names := map[string]int{} - for i := range p { - in := p[i].(map[string]interface{}) - - if v, ok := in["id"].(string); ok && len(v) > 0 { - obj[i].ID = v - } - - if v, ok := in["cluster_config"].([]interface{}); ok && len(v) > 0 { - var err error - obj[i].ClusterConfig, err = expandClusterSpecBase(v) - if err != nil { - return 0, nil, err - } - } - - if v, ok := in["cluster_template_id"].(string); ok && len(v) > 0 { - obj[i].ClusterTemplateID = v - } - - if v, ok := in["default"].(bool); ok && v { - if hasDefault { - return 0, nil, fmt.Errorf("[ERROR] Expanding cluster template revisions: more than one default defined") - } - hasDefault = true - indexDefault = i - } - - if v, ok := in["enabled"].(bool); ok { - obj[i].Enabled = &v - } - - if v, ok := in["name"].(string); ok { - obj[i].Name = v - names[v]++ - if names[v] > 1 { - return 0, nil, fmt.Errorf("[ERROR] Expanding cluster template revisions: name \"%s\" is repeated", v) - } - } - - if v, ok := in["questions"].([]interface{}); ok && len(v) > 0 { - obj[i].Questions = expandQuestions(v) - } - - if v, ok := in["annotations"].(map[string]interface{}); ok && len(v) > 0 { - obj[i].Annotations = toMapString(v) - } - - if v, ok := in["labels"].(map[string]interface{}); ok && len(v) > 0 { - obj[i].Labels = toMapString(v) - } - } - - if !hasDefault { - return 0, nil, fmt.Errorf("[ERROR] Expanding cluster template revisions: NO default defined") - } - - return indexDefault, obj, nil - -} - -func expandClusterTemplate(in *schema.ResourceData) (int, *managementClient.ClusterTemplate, []managementClient.ClusterTemplateRevision, error) { - obj := &managementClient.ClusterTemplate{} - if in == nil { - return 0, nil, nil, nil - } - - if v := in.Id(); len(v) > 0 { - obj.ID = v - } - - if v, ok := in.Get("default_revision_id").(string); ok && len(v) > 0 { - obj.DefaultRevisionID = v - } - - if v, ok := in.Get("description").(string); ok && len(v) > 0 { - obj.Description = v - } - - if v, ok := in.Get("members").([]interface{}); ok && len(v) > 0 { - obj.Members = expandMembers(v) - } - - if v, ok := in.Get("name").(string); ok && len(v) > 0 { - obj.Name = v - } - - if v, ok := in.Get("annotations").(map[string]interface{}); ok && len(v) > 0 { - obj.Annotations = toMapString(v) - } - - if v, ok := in.Get("labels").(map[string]interface{}); ok && len(v) > 0 { - obj.Labels = toMapString(v) - } - - indexDefault, clusterTemplateRevisions, err := expandClusterTemplateRevisions(in.Get("template_revisions").([]interface{})) - - return indexDefault, obj, clusterTemplateRevisions, err -} diff --git a/rancher2/structure_cluster_template_test.go b/rancher2/structure_cluster_template_test.go deleted file mode 100644 index 08734c663..000000000 --- a/rancher2/structure_cluster_template_test.go +++ /dev/null @@ -1,347 +0,0 @@ -package rancher2 - -import ( - "reflect" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testClusterTemplateQuestionsConf []managementClient.Question - testClusterTemplateQuestionsInterface []interface{} - testClusterTemplateRevisionsConfigRKEConf *managementClient.RancherKubernetesEngineConfig - testClusterTemplateRevisionsConfigAuthEndpointConf *managementClient.LocalClusterAuthEndpoint - testClusterTemplateRevisionsConfigRKEInterface []interface{} - testClusterTemplateRevisionsConfigAuthEndpointInterface []interface{} - testClusterTemplateRevisionsConfigConf *managementClient.ClusterSpecBase - testClusterTemplateRevisionsConfigInterface []interface{} - testClusterTemplateRevisionsConf []managementClient.ClusterTemplateRevision - testClusterTemplateRevisionsInterface []interface{} - testClusterTemplateMembersConf []managementClient.Member - testClusterTemplateMembersInterface []interface{} - testClusterTemplateConf *managementClient.ClusterTemplate - testClusterTemplateInterface map[string]interface{} -) - -func testClusterTemplate() { - k8sVersion = "test" - testClusterTemplateRevisionsConfigRKEConf = &managementClient.RancherKubernetesEngineConfig{ - AddonJobTimeout: 30, - Addons: "addons", - AddonsInclude: []string{"addon1", "addon2"}, - Authentication: testClusterRKEConfigAuthenticationConf, - Authorization: testClusterRKEConfigAuthorizationConf, - BastionHost: testClusterRKEConfigBastionHostConf, - CloudProvider: testClusterRKEConfigCloudProviderConf, - IgnoreDockerVersion: newTrue(), - Ingress: testClusterRKEConfigIngressConf, - Monitoring: testClusterRKEConfigMonitoringConf, - Network: testClusterRKEConfigNetworkConfCanal, - Nodes: testClusterRKEConfigNodesConf, - PrefixPath: "terraform-test", - PrivateRegistries: testClusterRKEConfigPrivateRegistriesConf, - Services: testClusterRKEConfigServicesConf, - SSHAgentAuth: true, - SSHKeyPath: "/home/user/.ssh", - Version: k8sVersion, - } - testClusterTemplateRevisionsConfigRKEInterface = []interface{}{ - map[string]interface{}{ - "addon_job_timeout": 30, - "addons": "addons", - "addons_include": []interface{}{"addon1", "addon2"}, - "authentication": testClusterRKEConfigAuthenticationInterface, - "authorization": testClusterRKEConfigAuthorizationInterface, - "bastion_host": testClusterRKEConfigBastionHostInterface, - "cloud_provider": testClusterRKEConfigCloudProviderInterface, - "ignore_docker_version": true, - "ingress": testClusterRKEConfigIngressInterface, - "monitoring": testClusterRKEConfigMonitoringInterface, - "network": testClusterRKEConfigNetworkInterfaceCanal, - "nodes": testClusterRKEConfigNodesInterface, - "prefix_path": "terraform-test", - "private_registries": testClusterRKEConfigPrivateRegistriesInterface, - "services": testClusterRKEConfigServicesInterface, - "ssh_agent_auth": true, - "ssh_key_path": "/home/user/.ssh", - "kubernetes_version": k8sVersion, - }, - } - testClusterTemplateQuestionsConf = []managementClient.Question{ - { - Default: "default", - Required: true, - Type: "string", - Variable: "variable", - }, - } - testClusterTemplateQuestionsInterface = []interface{}{ - map[string]interface{}{ - "default": "default", - "required": true, - "type": "string", - "variable": "variable", - }, - } - testClusterTemplateRevisionsConfigAuthEndpointConf = &managementClient.LocalClusterAuthEndpoint{ - CACerts: "cacerts", - Enabled: true, - FQDN: "fqdn", - } - testClusterTemplateRevisionsConfigAuthEndpointInterface = []interface{}{ - map[string]interface{}{ - "ca_certs": "cacerts", - "enabled": true, - "fqdn": "fqdn", - }, - } - testClusterTemplateRevisionsConfigConf = &managementClient.ClusterSpecBase{ - DefaultClusterRoleForProjectMembers: "default_cluster_role_for_project_members", - DefaultPodSecurityAdmissionConfigurationTemplateName: "default_pod_security_admission_configuration_template_name", - DesiredAgentImage: "desired_agent_image", - DesiredAuthImage: "desired_auth_image", - DockerRootDir: "docker_root_dir", - EnableNetworkPolicy: newTrue(), - LocalClusterAuthEndpoint: testClusterTemplateRevisionsConfigAuthEndpointConf, - RancherKubernetesEngineConfig: testClusterTemplateRevisionsConfigRKEConf, - WindowsPreferedCluster: true, - } - testClusterTemplateRevisionsConfigInterface = []interface{}{ - map[string]interface{}{ - "cluster_auth_endpoint": testClusterTemplateRevisionsConfigAuthEndpointInterface, - "default_cluster_role_for_project_members": "default_cluster_role_for_project_members", - "desired_agent_image": "desired_agent_image", - "desired_auth_image": "desired_auth_image", - "docker_root_dir": "docker_root_dir", - "enable_network_policy": true, - "rke_config": testClusterTemplateRevisionsConfigRKEInterface, - "windows_prefered_cluster": true, - }, - } - testClusterTemplateRevisionsConf = []managementClient.ClusterTemplateRevision{ - { - ClusterConfig: testClusterTemplateRevisionsConfigConf, - ClusterTemplateID: "cluster_template_id", - Enabled: newTrue(), - Name: "test", - Questions: testClusterTemplateQuestionsConf, - }, - } - testClusterTemplateRevisionsConf[0].ID = "default_revision_id" - testClusterTemplateRevisionsInterface = []interface{}{ - map[string]interface{}{ - "id": "default_revision_id", - "cluster_config": testClusterTemplateRevisionsConfigInterface, - "cluster_template_id": "cluster_template_id", - "default": true, - "enabled": true, - "name": "test", - "questions": testClusterTemplateQuestionsInterface, - }, - } - testClusterTemplateMembersConf = []managementClient.Member{ - { - AccessType: "access_type", - GroupPrincipalID: "group_principal_id", - UserPrincipalID: "user_principal_id", - }, - } - testClusterTemplateMembersInterface = []interface{}{ - map[string]interface{}{ - "access_type": "access_type", - "group_principal_id": "group_principal_id", - "user_principal_id": "user_principal_id", - }, - } - testClusterTemplateConf = &managementClient.ClusterTemplate{ - DefaultRevisionID: "default_revision_id", - Description: "description", - Name: "name", - Members: testClusterTemplateMembersConf, - } - testClusterTemplateInterface = map[string]interface{}{ - "default_revision_id": "default_revision_id", - "description": "description", - "members": testClusterTemplateMembersInterface, - "name": "name", - "template_revisions": testClusterTemplateRevisionsInterface, - } -} - -func TestFlattenQuestions(t *testing.T) { - testClusterTemplate() - cases := []struct { - Input []managementClient.Question - ExpectedOutput []interface{} - }{ - { - testClusterTemplateQuestionsConf, - testClusterTemplateQuestionsInterface, - }, - } - - for _, tc := range cases { - output := flattenQuestions(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestFlattenClusterSpecBase(t *testing.T) { - - cases := []struct { - Input *managementClient.ClusterSpecBase - ExpectedOutput []interface{} - }{ - { - testClusterTemplateRevisionsConfigConf, - testClusterTemplateRevisionsConfigInterface, - }, - } - - for _, tc := range cases { - output, err := flattenClusterSpecBase(tc.Input, tc.ExpectedOutput) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestFlattenClusterTemplateRevisions(t *testing.T) { - - cases := []struct { - Input []managementClient.ClusterTemplateRevision - ExpectedOutput []interface{} - }{ - { - testClusterTemplateRevisionsConf, - testClusterTemplateRevisionsInterface, - }, - } - - for _, tc := range cases { - output, err := flattenClusterTemplateRevisions(tc.Input, "default_revision_id", tc.ExpectedOutput) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestFlattenClusterTemplate(t *testing.T) { - - cases := []struct { - Input *managementClient.ClusterTemplate - Revisions []managementClient.ClusterTemplateRevision - ExpectedOutput map[string]interface{} - }{ - { - testClusterTemplateConf, - testClusterTemplateRevisionsConf, - testClusterTemplateInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, clusterTemplateFields(), tc.ExpectedOutput) - err := flattenClusterTemplate(output, tc.Input, tc.Revisions) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - expectedOutput := map[string]interface{}{} - for k := range tc.ExpectedOutput { - expectedOutput[k] = output.Get(k) - } - - expectedOutput["template_revisions"].([]interface{})[0].(map[string]interface{})["cluster_config"].([]interface{})[0].(map[string]interface{})["rke_config"], _ = flattenClusterRKEConfig(testClusterTemplateRevisionsConfigRKEConf, []interface{}{}) - if !reflect.DeepEqual(expectedOutput, tc.ExpectedOutput) { - assert.FailNow(t, "Unexpected output from flattener.\nExpected: %#v\nGiven: %#v", - tc.ExpectedOutput, expectedOutput) - } - } -} - -func TestExpandQuestions(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput []managementClient.Question - }{ - { - testClusterTemplateQuestionsInterface, - testClusterTemplateQuestionsConf, - }, - } - - for _, tc := range cases { - output := expandQuestions(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} - -func TestExpandClusterSpecBase(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput *managementClient.ClusterSpecBase - }{ - { - testClusterTemplateRevisionsConfigInterface, - testClusterTemplateRevisionsConfigConf, - }, - } - - for _, tc := range cases { - output, err := expandClusterSpecBase(tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on expander: %#v", err) - } - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} - -func TestExpandClusterTemplateRevisions(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput []managementClient.ClusterTemplateRevision - }{ - { - testClusterTemplateRevisionsInterface, - testClusterTemplateRevisionsConf, - }, - } - - for _, tc := range cases { - _, output, err := expandClusterTemplateRevisions(tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on expander: %#v", err) - } - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} - -func TestExpandClusterTemplate(t *testing.T) { - - cases := []struct { - Input map[string]interface{} - ExpectedOutput *managementClient.ClusterTemplate - }{ - { - testClusterTemplateInterface, - testClusterTemplateConf, - }, - } - - for _, tc := range cases { - inputResourceData := schema.TestResourceDataRaw(t, clusterTemplateFields(), tc.Input) - _, output, _, err := expandClusterTemplate(inputResourceData) - if err != nil { - assert.FailNow(t, "[ERROR] on expnader: %#v", err) - } - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_etcd_backup.go b/rancher2/structure_etcd_backup.go deleted file mode 100644 index 1e24f1ae5..000000000 --- a/rancher2/structure_etcd_backup.go +++ /dev/null @@ -1,90 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenEtcdBackup(d *schema.ResourceData, in *managementClient.EtcdBackup) error { - if in == nil { - return nil - } - - d.SetId(in.ID) - - backupConfig := d.Get("backup_config").([]interface{}) - err := d.Set("backup_config", flattenClusterRKEConfigServicesEtcdBackupConfig(in.BackupConfig, backupConfig)) - if err != nil { - return err - } - - d.Set("cluster_id", in.ClusterID) - d.Set("filename", in.Filename) - d.Set("manual", in.Manual) - d.Set("name", in.Name) - d.Set("namespace_id", in.NamespaceId) - - err = d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - - err = d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - - return nil - -} - -// Expanders - -func expandEtcdBackup(in *schema.ResourceData) (*managementClient.EtcdBackup, error) { - obj := &managementClient.EtcdBackup{} - if in == nil { - return nil, nil - } - - if v := in.Id(); len(v) > 0 { - obj.ID = v - } - - if v, ok := in.Get("backup_config").([]interface{}); ok && len(v) > 0 { - backupConfig, err := expandClusterRKEConfigServicesEtcdBackupConfig(v) - if err != nil { - return nil, err - } - obj.BackupConfig = backupConfig - } - - obj.ClusterID = in.Get("cluster_id").(string) - - if v, ok := in.Get("filename").(string); ok && len(v) > 0 { - obj.Filename = v - } - - if v, ok := in.Get("manual").(bool); ok { - obj.Manual = v - } - - if v, ok := in.Get("name").(string); ok && len(v) > 0 { - obj.Name = v - } - - if v, ok := in.Get("namespace_id").(string); ok && len(v) > 0 { - obj.NamespaceId = v - } - - if v, ok := in.Get("annotations").(map[string]interface{}); ok && len(v) > 0 { - obj.Annotations = toMapString(v) - } - - if v, ok := in.Get("labels").(map[string]interface{}); ok && len(v) > 0 { - obj.Labels = toMapString(v) - } - - return obj, nil -} diff --git a/rancher2/structure_etcd_backup_test.go b/rancher2/structure_etcd_backup_test.go deleted file mode 100644 index ee58fe6d3..000000000 --- a/rancher2/structure_etcd_backup_test.go +++ /dev/null @@ -1,127 +0,0 @@ -package rancher2 - -import ( - "reflect" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testEtcdBackupConfigS3Conf *managementClient.S3BackupConfig - testEtcdBackupConfigS3Interface []interface{} - testEtcdBackupConfigConf *managementClient.BackupConfig - testEtcdBackupConfigInterface []interface{} - testEtcdBackupConf *managementClient.EtcdBackup - testEtcdBackupInterface map[string]interface{} -) - -func init() { - testEtcdBackupConfigS3Conf = &managementClient.S3BackupConfig{ - AccessKey: "access_key", - BucketName: "bucket_name", - CustomCA: "custom_ca", - Endpoint: "endpoint", - Folder: "folder", - Region: "region", - SecretKey: "secret", - } - testEtcdBackupConfigS3Interface = []interface{}{ - map[string]interface{}{ - "access_key": "access_key", - "bucket_name": "bucket_name", - "custom_ca": Base64Encode("custom_ca"), - "endpoint": "endpoint", - "folder": "folder", - "region": "region", - "secret_key": "secret", - }, - } - testEtcdBackupConfigConf = &managementClient.BackupConfig{ - Enabled: newTrue(), - IntervalHours: 20, - Retention: 10, - S3BackupConfig: testEtcdBackupConfigS3Conf, - SafeTimestamp: false, - Timeout: 500, - } - testEtcdBackupConfigInterface = []interface{}{ - map[string]interface{}{ - "enabled": true, - "interval_hours": 20, - "retention": 10, - "s3_backup_config": testEtcdBackupConfigS3Interface, - "safe_timestamp": false, - "timeout": 500, - }, - } - testEtcdBackupConf = &managementClient.EtcdBackup{ - BackupConfig: testEtcdBackupConfigConf, - ClusterID: "cluster-test", - Filename: "filename", - Manual: true, - Name: "test", - NamespaceId: "namespace_id", - } - testEtcdBackupInterface = map[string]interface{}{ - "backup_config": testEtcdBackupConfigInterface, - "cluster_id": "cluster-test", - "filename": "filename", - "manual": true, - "name": "test", - "namespace_id": "namespace_id", - } -} - -func TestFlattenEtcdBackup(t *testing.T) { - - cases := []struct { - Input *managementClient.EtcdBackup - ExpectedOutput map[string]interface{} - }{ - { - testEtcdBackupConf, - testEtcdBackupInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, etcdBackupFields(), map[string]interface{}{}) - err := flattenEtcdBackup(output, tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - expectedOutput := map[string]interface{}{} - for k := range tc.ExpectedOutput { - expectedOutput[k] = output.Get(k) - } - if !reflect.DeepEqual(expectedOutput, tc.ExpectedOutput) { - assert.FailNow(t, "Unexpected output from flattener.\nExpected: %#v\nGiven: %#v", - tc.ExpectedOutput, expectedOutput) - } - } -} - -func TestExpandEtcdBackup(t *testing.T) { - - cases := []struct { - Input map[string]interface{} - ExpectedOutput *managementClient.EtcdBackup - }{ - { - testEtcdBackupInterface, - testEtcdBackupConf, - }, - } - - for _, tc := range cases { - inputResourceData := schema.TestResourceDataRaw(t, etcdBackupFields(), tc.Input) - output, err := expandEtcdBackup(inputResourceData) - if err != nil { - assert.FailNow(t, "[ERROR] on expnader: %#v", err) - } - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_member.go b/rancher2/structure_member.go deleted file mode 100644 index 1236864e2..000000000 --- a/rancher2/structure_member.go +++ /dev/null @@ -1,62 +0,0 @@ -package rancher2 - -import ( - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" -) - -// Flatteners - -func flattenMembers(p []managementClient.Member) []interface{} { - if len(p) == 0 { - return []interface{}{} - } - - out := make([]interface{}, len(p)) - for i, in := range p { - obj := make(map[string]interface{}) - - if len(in.AccessType) > 0 { - obj["access_type"] = in.AccessType - } - - if len(in.GroupPrincipalID) > 0 { - obj["group_principal_id"] = in.GroupPrincipalID - } - - if len(in.UserPrincipalID) > 0 { - obj["user_principal_id"] = in.UserPrincipalID - } - - out[i] = obj - } - - return out -} - -// Expanders - -func expandMembers(p []interface{}) []managementClient.Member { - if len(p) == 0 || p[0] == nil { - return []managementClient.Member{} - } - - obj := make([]managementClient.Member, len(p)) - - for i := range p { - in := p[i].(map[string]interface{}) - - if v, ok := in["access_type"].(string); ok && len(v) > 0 { - obj[i].AccessType = v - } - - if v, ok := in["group_principal_id"].(string); ok && len(v) > 0 { - obj[i].GroupPrincipalID = v - } - - if v, ok := in["user_principal_id"].(string); ok && len(v) > 0 { - obj[i].UserPrincipalID = v - } - } - - return obj -} diff --git a/rancher2/structure_member_test.go b/rancher2/structure_member_test.go deleted file mode 100644 index c62c5c4c6..000000000 --- a/rancher2/structure_member_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package rancher2 - -import ( - "testing" - - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testMembersConf []managementClient.Member - testMembersInterface []interface{} -) - -func init() { - testMembersConf = []managementClient.Member{ - { - AccessType: "access_type", - GroupPrincipalID: "group_principal_id", - UserPrincipalID: "user_principal_id", - }, - } - testMembersInterface = []interface{}{ - map[string]interface{}{ - "access_type": "access_type", - "group_principal_id": "group_principal_id", - "user_principal_id": "user_principal_id", - }, - } -} - -func TestFlattenMembers(t *testing.T) { - - cases := []struct { - Input []managementClient.Member - ExpectedOutput []interface{} - }{ - { - testMembersConf, - testMembersInterface, - }, - } - - for _, tc := range cases { - output := flattenMembers(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from flattener.") - } -} - -func TestExpandMembers(t *testing.T) { - - cases := []struct { - Input []interface{} - ExpectedOutput []managementClient.Member - }{ - { - testMembersInterface, - testMembersConf, - }, - } - - for _, tc := range cases { - output := expandMembers(tc.Input) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_node_template.go b/rancher2/structure_node_template.go deleted file mode 100644 index b1c600899..000000000 --- a/rancher2/structure_node_template.go +++ /dev/null @@ -1,273 +0,0 @@ -package rancher2 - -import ( - "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// Flatteners - -func flattenNodeTemplate(d *schema.ResourceData, in *NodeTemplate) error { - if in == nil { - return nil - } - - d.SetId(in.ID) - d.Set("name", in.Name) - d.Set("driver", in.Driver) - - switch in.Driver { - case amazonec2ConfigDriver: - if in.Amazonec2Config == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires amazonec2_config", in.Driver) - } - case azureConfigDriver: - if in.AzureConfig == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires azure_config", in.Driver) - } - case digitaloceanConfigDriver: - if in.DigitaloceanConfig == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires digitalocean_config", in.Driver) - } - case linodeConfigDriver: - if in.LinodeConfig == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires linode_config", in.Driver) - } - case openstackConfigDriver: - if in.OpenstackConfig == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires openstack_config", in.Driver) - } - case hetznerConfigDriver: - if in.HetznerConfig == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires hetzner_config", in.Driver) - } - case harvesterConfigDriver: - if in.HarvesterConfig == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires harvester_config", in.Driver) - } - case vmwarevsphereConfigDriver: - if in.VmwarevsphereConfig == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires vsphere_config", in.Driver) - } - case opennebulaConfigDriver: - if in.OpennebulaConfig == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires opennebula_config", in.Driver) - } - case outscaleConfigDriver: - if in.OutscaleConfig == nil { - return fmt.Errorf("[ERROR] Node template driver %s requires outscale_config", in.Driver) - } - default: - return fmt.Errorf("[ERROR] Unsupported driver on node template: %s", in.Driver) - } - - if len(in.AuthCertificateAuthority) > 0 { - d.Set("auth_certificate_authority", in.AuthCertificateAuthority) - } - - if len(in.AuthKey) > 0 { - d.Set("auth_key", in.AuthKey) - } - - if len(in.CloudCredentialID) > 0 { - d.Set("cloud_credential_id", in.CloudCredentialID) - } - - if len(in.Description) > 0 { - d.Set("description", in.Description) - } - - if len(in.EngineEnv) > 0 { - err := d.Set("engine_env", toMapInterface(in.EngineEnv)) - if err != nil { - return err - } - } - - if len(in.EngineInsecureRegistry) > 0 { - err := d.Set("engine_insecure_registry", toArrayInterface(in.EngineInsecureRegistry)) - if err != nil { - return err - } - } - - if len(in.EngineInstallURL) > 0 { - d.Set("engine_install_url", in.EngineInstallURL) - } - - if len(in.EngineLabel) > 0 { - err := d.Set("engine_label", toMapInterface(in.EngineLabel)) - if err != nil { - return err - } - } - - if len(in.EngineOpt) > 0 { - err := d.Set("engine_opt", toMapInterface(in.EngineOpt)) - if err != nil { - return err - } - } - - if len(in.EngineRegistryMirror) > 0 { - err := d.Set("engine_registry_mirror", toArrayInterface(in.EngineRegistryMirror)) - if err != nil { - return err - } - } - - if len(in.EngineStorageDriver) > 0 { - d.Set("engine_storage_driver", in.EngineStorageDriver) - } - - err := d.Set("node_taints", flattenTaints(in.NodeTaints)) - if err != nil { - return err - } - - d.Set("use_internal_ip_address", *in.UseInternalIPAddress) - - err = d.Set("annotations", toMapInterface(in.Annotations)) - if err != nil { - return err - } - - err = d.Set("labels", toMapInterface(in.Labels)) - if err != nil { - return err - } - - return nil -} - -// Expanders - -func expandNodeTemplate(in *schema.ResourceData) *NodeTemplate { - obj := &NodeTemplate{} - if in == nil { - return nil - } - - if v := in.Id(); len(v) > 0 { - obj.ID = v - } - obj.Name = in.Get("name").(string) - - if v, ok := in.Get("amazonec2_config").([]interface{}); ok && len(v) > 0 { - obj.Amazonec2Config = expandAmazonec2Config(v) - obj.Driver = amazonec2ConfigDriver - } - - if v, ok := in.Get("auth_certificate_authority").(string); ok && len(v) > 0 { - obj.AuthCertificateAuthority = v - } - - if v, ok := in.Get("auth_key").(string); ok && len(v) > 0 { - obj.AuthKey = v - } - - if v, ok := in.Get("azure_config").([]interface{}); ok && len(v) > 0 { - obj.AzureConfig = expandAzureConfig(v) - obj.Driver = azureConfigDriver - } - - if v, ok := in.Get("cloud_credential_id").(string); ok && len(v) > 0 { - obj.CloudCredentialID = v - } - - if v, ok := in.Get("description").(string); ok && len(v) > 0 { - obj.Description = v - } - - if v, ok := in.Get("digitalocean_config").([]interface{}); ok && len(v) > 0 { - obj.DigitaloceanConfig = expandDigitaloceanConfig(v) - obj.Driver = digitaloceanConfigDriver - } - - if v, ok := in.Get("engine_env").(map[string]interface{}); ok && len(v) > 0 { - obj.EngineEnv = toMapString(v) - } - - if v, ok := in.Get("engine_insecure_registry").([]interface{}); ok && len(v) > 0 { - obj.EngineInsecureRegistry = toArrayString(v) - } - - if v, ok := in.Get("engine_install_url").(string); ok && len(v) > 0 { - obj.EngineInstallURL = v - } - - if v, ok := in.Get("engine_label").(map[string]interface{}); ok && len(v) > 0 { - obj.EngineLabel = toMapString(v) - } - - if v, ok := in.Get("engine_opt").(map[string]interface{}); ok && len(v) > 0 { - obj.EngineOpt = toMapString(v) - } - - if v, ok := in.Get("engine_registry_mirror").([]interface{}); ok && len(v) > 0 { - obj.EngineRegistryMirror = toArrayString(v) - } - - if v, ok := in.Get("engine_storage_driver").(string); ok && len(v) > 0 { - obj.EngineStorageDriver = v - } - - if v, ok := in.Get("node_taints").([]interface{}); ok && len(v) > 0 { - obj.NodeTaints = expandTaints(v) - } - - if v, ok := in.Get("linode_config").([]interface{}); ok && len(v) > 0 { - obj.LinodeConfig = expandLinodeConfig(v) - obj.Driver = linodeConfigDriver - } - - if v, ok := in.Get("openstack_config").([]interface{}); ok && len(v) > 0 { - obj.OpenstackConfig = expandOpenstackConfig(v) - obj.Driver = openstackConfigDriver - } - - if v, ok := in.Get("opennebula_config").([]interface{}); ok && len(v) > 0 { - obj.OpennebulaConfig = expandOpennebulaConfig(v) - obj.Driver = opennebulaConfigDriver - } - - if v, ok := in.Get("outscale_config").([]interface{}); ok && len(v) > 0 { - obj.OutscaleConfig = expandOutscaleConfig(v) - obj.Driver = outscaleConfigDriver - } - - if v, ok := in.Get("hetzner_config").([]interface{}); ok && len(v) > 0 { - obj.HetznerConfig = expandHetznercloudConfig(v) - obj.Driver = hetznerConfigDriver - } - - if v, ok := in.Get("harvester_config").([]interface{}); ok && len(v) > 0 { - obj.HarvesterConfig = expandHarvestercloudConfig(v) - obj.Driver = harvesterConfigDriver - } - - if v, ok := in.Get("use_internal_ip_address").(bool); ok { - obj.UseInternalIPAddress = &v - } - - if v, ok := in.Get("vsphere_config").([]interface{}); ok && len(v) > 0 { - obj.VmwarevsphereConfig = expandVsphereConfig(v) - obj.Driver = vmwarevsphereConfigDriver - } - - if v, ok := in.Get("annotations").(map[string]interface{}); ok && len(v) > 0 { - obj.Annotations = toMapString(v) - } - - if v, ok := in.Get("labels").(map[string]interface{}); ok && len(v) > 0 { - obj.Labels = toMapString(v) - } - - // Computing driver_id if empty - if v, ok := in.Get("driver_id").(string); ok && len(v) == 0 { - in.Set("driver_id", obj.Driver) - } - - return obj -} diff --git a/rancher2/structure_node_template_amazonec2.go b/rancher2/structure_node_template_amazonec2.go deleted file mode 100644 index e9a2f5497..000000000 --- a/rancher2/structure_node_template_amazonec2.go +++ /dev/null @@ -1,280 +0,0 @@ -package rancher2 - -// Flatteners - -func flattenAmazonec2Config(in *amazonec2Config) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - if len(in.AccessKey) > 0 { - obj["access_key"] = in.AccessKey - } - - if len(in.Ami) > 0 { - obj["ami"] = in.Ami - } - - if len(in.BlockDurationMinutes) > 0 { - obj["block_duration_minutes"] = in.BlockDurationMinutes - } - - if len(in.DeviceName) > 0 { - obj["device_name"] = in.DeviceName - } - - obj["encrypt_ebs_volume"] = in.EncryptEbsVolume - - if len(in.Endpoint) > 0 { - obj["endpoint"] = in.Endpoint - } - - if len(in.HTTPEndpoint) > 0 { - obj["http_endpoint"] = in.HTTPEndpoint - } - - if len(in.HTTPTokens) > 0 { - obj["http_tokens"] = in.HTTPTokens - } - - if len(in.IamInstanceProfile) > 0 { - obj["iam_instance_profile"] = in.IamInstanceProfile - } - - obj["insecure_transport"] = in.InsecureTransport - - if len(in.InstanceType) > 0 { - obj["instance_type"] = in.InstanceType - } - - if len(in.KmsKey) > 0 { - obj["kms_key"] = in.KmsKey - } - - obj["monitoring"] = in.Monitoring - - if len(in.OpenPort) > 0 { - obj["open_port"] = toArrayInterface(in.OpenPort) - } - - obj["private_address_only"] = in.PrivateAddressOnly - - if len(in.Region) > 0 { - obj["region"] = in.Region - } - - obj["request_spot_instance"] = in.RequestSpotInstance - - if len(in.Retries) > 0 { - obj["retries"] = in.Retries - } - - if len(in.RootSize) > 0 { - obj["root_size"] = in.RootSize - } - - if len(in.SecretKey) > 0 { - obj["secret_key"] = in.SecretKey - } - - if len(in.SecurityGroup) > 0 { - obj["security_group"] = toArrayInterface(in.SecurityGroup) - } - - obj["security_group_readonly"] = in.SecurityGroupReadonly - - if len(in.SessionToken) > 0 { - obj["session_token"] = in.SessionToken - } - - if len(in.SpotPrice) > 0 { - obj["spot_price"] = in.SpotPrice - } - - if len(in.SSHKeypath) > 0 { - obj["ssh_keypath"] = in.SSHKeypath - } - - if len(in.SSHUser) > 0 { - obj["ssh_user"] = in.SSHUser - } - - if len(in.SubnetID) > 0 { - obj["subnet_id"] = in.SubnetID - } - - if len(in.Tags) > 0 { - obj["tags"] = in.Tags - } - - obj["use_ebs_optimized_instance"] = in.UseEbsOptimizedInstance - - obj["use_private_address"] = in.UsePrivateAddress - - if len(in.Userdata) > 0 { - obj["userdata"] = in.Userdata - } - - if len(in.VolumeType) > 0 { - obj["volume_type"] = in.VolumeType - } - - if len(in.VpcID) > 0 { - obj["vpc_id"] = in.VpcID - } - - if len(in.Zone) > 0 { - obj["zone"] = in.Zone - } - - return []interface{}{obj} -} - -// Expanders - -func expandAmazonec2Config(p []interface{}) *amazonec2Config { - obj := &amazonec2Config{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["access_key"].(string); ok && len(v) > 0 { - obj.AccessKey = v - } - - if v, ok := in["ami"].(string); ok && len(v) > 0 { - obj.Ami = v - } - - if v, ok := in["block_duration_minutes"].(string); ok && len(v) > 0 { - obj.BlockDurationMinutes = v - } - - if v, ok := in["device_name"].(string); ok && len(v) > 0 { - obj.DeviceName = v - } - - if v, ok := in["encrypt_ebs_volume"].(bool); ok { - obj.EncryptEbsVolume = v - } - - if v, ok := in["endpoint"].(string); ok && len(v) > 0 { - obj.Endpoint = v - } - - if v, ok := in["http_endpoint"].(string); ok && len(v) > 0 { - obj.HTTPEndpoint = v - } - - if v, ok := in["http_tokens"].(string); ok && len(v) > 0 { - obj.HTTPTokens = v - } - - if v, ok := in["iam_instance_profile"].(string); ok && len(v) > 0 { - obj.IamInstanceProfile = v - } - - if v, ok := in["insecure_transport"].(bool); ok { - obj.InsecureTransport = v - } - - if v, ok := in["instance_type"].(string); ok && len(v) > 0 { - obj.InstanceType = v - } - - if v, ok := in["kms_key"].(string); ok && len(v) > 0 { - obj.KmsKey = v - } - - if v, ok := in["monitoring"].(bool); ok { - obj.Monitoring = v - } - - if v, ok := in["open_port"].([]interface{}); ok && len(v) > 0 { - obj.OpenPort = toArrayString(v) - } - - if v, ok := in["private_address_only"].(bool); ok { - obj.PrivateAddressOnly = v - } - - if v, ok := in["region"].(string); ok && len(v) > 0 { - obj.Region = v - } - - if v, ok := in["request_spot_instance"].(bool); ok { - obj.RequestSpotInstance = v - } - - if v, ok := in["retries"].(string); ok && len(v) > 0 { - obj.Retries = v - } - - if v, ok := in["root_size"].(string); ok && len(v) > 0 { - obj.RootSize = v - } - - if v, ok := in["secret_key"].(string); ok && len(v) > 0 { - obj.SecretKey = v - } - - if v, ok := in["security_group"].([]interface{}); ok && len(v) > 0 { - obj.SecurityGroup = toArrayString(v) - } - - if v, ok := in["security_group_readonly"].(bool); ok { - obj.SecurityGroupReadonly = v - } - - if v, ok := in["session_token"].(string); ok && len(v) > 0 { - obj.SessionToken = v - } - - if v, ok := in["spot_price"].(string); ok && len(v) > 0 { - obj.SpotPrice = v - } - - if v, ok := in["ssh_keypath"].(string); ok && len(v) > 0 { - obj.SSHKeypath = v - } - - if v, ok := in["ssh_user"].(string); ok && len(v) > 0 { - obj.SSHUser = v - } - - if v, ok := in["subnet_id"].(string); ok && len(v) > 0 { - obj.SubnetID = v - } - - if v, ok := in["tags"].(string); ok && len(v) > 0 { - obj.Tags = v - } - - if v, ok := in["use_ebs_optimized_instance"].(bool); ok { - obj.UseEbsOptimizedInstance = v - } - - if v, ok := in["use_private_address"].(bool); ok { - obj.UsePrivateAddress = v - } - - if v, ok := in["userdata"].(string); ok && len(v) > 0 { - obj.Userdata = v - } - - if v, ok := in["volume_type"].(string); ok && len(v) > 0 { - obj.VolumeType = v - } - - if v, ok := in["vpc_id"].(string); ok && len(v) > 0 { - obj.VpcID = v - } - - if v, ok := in["zone"].(string); ok && len(v) > 0 { - obj.Zone = v - } - - return obj -} diff --git a/rancher2/structure_node_template_amazonec2_test.go b/rancher2/structure_node_template_amazonec2_test.go deleted file mode 100644 index 59db153e0..000000000 --- a/rancher2/structure_node_template_amazonec2_test.go +++ /dev/null @@ -1,152 +0,0 @@ -package rancher2 - -import ( - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" - - "testing" -) - -var ( - testNodeTemplateNodeTaintsConf []managementClient.Taint - testNodeTemplateAmazonEc2Conf amazonec2Config - testNodeTemplateAmazonEc2Interface map[string]interface{} - testNodeTemplateConf *NodeTemplate - testNodeTemplateSquashAmazonEc2ConfInterface map[string]interface{} - testNodeTemplateExpandAmazonEc2ConfInterface map[string]interface{} - testNodeTemplateNodeTaintsInterface interface{} -) - -func init() { - testNodeTemplateNodeTaintsConf = []managementClient.Taint{ - { - Key: "key", - Value: "value", - Effect: "recipient", - TimeAdded: "time_added", - }, - } - testNodeTemplateNodeTaintsInterface = []interface{}{ - map[string]interface{}{ - "key": "key", - "value": "value", - "effect": "recipient", - "time_added": "time_added", - }, - } - testNodeTemplateAmazonEc2Conf = amazonec2Config{ - Ami: "ubuntu", - DeviceName: "/dev/sda1", - HTTPTokens: "true", - HTTPEndpoint: "true", - EncryptEbsVolume: false, - InstanceType: "t2.micro", - BlockDurationMinutes: "0", - Region: "us-east-1", - Retries: "3", - RootSize: "16", - SpotPrice: "0.50", - VolumeType: "gp2", - SSHUser: "ubuntu", - Zone: "a", - } - testNodeTemplateAmazonEc2Interface = map[string]interface{}{ - "ami": "ubuntu", - "deviceName": "/dev/sda1", - "http_tokens": "true", - "http_endpoint": "true", - "encryptEbsVolume": "false", - "instanceType": "t2.micro", - "blockDurationMinutes": "0", - "region": "us-east-1", - "retries": "3", - "rootSize": "16", - "spotPrice": "0.50", - "volumeType": "gp2", - "sshUser": "ubuntu", - "zone": "a", - } - testNodeTemplateAnnotationsConf := map[string]string{ - "key": "value", - } - testNodeTemplateAnnotationsInterface := map[string]interface{}{ - "key": "value", - } - useInternalIP := false - testNodeTemplateConf = &NodeTemplate{ - NodeTemplate: managementClient.NodeTemplate{ - Driver: "amazonec2", - Annotations: testNodeTemplateAnnotationsConf, - CloudCredentialID: "abc-test-123", - NodeTaints: testNodeTemplateNodeTaintsConf, - EngineInstallURL: "http://fake.url", - Name: "test-node-template", - UseInternalIPAddress: &useInternalIP, - }, - Amazonec2Config: &testNodeTemplateAmazonEc2Conf, - } - testNodeTemplateSquashAmazonEc2ConfInterface = map[string]interface{}{ - "annotations": testNodeTemplateAnnotationsInterface, - "driver": "amazonec2", - "cloud_credential_id": "abc-test-123", - "use_internal_ip_address": useInternalIP, - "engine_install_url": "http://fake.url", - "name": "test-node-template", - } - - testNodeTemplateExpandAmazonEc2ConfInterface = map[string]interface{}{ - "annotations": testNodeTemplateAnnotationsInterface, - "node_taints": testNodeTemplateNodeTaintsInterface, - "driver": "amazonec2", - "cloud_credential_id": "abc-test-123", - "use_internal_ip_address": useInternalIP, - "engine_install_url": "http://fake.url", - "name": "test-node-template", - "amazonec2_config": []interface{}{testNodeTemplateAmazonEc2Interface}, - } - -} - -func TestFlattenNodeTemplate(t *testing.T) { - cases := []struct { - Input *NodeTemplate - ExpectedOutput map[string]interface{} - }{ - { - testNodeTemplateConf, - testNodeTemplateSquashAmazonEc2ConfInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, nodeTemplateFields(), map[string]interface{}{}) - err := flattenNodeTemplate(output, tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - expectedOutput := map[string]interface{}{} - for k := range tc.ExpectedOutput { - expectedOutput[k] = output.Get(k) - } - assert.Equal(t, tc.ExpectedOutput, expectedOutput, "Unexpected output from flattener.") - } -} - -func TestExpandNodeTemplate(t *testing.T) { - cases := []struct { - Input map[string]interface{} - ExpectedOutput *NodeTemplate - }{ - { - Input: testNodeTemplateExpandAmazonEc2ConfInterface, - ExpectedOutput: testNodeTemplateConf, - }, - } - - for _, tc := range cases { - inputData := schema.TestResourceDataRaw(t, nodeTemplateFields(), tc.Input) - output := expandNodeTemplate(inputData) - assert.Equal(t, tc.ExpectedOutput, output, "Unexpected output from expander.") - } -} diff --git a/rancher2/structure_node_template_azure.go b/rancher2/structure_node_template_azure.go deleted file mode 100644 index 04c6db7fa..000000000 --- a/rancher2/structure_node_template_azure.go +++ /dev/null @@ -1,263 +0,0 @@ -package rancher2 - -// Flatteners - -func flattenAzureConfig(in *azureConfig) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - if len(in.AvailabilitySet) > 0 { - obj["availability_set"] = in.AvailabilitySet - } - - if len(in.ClientID) > 0 { - obj["client_id"] = in.ClientID - } - - if len(in.ClientSecret) > 0 { - obj["client_secret"] = in.ClientSecret - } - - if len(in.CustomData) > 0 { - obj["custom_data"] = in.CustomData - } - - if len(in.DiskSize) > 0 { - obj["disk_size"] = in.DiskSize - } - - if len(in.DNS) > 0 { - obj["dns"] = in.DNS - } - - if len(in.Environment) > 0 { - obj["environment"] = in.Environment - } - - if len(in.FaultDomainCount) > 0 { - obj["fault_domain_count"] = in.FaultDomainCount - } - - if len(in.Image) > 0 { - obj["image"] = in.Image - } - - if len(in.Location) > 0 { - obj["location"] = in.Location - } - - obj["managed_disks"] = in.ManagedDisks - obj["no_public_ip"] = in.NoPublicIP - - if len(in.NSG) > 0 { - obj["nsg"] = in.NSG - } - - if len(in.Plan) > 0 { - obj["plan"] = in.Plan - } - - if len(in.OpenPort) > 0 { - obj["open_port"] = toArrayInterface(in.OpenPort) - } - - obj["private_address_only"] = in.PrivateAddressOnly - - if len(in.PrivateIPAddress) > 0 { - obj["private_ip_address"] = in.PrivateIPAddress - } - - if len(in.ResourceGroup) > 0 { - obj["resource_group"] = in.ResourceGroup - } - - if len(in.Size) > 0 { - obj["size"] = in.Size - } - - if len(in.SSHUser) > 0 { - obj["ssh_user"] = in.SSHUser - } - - obj["static_public_ip"] = in.StaticPublicIP - - if len(in.StorageType) > 0 { - obj["storage_type"] = in.StorageType - } - - if len(in.Subnet) > 0 { - obj["subnet"] = in.Subnet - } - - if len(in.SubnetPrefix) > 0 { - obj["subnet_prefix"] = in.SubnetPrefix - } - - if len(in.SubscriptionID) > 0 { - obj["subscription_id"] = in.SubscriptionID - } - - if len(in.UpdateDomainCount) > 0 { - obj["update_domain_count"] = in.UpdateDomainCount - } - - obj["use_private_ip"] = in.UsePrivateIP - obj["use_public_ip_standard_sku"] = in.UsePublicIPStandardSKU - obj["accelerated_networking"] = in.AcceleratedNetworking - - if len(in.Vnet) > 0 { - obj["vnet"] = in.Vnet - } - - if len(in.AvailabilityZone) > 0 { - obj["availability_zone"] = in.AvailabilityZone - } - - if len(in.Tags) > 0 { - obj["tags"] = in.Tags - } - - return []interface{}{obj} -} - -// Expanders - -func expandAzureConfig(p []interface{}) *azureConfig { - obj := &azureConfig{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["availability_set"].(string); ok && len(v) > 0 { - obj.AvailabilitySet = v - } - - if v, ok := in["client_id"].(string); ok && len(v) > 0 { - obj.ClientID = v - } - - if v, ok := in["client_secret"].(string); ok && len(v) > 0 { - obj.ClientSecret = v - } - - if v, ok := in["custom_data"].(string); ok && len(v) > 0 { - obj.CustomData = v - } - - if v, ok := in["disk_size"].(string); ok && len(v) > 0 { - obj.DiskSize = v - } - - if v, ok := in["dns"].(string); ok && len(v) > 0 { - obj.DNS = v - } - - if v, ok := in["environment"].(string); ok && len(v) > 0 { - obj.Environment = v - } - - if v, ok := in["fault_domain_count"].(string); ok && len(v) > 0 { - obj.FaultDomainCount = v - } - - if v, ok := in["image"].(string); ok && len(v) > 0 { - obj.Image = v - } - - if v, ok := in["location"].(string); ok && len(v) > 0 { - obj.Location = v - } - - if v, ok := in["managed_disks"].(bool); ok { - obj.ManagedDisks = v - } - - if v, ok := in["no_public_ip"].(bool); ok { - obj.NoPublicIP = v - } - - if v, ok := in["nsg"].(string); ok && len(v) > 0 { - obj.NSG = v - } - - if v, ok := in["plan"].(string); ok && len(v) > 0 { - obj.Plan = v - } - - if v, ok := in["open_port"].([]interface{}); ok && len(v) > 0 { - obj.OpenPort = toArrayString(v) - } - - if v, ok := in["private_address_only"].(bool); ok { - obj.PrivateAddressOnly = v - } - - if v, ok := in["private_ip_address"].(string); ok && len(v) > 0 { - obj.PrivateIPAddress = v - } - - if v, ok := in["resource_group"].(string); ok && len(v) > 0 { - obj.ResourceGroup = v - } - - if v, ok := in["size"].(string); ok && len(v) > 0 { - obj.Size = v - } - - if v, ok := in["ssh_user"].(string); ok && len(v) > 0 { - obj.SSHUser = v - } - - if v, ok := in["static_public_ip"].(bool); ok { - obj.StaticPublicIP = v - } - - if v, ok := in["storage_type"].(string); ok && len(v) > 0 { - obj.StorageType = v - } - - if v, ok := in["subnet"].(string); ok && len(v) > 0 { - obj.Subnet = v - } - - if v, ok := in["subnet_prefix"].(string); ok && len(v) > 0 { - obj.SubnetPrefix = v - } - - if v, ok := in["subscription_id"].(string); ok && len(v) > 0 { - obj.SubscriptionID = v - } - - if v, ok := in["update_domain_count"].(string); ok && len(v) > 0 { - obj.UpdateDomainCount = v - } - - if v, ok := in["use_private_ip"].(bool); ok { - obj.UsePrivateIP = v - } - - if v, ok := in["vnet"].(string); ok && len(v) > 0 { - obj.Vnet = v - } - - if v, ok := in["use_public_ip_standard_sku"].(bool); ok { - obj.UsePublicIPStandardSKU = v - } - - if v, ok := in["accelerated_networking"].(bool); ok { - obj.AcceleratedNetworking = v - } - - if v, ok := in["availability_zone"].(string); ok && len(v) > 0 { - obj.AvailabilityZone = v - } - - if v, ok := in["tags"].(string); ok && len(v) > 0 { - obj.Tags = v - } - - return obj -} diff --git a/rancher2/structure_node_template_azure_test.go b/rancher2/structure_node_template_azure_test.go deleted file mode 100644 index ff0125b5e..000000000 --- a/rancher2/structure_node_template_azure_test.go +++ /dev/null @@ -1,194 +0,0 @@ -package rancher2 - -import ( - "reflect" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - managementClient "github.com/rancher/rancher/pkg/client/generated/management/v3" - "github.com/stretchr/testify/assert" -) - -var ( - testAzureNodeTemplateNodeTaintsConf []managementClient.Taint - testAzureNodeTemplateNodeTaintsInterface interface{} - testNodeTemplateAzureConf azureConfig - testAzureNodeTemplateInterface map[string]interface{} - testAzureNodeTemplateConf *NodeTemplate - testNodeTemplateSquashAzureConfInterface map[string]interface{} - testNodeTemplateExpandAzureConfInterface map[string]interface{} -) - -func init() { - testAzureNodeTemplateNodeTaintsConf = []managementClient.Taint{ - { - Key: "key", - Value: "value", - Effect: "recipient", - TimeAdded: "time_added", - }, - } - testAzureNodeTemplateNodeTaintsInterface = []interface{}{ - map[string]interface{}{ - "key": "key", - "value": "value", - "effect": "recipient", - "time_added": "time_added", - }, - } - testNodeTemplateAzureConf = azureConfig{ - AvailabilitySet: "docker-machine", - ClientID: "test-id", - ClientSecret: "test-secret", - CustomData: "test-data", - DiskSize: "32gb", - DNS: "1.1.1.1", - Environment: "prod", - FaultDomainCount: "3", - Image: "ubuntu", - Location: "us-east-1", - ManagedDisks: false, - NoPublicIP: false, - NSG: "test-nsg", - Plan: "test-plan", - OpenPort: nil, - PrivateAddressOnly: false, - PrivateIPAddress: "1.1.1.1", - ResourceGroup: "test-rg", - Size: "large", - SSHUser: "user", - StaticPublicIP: false, - StorageType: "hdd", - Subnet: "1.1.1.1", - SubnetPrefix: "1.1.1.1", - SubscriptionID: "sub-id", - UpdateDomainCount: "3", - UsePrivateIP: false, - Vnet: "test-vnet", - Tags: "key1,value1", - UsePublicIPStandardSKU: true, - AvailabilityZone: "1", - AcceleratedNetworking: true, - } - testAzureNodeTemplateInterface = map[string]interface{}{ - "availability_set": "docker-machine", - "client_id": "test-id", - "client_secret": "test-secret", - "custom_data": "test-data", - "disk_size": "32gb", - "dns": "1.1.1.1", - "environment": "prod", - "fault_domain-count": "3", - "image": "ubuntu", - "location": "us-east-1", - "managed_disks": false, - "no_public_ip": false, - "nsg": "test-nsg", - "plan": "test-plan", - "open_port": nil, - "private_address_only": false, - "private_ip_address": "1.1.1.1", - "resource_group": "test-rg", - "size": "large", - "ssh_user": "user", - "static_public_ip": false, - "storage_type": "hdd", - "subnet": "1.1.1.1", - "subnet_prefix": "1.1.1.1", - "subscription_id": "sub-id", - "update_domain_count": "3", - "use_private_ip": false, - "vnet": "test-vnet", - "tags": "key1,value1", - "use_public_ip_standard_sku": true, - "availability_zone": "1", - "accelerated_networking": true, - } - testAzureNodeTemplateAnnotationsConf := map[string]string{ - "key": "value", - } - testAzureNodeTemplateAnnotationsInterface := map[string]interface{}{ - "key": "value", - } - - useInternalIP := false - testAzureNodeTemplateConf = &NodeTemplate{ - NodeTemplate: managementClient.NodeTemplate{ - Driver: "azure", - UseInternalIPAddress: &useInternalIP, - Annotations: testAzureNodeTemplateAnnotationsConf, - CloudCredentialID: "abc-test-123", - NodeTaints: testAzureNodeTemplateNodeTaintsConf, - EngineInstallURL: "http://fake.url", - Name: "test-node-template", - }, - AzureConfig: &testNodeTemplateAzureConf, - } - - testNodeTemplateSquashAzureConfInterface = map[string]interface{}{ - "annotations": testAzureNodeTemplateAnnotationsInterface, - "driver": "azure", - "cloud_credential_id": "abc-test-123", - "use_internal_ip_address": useInternalIP, - "engine_install_url": "http://fake.url", - "name": "test-node-template", - } - - testNodeTemplateExpandAzureConfInterface = map[string]interface{}{ - "annotations": testAzureNodeTemplateAnnotationsInterface, - "node_taints": testAzureNodeTemplateNodeTaintsInterface, - "driver": "azure", - "cloud_credential_id": "abc-test-123", - "use_internal_ip_address": useInternalIP, - "engine_install_url": "http://fake.url", - "name": "test-node-template", - "azure_config": []interface{}{testAzureNodeTemplateInterface}, - } -} - -func TestFlattenAzureNodeTemplate(t *testing.T) { - cases := []struct { - Input *NodeTemplate - ExpectedOutput map[string]interface{} - }{ - { - testAzureNodeTemplateConf, - testNodeTemplateSquashAzureConfInterface, - }, - } - - for _, tc := range cases { - output := schema.TestResourceDataRaw(t, nodeTemplateFields(), map[string]interface{}{}) - err := flattenNodeTemplate(output, tc.Input) - if err != nil { - assert.FailNow(t, "[ERROR] on flattener: %#v", err) - } - expectedOutput := map[string]interface{}{} - for k := range tc.ExpectedOutput { - expectedOutput[k] = output.Get(k) - } - if !reflect.DeepEqual(expectedOutput, tc.ExpectedOutput) { - assert.FailNow(t, "Unexpected output from flattener.\nExpected: %#v\nGiven: %#v", expectedOutput, tc.ExpectedOutput) - } - } -} - -func TestExpandAzureNodeTemplate(t *testing.T) { - cases := []struct { - Input map[string]interface{} - ExpectedOutput *NodeTemplate - }{ - { - Input: testNodeTemplateExpandAzureConfInterface, - ExpectedOutput: testAzureNodeTemplateConf, - }, - } - - for _, tc := range cases { - inputData := schema.TestResourceDataRaw(t, nodeTemplateFields(), tc.Input) - output := expandNodeTemplate(inputData) - if !reflect.DeepEqual(output, tc.ExpectedOutput) { - assert.FailNow(t, "Unexpected output from flattener.\nExpected: %#v\nGiven: %#v", tc.ExpectedOutput, tc.ExpectedOutput) - } - } -} diff --git a/rancher2/structure_node_template_digitalocean.go b/rancher2/structure_node_template_digitalocean.go deleted file mode 100644 index 1a2e61059..000000000 --- a/rancher2/structure_node_template_digitalocean.go +++ /dev/null @@ -1,125 +0,0 @@ -package rancher2 - -// Flatteners - -func flattenDigitaloceanConfig(in *digitaloceanConfig) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - if len(in.AccessToken) > 0 { - obj["access_token"] = in.AccessToken - } - - obj["backups"] = in.Backups - - if len(in.Image) > 0 { - obj["image"] = in.Image - } - - obj["ipv6"] = in.IPV6 - obj["monitoring"] = in.Monitoring - obj["private_networking"] = in.PrivateNetworking - - if len(in.Region) > 0 { - obj["region"] = in.Region - } - - if len(in.Size) > 0 { - obj["size"] = in.Size - } - - if len(in.SSHKeyFingerprint) > 0 { - obj["ssh_key_fingerprint"] = in.SSHKeyFingerprint - } - - if len(in.SSHKeyPath) > 0 { - obj["ssh_key_path"] = in.SSHKeyPath - } - - if len(in.SSHPort) > 0 { - obj["ssh_port"] = in.SSHPort - } - - if len(in.SSHUser) > 0 { - obj["ssh_user"] = in.SSHUser - } - - if len(in.Tags) > 0 { - obj["tags"] = in.Tags - } - - if len(in.Userdata) > 0 { - obj["userdata"] = in.Userdata - } - - return []interface{}{obj} -} - -// Expanders - -func expandDigitaloceanConfig(p []interface{}) *digitaloceanConfig { - obj := &digitaloceanConfig{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["access_token"].(string); ok && len(v) > 0 { - obj.AccessToken = v - } - - if v, ok := in["backups"].(bool); ok { - obj.Backups = v - } - - if v, ok := in["image"].(string); ok && len(v) > 0 { - obj.Image = v - } - - if v, ok := in["ipv6"].(bool); ok { - obj.IPV6 = v - } - - if v, ok := in["monitoring"].(bool); ok { - obj.Monitoring = v - } - if v, ok := in["private_networking"].(bool); ok { - obj.PrivateNetworking = v - } - - if v, ok := in["region"].(string); ok && len(v) > 0 { - obj.Region = v - } - - if v, ok := in["size"].(string); ok && len(v) > 0 { - obj.Size = v - } - - if v, ok := in["ssh_key_fingerprint"].(string); ok && len(v) > 0 { - obj.SSHKeyFingerprint = v - } - - if v, ok := in["ssh_key_path"].(string); ok && len(v) > 0 { - obj.SSHKeyPath = v - } - - if v, ok := in["ssh_port"].(string); ok && len(v) > 0 { - obj.SSHPort = v - } - - if v, ok := in["ssh_user"].(string); ok && len(v) > 0 { - obj.SSHUser = v - } - - if v, ok := in["tags"].(string); ok && len(v) > 0 { - obj.Tags = v - } - - if v, ok := in["userdata"].(string); ok && len(v) > 0 { - obj.Userdata = v - } - - return obj -} diff --git a/rancher2/structure_node_template_harvester.go b/rancher2/structure_node_template_harvester.go deleted file mode 100644 index 7d4aae242..000000000 --- a/rancher2/structure_node_template_harvester.go +++ /dev/null @@ -1,144 +0,0 @@ -package rancher2 - -// Flatteners - -func flattenHarvesterConfig(in *harvesterConfig) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - if len(in.VMNamespace) > 0 { - obj["vm_namespace"] = in.VMNamespace - } - - if len(in.VMAffinity) > 0 { - obj["vm_affinity"] = in.VMAffinity - } - - if len(in.CPUCount) > 0 { - obj["cpu_count"] = in.CPUCount - } - - if len(in.MemorySize) > 0 { - obj["memory_size"] = in.MemorySize - } - - if len(in.DiskSize) > 0 { - obj["disk_size"] = in.DiskSize - } - - if len(in.DiskBus) > 0 { - obj["disk_bus"] = in.DiskBus - } - - if len(in.ImageName) > 0 { - obj["image_name"] = in.ImageName - } - - if len(in.DiskInfo) > 0 { - obj["disk_info"] = in.DiskInfo - } - - if len(in.SSHUser) > 0 { - obj["ssh_user"] = in.SSHUser - } - - if len(in.SSHPassword) > 0 { - obj["ssh_password"] = in.SSHPassword - } - - if len(in.NetworkName) > 0 { - obj["network_name"] = in.NetworkName - } - - if len(in.NetworkModel) > 0 { - obj["network_model"] = in.NetworkModel - } - - if len(in.NetworkInfo) > 0 { - obj["network_info"] = in.NetworkInfo - } - - if len(in.UserData) > 0 { - obj["user_data"] = in.UserData - } - - if len(in.NetworkData) > 0 { - obj["network_data"] = in.NetworkData - } - - return []interface{}{obj} -} - -// Expanders - -func expandHarvestercloudConfig(p []interface{}) *harvesterConfig { - obj := &harvesterConfig{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["vm_namespace"].(string); ok && len(v) > 0 { - obj.VMNamespace = v - } - - if v, ok := in["vm_affinity"].(string); ok && len(v) > 0 { - obj.VMAffinity = v - } - - if v, ok := in["cpu_count"].(string); ok && len(v) > 0 { - obj.CPUCount = v - } - - if v, ok := in["memory_size"].(string); ok && len(v) > 0 { - obj.MemorySize = v - } - - if v, ok := in["disk_size"].(string); ok && len(v) > 0 { - obj.DiskSize = v - } - - if v, ok := in["disk_bus"].(string); ok && len(v) > 0 { - obj.DiskBus = v - } - - if v, ok := in["image_name"].(string); ok && len(v) > 0 { - obj.ImageName = v - } - - if v, ok := in["disk_info"].(string); ok && len(v) > 0 { - obj.DiskInfo = v - } - - if v, ok := in["ssh_user"].(string); ok && len(v) > 0 { - obj.SSHUser = v - } - - if v, ok := in["ssh_password"].(string); ok && len(v) > 0 { - obj.SSHPassword = v - } - - if v, ok := in["network_name"].(string); ok && len(v) > 0 { - obj.NetworkName = v - } - - if v, ok := in["network_model"].(string); ok && len(v) > 0 { - obj.NetworkModel = v - } - - if v, ok := in["network_info"].(string); ok && len(v) > 0 { - obj.NetworkInfo = v - } - - if v, ok := in["user_data"].(string); ok && len(v) > 0 { - obj.UserData = v - } - - if v, ok := in["network_data"].(string); ok && len(v) > 0 { - obj.NetworkData = v - } - - return obj -} diff --git a/rancher2/structure_node_template_hetzner.go b/rancher2/structure_node_template_hetzner.go deleted file mode 100644 index f2d3ee507..000000000 --- a/rancher2/structure_node_template_hetzner.go +++ /dev/null @@ -1,96 +0,0 @@ -package rancher2 - -import "strings" - -// Flatteners - -func flattenHetznerConfig(in *hetznerConfig) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - if len(in.APIToken) > 0 { - obj["api_token"] = in.APIToken - } - - if len(in.Image) > 0 { - obj["image"] = in.Image - } - - if len(in.ServerLabels) > 0 { - obj["server_labels"] = toMapInterface(in.ServerLabels) - } - - if len(in.ServerLocation) > 0 { - obj["server_location"] = in.ServerLocation - } - - if len(in.ServerType) > 0 { - obj["server_type"] = in.ServerType - } - - if len(in.Networks) > 0 { - obj["networks"] = strings.Join(in.Networks, ",") - } - - obj["use_private_network"] = in.UsePrivateNetwork - - if len(in.UserData) > 0 { - obj["userdata"] = in.UserData - } - - if len(in.Volumes) > 0 { - obj["volumes"] = strings.Join(in.Volumes, ",") - } - - return []interface{}{obj} -} - -// Expanders - -func expandHetznercloudConfig(p []interface{}) *hetznerConfig { - obj := &hetznerConfig{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["api_token"].(string); ok && len(v) > 0 { - obj.APIToken = v - } - - if v, ok := in["image"].(string); ok && len(v) > 0 { - obj.Image = v - } - - if v, ok := in["server_labels"].(map[string]interface{}); ok && len(v) > 0 { - obj.ServerLabels = toMapString(v) - } - - if v, ok := in["server_location"].(string); ok && len(v) > 0 { - obj.ServerLocation = v - } - - if v, ok := in["server_type"].(string); ok && len(v) > 0 { - obj.ServerType = v - } - - if v, ok := in["networks"].(string); ok && len(v) > 0 { - obj.Networks = strings.Split(v, ",") - } - - if v, ok := in["use_private_network"].(bool); ok { - obj.UsePrivateNetwork = v - } - - if v, ok := in["userdata"].(string); ok && len(v) > 0 { - obj.UserData = v - } - - if v, ok := in["volumes"].(string); ok && len(v) > 0 { - obj.Volumes = strings.Split(v, ",") - } - - return obj -} diff --git a/rancher2/structure_node_template_linode.go b/rancher2/structure_node_template_linode.go deleted file mode 100644 index 4ace7fd8b..000000000 --- a/rancher2/structure_node_template_linode.go +++ /dev/null @@ -1,150 +0,0 @@ -package rancher2 - -// Flatteners - -func flattenLinodeConfig(in *linodeConfig) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - if len(in.AuthorizedUsers) > 0 { - obj["authorized_users"] = in.AuthorizedUsers - } - - obj["create_private_ip"] = in.CreatePrivateIP - - if len(in.DockerPort) > 0 { - obj["docker_port"] = in.DockerPort - } - - if len(in.Image) > 0 { - obj["image"] = in.Image - } - - if len(in.InstanceType) > 0 { - obj["instance_type"] = in.InstanceType - } - - if len(in.Label) > 0 { - obj["label"] = in.Label - } - - if len(in.Region) > 0 { - obj["region"] = in.Region - } - - if len(in.RootPass) > 0 { - obj["root_pass"] = in.RootPass - } - - if len(in.SSHPort) > 0 { - obj["ssh_port"] = in.SSHPort - } - - if len(in.SSHUser) > 0 { - obj["ssh_user"] = in.SSHUser - } - - if len(in.StackScript) > 0 { - obj["stackscript"] = in.StackScript - } - - if len(in.StackscriptData) > 0 { - obj["stackscript_data"] = in.StackscriptData - } - - if len(in.SwapSize) > 0 { - obj["swap_size"] = in.SwapSize - } - - if len(in.Tags) > 0 { - obj["tags"] = in.Tags - } - - if len(in.Token) > 0 { - obj["token"] = in.Token - } - - if len(in.UAPrefix) > 0 { - obj["ua_prefix"] = in.UAPrefix - } - - return []interface{}{obj} -} - -// Expanders - -func expandLinodeConfig(p []interface{}) *linodeConfig { - obj := &linodeConfig{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["authorized_users"].(string); ok && len(v) > 0 { - obj.AuthorizedUsers = v - } - - if v, ok := in["create_private_ip"].(bool); ok { - obj.CreatePrivateIP = v - } - - if v, ok := in["docker_port"].(string); ok && len(v) > 0 { - obj.DockerPort = v - } - - if v, ok := in["image"].(string); ok && len(v) > 0 { - obj.Image = v - } - - if v, ok := in["instance_type"].(string); ok && len(v) > 0 { - obj.InstanceType = v - } - - if v, ok := in["label"].(string); ok && len(v) > 0 { - obj.Label = v - } - - if v, ok := in["region"].(string); ok && len(v) > 0 { - obj.Region = v - } - - if v, ok := in["root_pass"].(string); ok && len(v) > 0 { - obj.RootPass = v - } - - if v, ok := in["ssh_port"].(string); ok && len(v) > 0 { - obj.SSHPort = v - } - - if v, ok := in["ssh_user"].(string); ok && len(v) > 0 { - obj.SSHUser = v - } - - if v, ok := in["stackscript"].(string); ok && len(v) > 0 { - obj.StackScript = v - } - - if v, ok := in["stackscript_data"].(string); ok && len(v) > 0 { - obj.StackscriptData = v - } - - if v, ok := in["swap_size"].(string); ok && len(v) > 0 { - obj.SwapSize = v - } - - if v, ok := in["tags"].(string); ok && len(v) > 0 { - obj.Tags = v - } - - if v, ok := in["token"].(string); ok && len(v) > 0 { - obj.Token = v - } - - if v, ok := in["ua_prefix"].(string); ok && len(v) > 0 { - obj.UAPrefix = v - } - - return obj -} diff --git a/rancher2/structure_node_template_opennebula.go b/rancher2/structure_node_template_opennebula.go deleted file mode 100644 index 42dda9197..000000000 --- a/rancher2/structure_node_template_opennebula.go +++ /dev/null @@ -1,102 +0,0 @@ -package rancher2 - -// Flatteners - -func flattenOpenNebulaConfig(in *opennebulaConfig) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - obj["b2d_size"] = in.B2dSize - obj["dev_prefix"] = in.DevPrefix - obj["disk_resize"] = in.DiskResize - obj["image_name"] = in.ImageName - obj["memory"] = in.Memory - obj["network_name"] = in.NetworkName - obj["password"] = in.Password - obj["template_id"] = in.TemplateID - obj["user"] = in.User - obj["xml_rpc_url"] = in.XMLRPCURL - obj["cpu"] = in.CPU - obj["disable_vnc"] = in.DisableVnc - obj["image_id"] = in.ImageID - obj["image_owner"] = in.ImageOwner - obj["network_id"] = in.NetworkID - obj["network_owner"] = in.NetworkOwner - obj["ssh_user"] = in.SSHUser - obj["template_name"] = in.TemplateName - obj["vcpu"] = in.Vcpu - - return []interface{}{obj} -} - -// Expanders - -func expandOpennebulaConfig(p []interface{}) *opennebulaConfig { - obj := &opennebulaConfig{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["b2d_size"].(string); ok && len(v) > 0 { - obj.B2dSize = v - } - if v, ok := in["dev_prefix"].(string); ok && len(v) > 0 { - obj.DevPrefix = v - } - if v, ok := in["disk_resize"].(string); ok && len(v) > 0 { - obj.DiskResize = v - } - if v, ok := in["image_name"].(string); ok && len(v) > 0 { - obj.ImageName = v - } - if v, ok := in["memory"].(string); ok && len(v) > 0 { - obj.Memory = v - } - if v, ok := in["network_name"].(string); ok && len(v) > 0 { - obj.NetworkName = v - } - if v, ok := in["password"].(string); ok && len(v) > 0 { - obj.Password = v - } - if v, ok := in["template_id"].(string); ok && len(v) > 0 { - obj.TemplateID = v - } - if v, ok := in["user"].(string); ok && len(v) > 0 { - obj.User = v - } - if v, ok := in["xml_rpc_url"].(string); ok && len(v) > 0 { - obj.XMLRPCURL = v - } - if v, ok := in["cpu"].(string); ok && len(v) > 0 { - obj.CPU = v - } - if v, ok := in["disable_vnc"].(bool); ok { - obj.DisableVnc = v - } - if v, ok := in["image_id"].(string); ok && len(v) > 0 { - obj.ImageID = v - } - if v, ok := in["image_owner"].(string); ok && len(v) > 0 { - obj.ImageOwner = v - } - if v, ok := in["network_id"].(string); ok && len(v) > 0 { - obj.NetworkID = v - } - if v, ok := in["network_owner"].(string); ok && len(v) > 0 { - obj.NetworkOwner = v - } - if v, ok := in["ssh_user"].(string); ok && len(v) > 0 { - obj.SSHUser = v - } - if v, ok := in["template_name"].(string); ok && len(v) > 0 { - obj.TemplateName = v - } - if v, ok := in["vcpu"].(string); ok && len(v) > 0 { - obj.Vcpu = v - } - - return obj -} diff --git a/rancher2/structure_node_template_openstack.go b/rancher2/structure_node_template_openstack.go deleted file mode 100644 index 8313bc8ee..000000000 --- a/rancher2/structure_node_template_openstack.go +++ /dev/null @@ -1,180 +0,0 @@ -package rancher2 - -// Flatteners - -func flattenOpenstackConfig(in *openstackConfig) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - obj["active_timeout"] = in.ActiveTimeout - obj["auth_url"] = in.AuthURL - obj["availability_zone"] = in.AvailabilityZone - obj["cacert"] = in.CaCert - obj["config_drive"] = in.ConfigDrive - obj["domain_id"] = in.DomainID - obj["domain_name"] = in.DomainName - obj["endpoint_type"] = in.EndpointType - obj["flavor_id"] = in.FlavorID - obj["flavor_name"] = in.FlavorName - obj["floating_ip_pool"] = in.FloatingIPPool - obj["image_id"] = in.ImageID - obj["image_name"] = in.ImageName - obj["insecure"] = in.Insecure - obj["ip_version"] = in.IPVersion - obj["keypair_name"] = in.KeypairName - obj["net_id"] = in.NetID - obj["net_name"] = in.NetName - obj["nova_network"] = in.NovaNetwork - obj["password"] = in.Password - obj["private_key_file"] = in.PrivateKeyFile - obj["region"] = in.Region - obj["sec_groups"] = in.SecGroups - obj["ssh_port"] = in.SSHPort - obj["ssh_user"] = in.SSHUser - obj["tenant_id"] = in.TenantID - obj["tenant_name"] = in.TenantName - obj["user_data_file"] = in.UserDataFile - obj["username"] = in.Username - obj["application_credential_id"] = in.ApplicationCredentialID - obj["application_credential_name"] = in.ApplicationCredentialName - obj["application_credential_secret"] = in.ApplicationCredentialSecret - obj["boot_from_volume"] = in.BootFromVolume - obj["volume_size"] = in.VolumeSize - obj["volume_type"] = in.VolumeType - obj["volume_id"] = in.VolumeID - obj["volume_name"] = in.VolumeName - obj["volume_device_path"] = in.VolumeDevicePath - - return []interface{}{obj} -} - -// Expanders - -func expandOpenstackConfig(p []interface{}) *openstackConfig { - obj := &openstackConfig{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["active_timeout"].(string); ok && len(v) > 0 { - obj.ActiveTimeout = v - } - if v, ok := in["auth_url"].(string); ok && len(v) > 0 { - obj.AuthURL = v - } - if v, ok := in["availability_zone"].(string); ok && len(v) > 0 { - obj.AvailabilityZone = v - } - if v, ok := in["cacert"].(string); ok && len(v) > 0 { - obj.CaCert = v - } - if v, ok := in["config_drive"].(bool); ok { - obj.ConfigDrive = v - } - if v, ok := in["domain_id"].(string); ok && len(v) > 0 { - obj.DomainID = v - } - if v, ok := in["domain_name"].(string); ok && len(v) > 0 { - obj.DomainName = v - } - if v, ok := in["endpoint_type"].(string); ok && len(v) > 0 { - obj.EndpointType = v - } - if v, ok := in["flavor_id"].(string); ok && len(v) > 0 { - obj.FlavorID = v - } - if v, ok := in["flavor_name"].(string); ok && len(v) > 0 { - obj.FlavorName = v - } - if v, ok := in["floating_ip_pool"].(string); ok && len(v) > 0 { - obj.FloatingIPPool = v - } - if v, ok := in["ip_version"].(string); ok && len(v) > 0 { - obj.IPVersion = v - } - if v, ok := in["image_id"].(string); ok && len(v) > 0 { - obj.ImageID = v - } - if v, ok := in["image_name"].(string); ok && len(v) > 0 { - obj.ImageName = v - } - if v, ok := in["insecure"].(bool); ok { - obj.Insecure = v - } - if v, ok := in["ip_version"].(string); ok && len(v) > 0 { - obj.IPVersion = v - } - if v, ok := in["keypair_name"].(string); ok && len(v) > 0 { - obj.KeypairName = v - } - if v, ok := in["net_id"].(string); ok && len(v) > 0 { - obj.NetID = v - } - if v, ok := in["net_name"].(string); ok && len(v) > 0 { - obj.NetName = v - } - if v, ok := in["nova_network"].(bool); ok { - obj.NovaNetwork = v - } - if v, ok := in["password"].(string); ok && len(v) > 0 { - obj.Password = v - } - if v, ok := in["private_key_file"].(string); ok && len(v) > 0 { - obj.PrivateKeyFile = v - } - if v, ok := in["region"].(string); ok && len(v) > 0 { - obj.Region = v - } - if v, ok := in["sec_groups"].(string); ok && len(v) > 0 { - obj.SecGroups = v - } - if v, ok := in["ssh_port"].(string); ok && len(v) > 0 { - obj.SSHPort = v - } - if v, ok := in["ssh_user"].(string); ok && len(v) > 0 { - obj.SSHUser = v - } - if v, ok := in["tenant_id"].(string); ok && len(v) > 0 { - obj.TenantID = v - } - if v, ok := in["tenant_name"].(string); ok && len(v) > 0 { - obj.TenantName = v - } - if v, ok := in["user_data_file"].(string); ok && len(v) > 0 { - obj.UserDataFile = v - } - if v, ok := in["username"].(string); ok && len(v) > 0 { - obj.Username = v - } - if v, ok := in["application_credential_id"].(string); ok && len(v) > 0 { - obj.ApplicationCredentialID = v - } - if v, ok := in["application_credential_name"].(string); ok && len(v) > 0 { - obj.ApplicationCredentialName = v - } - if v, ok := in["application_credential_secret"].(string); ok && len(v) > 0 { - obj.ApplicationCredentialSecret = v - } - if v, ok := in["boot_from_volume"].(bool); ok { - obj.BootFromVolume = v - } - if v, ok := in["volume_size"].(string); ok && len(v) > 0 { - obj.VolumeSize = v - } - if v, ok := in["volume_type"].(string); ok && len(v) > 0 { - obj.VolumeType = v - } - if v, ok := in["volume_id"].(string); ok && len(v) > 0 { - obj.VolumeID = v - } - if v, ok := in["volume_name"].(string); ok && len(v) > 0 { - obj.VolumeName = v - } - if v, ok := in["volume_device_path"].(string); ok && len(v) > 0 { - obj.VolumeDevicePath = v - } - return obj -} diff --git a/rancher2/structure_node_template_outscale.go b/rancher2/structure_node_template_outscale.go deleted file mode 100644 index b078c229f..000000000 --- a/rancher2/structure_node_template_outscale.go +++ /dev/null @@ -1,107 +0,0 @@ -package rancher2 - -// Flatteners - -func flattenOutscaleConfig(in *outscaleConfig) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - if len(in.AccessKey) > 0 { - obj["access_key"] = in.AccessKey - } - - if len(in.SourceOmi) > 0 { - obj["source_omi"] = in.SourceOmi - } - - if len(in.InstanceType) > 0 { - obj["instance_type"] = in.InstanceType - } - - if len(in.Region) > 0 { - obj["region"] = in.Region - } - - if len(in.SecretKey) > 0 { - obj["secret_key"] = in.SecretKey - } - - if len(in.SecurityGroupIds) > 0 { - obj["security_group_ids"] = toArrayInterface(in.SecurityGroupIds) - } - - if len(in.ExtraTagsAll) > 0 { - obj["extra_tags_all"] = toArrayInterface(in.ExtraTagsAll) - } - - if len(in.ExtraTagsInstances) > 0 { - obj["extra_tags_instances"] = toArrayInterface(in.ExtraTagsInstances) - } - - if len(in.RootDiskType) > 0 { - obj["root_disk_type"] = in.RootDiskType - } - - obj["root_disk_size"] = in.RootDiskSize - obj["root_disk_iops"] = in.RootDiskIops - - return []interface{}{obj} -} - -// Expanders - -func expandOutscaleConfig(p []interface{}) *outscaleConfig { - obj := &outscaleConfig{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["access_key"].(string); ok && len(v) > 0 { - obj.AccessKey = v - } - - if v, ok := in["source_omi"].(string); ok && len(v) > 0 { - obj.SourceOmi = v - } - - if v, ok := in["instance_type"].(string); ok && len(v) > 0 { - obj.InstanceType = v - } - - if v, ok := in["region"].(string); ok && len(v) > 0 { - obj.Region = v - } - - if v, ok := in["secret_key"].(string); ok && len(v) > 0 { - obj.SecretKey = v - } - - if v, ok := in["security_group_ids"].([]interface{}); ok && len(v) > 0 { - obj.SecurityGroupIds = toArrayString(v) - } - - if v, ok := in["extra_tags_all"].([]interface{}); ok && len(v) > 0 { - obj.ExtraTagsAll = toArrayString(v) - } - - if v, ok := in["extra_tags_instances"].([]interface{}); ok && len(v) > 0 { - obj.ExtraTagsInstances = toArrayString(v) - } - - if v, ok := in["root_disk_type"].(string); ok && len(v) > 0 { - obj.RootDiskType = v - } - - if v, ok := in["root_disk_size"].(int); ok { - obj.RootDiskSize = v - } - - if v, ok := in["root_disk_iops"].(int); ok { - obj.RootDiskIops = v - } - - return obj -} diff --git a/rancher2/structure_node_template_vsphere.go b/rancher2/structure_node_template_vsphere.go deleted file mode 100644 index 13db642ce..000000000 --- a/rancher2/structure_node_template_vsphere.go +++ /dev/null @@ -1,218 +0,0 @@ -package rancher2 - -// Flatteners - -func flattenVsphereConfig(in *vmwarevsphereConfig) []interface{} { - obj := make(map[string]interface{}) - if in == nil { - return []interface{}{} - } - - if len(in.Boot2dockerURL) > 0 { - obj["boot2docker_url"] = in.Boot2dockerURL - } - if len(in.Cfgparam) > 0 { - obj["cfgparam"] = toArrayInterface(in.Cfgparam) - } - if len(in.CloneFrom) > 0 { - obj["clone_from"] = in.CloneFrom - } - if len(in.CloudConfig) > 0 { - obj["cloud_config"] = in.CloudConfig - } - if len(in.Cloudinit) > 0 { - obj["cloudinit"] = in.Cloudinit - } - if len(in.ContentLibrary) > 0 { - obj["content_library"] = in.ContentLibrary - } - if len(in.CPUCount) > 0 { - obj["cpu_count"] = in.CPUCount - } - if len(in.CreationType) > 0 { - obj["creation_type"] = in.CreationType - } - if len(in.CustomAttributes) > 0 { - obj["custom_attributes"] = toArrayInterface(in.CustomAttributes) - } - if len(in.Datacenter) > 0 { - obj["datacenter"] = in.Datacenter - } - if len(in.Datastore) > 0 { - obj["datastore"] = in.Datastore - } - if len(in.DatastoreCluster) > 0 { - obj["datastore_cluster"] = in.DatastoreCluster - } - if len(in.DiskSize) > 0 { - obj["disk_size"] = in.DiskSize - } - if len(in.Folder) > 0 { - obj["folder"] = in.Folder - } - if len(in.Hostsystem) > 0 { - obj["hostsystem"] = in.Hostsystem - } - if len(in.MemorySize) > 0 { - obj["memory_size"] = in.MemorySize - } - if len(in.Network) > 0 { - obj["network"] = toArrayInterface(in.Network) - } - if len(in.Password) > 0 { - obj["password"] = in.Password - } - if len(in.Pool) > 0 { - obj["pool"] = in.Pool - } - if len(in.SSHPassword) > 0 { - obj["ssh_password"] = in.SSHPassword - } - if len(in.SSHPort) > 0 { - obj["ssh_port"] = in.SSHPort - } - if len(in.SSHUser) > 0 { - obj["ssh_user"] = in.SSHUser - } - if len(in.SSHUserGroup) > 0 { - obj["ssh_user_group"] = in.SSHUserGroup - } - if len(in.Tags) > 0 { - obj["tags"] = toArrayInterface(in.Tags) - } - if len(in.Username) > 0 { - obj["username"] = in.Username - } - if len(in.VappIpallocationpolicy) > 0 { - obj["vapp_ip_allocation_policy"] = in.VappIpallocationpolicy - } - if len(in.VappIpprotocol) > 0 { - obj["vapp_ip_protocol"] = in.VappIpprotocol - } - if len(in.VappProperty) > 0 { - obj["vapp_property"] = toArrayInterface(in.VappProperty) - } - if len(in.VappTransport) > 0 { - obj["vapp_transport"] = in.VappTransport - } - if len(in.Vcenter) > 0 { - obj["vcenter"] = in.Vcenter - } - if len(in.VcenterPort) > 0 { - obj["vcenter_port"] = in.VcenterPort - } - if len(in.GracefulShutdownTimeout) > 0 { - obj["graceful_shutdown_timeout"] = in.GracefulShutdownTimeout - } - - return []interface{}{obj} -} - -// Expanders - -func expandVsphereConfig(p []interface{}) *vmwarevsphereConfig { - obj := &vmwarevsphereConfig{} - if len(p) == 0 || p[0] == nil { - return obj - } - in := p[0].(map[string]interface{}) - - if v, ok := in["boot2docker_url"].(string); ok && len(v) > 0 { - obj.Boot2dockerURL = v - } - if v, ok := in["cfgparam"].([]interface{}); ok && len(v) > 0 { - obj.Cfgparam = toArrayString(v) - } - if v, ok := in["clone_from"].(string); ok && len(v) > 0 { - obj.CloneFrom = v - } - if v, ok := in["cloud_config"].(string); ok && len(v) > 0 { - obj.CloudConfig = v - } - if v, ok := in["cloudinit"].(string); ok && len(v) > 0 { - obj.Cloudinit = v - } - if v, ok := in["content_library"].(string); ok && len(v) > 0 { - obj.ContentLibrary = v - } - if v, ok := in["cpu_count"].(string); ok && len(v) > 0 { - obj.CPUCount = v - } - if v, ok := in["creation_type"].(string); ok && len(v) > 0 { - obj.CreationType = v - } - if v, ok := in["custom_attributes"].([]interface{}); ok && len(v) > 0 { - obj.CustomAttributes = toArrayString(v) - } - if v, ok := in["datacenter"].(string); ok && len(v) > 0 { - obj.Datacenter = v - } - if v, ok := in["datastore"].(string); ok && len(v) > 0 { - obj.Datastore = v - } - if v, ok := in["datastore_cluster"].(string); ok && len(v) > 0 { - obj.DatastoreCluster = v - } - if v, ok := in["disk_size"].(string); ok && len(v) > 0 { - obj.DiskSize = v - } - if v, ok := in["folder"].(string); ok && len(v) > 0 { - obj.Folder = v - } - if v, ok := in["hostsystem"].(string); ok && len(v) > 0 { - obj.Hostsystem = v - } - if v, ok := in["memory_size"].(string); ok && len(v) > 0 { - obj.MemorySize = v - } - if v, ok := in["network"].([]interface{}); ok && len(v) > 0 { - obj.Network = toArrayString(v) - } - if v, ok := in["password"].(string); ok && len(v) > 0 { - obj.Password = v - } - if v, ok := in["pool"].(string); ok && len(v) > 0 { - obj.Pool = v - } - if v, ok := in["ssh_password"].(string); ok && len(v) > 0 { - obj.SSHPassword = v - } - if v, ok := in["ssh_port"].(string); ok && len(v) > 0 { - obj.SSHPort = v - } - if v, ok := in["ssh_user"].(string); ok && len(v) > 0 { - obj.SSHUser = v - } - if v, ok := in["ssh_user_group"].(string); ok && len(v) > 0 { - obj.SSHUserGroup = v - } - if v, ok := in["tags"].([]interface{}); ok && len(v) > 0 { - obj.Tags = toArrayString(v) - } - if v, ok := in["username"].(string); ok && len(v) > 0 { - obj.Username = v - } - if v, ok := in["vapp_ip_allocation_policy"].(string); ok && len(v) > 0 { - obj.VappIpallocationpolicy = v - } - if v, ok := in["vapp_ip_protocol"].(string); ok && len(v) > 0 { - obj.VappIpprotocol = v - } - if v, ok := in["vapp_property"].([]interface{}); ok && len(v) > 0 { - obj.VappProperty = toArrayString(v) - } - if v, ok := in["vapp_transport"].(string); ok && len(v) > 0 { - obj.VappTransport = v - } - if v, ok := in["vcenter"].(string); ok && len(v) > 0 { - obj.Vcenter = v - } - if v, ok := in["vcenter_port"].(string); ok && len(v) > 0 { - obj.VcenterPort = v - } - if v, ok := in["graceful_shutdown_timeout"].(string); ok && len(v) > 0 { - obj.GracefulShutdownTimeout = v - } - - return obj -}