Skip to content

Commit

Permalink
update dcl to 1.70 (#11285) (#19016)
Browse files Browse the repository at this point in the history
[upstream:37741710686aebf23aeb55f909a13e6ca367ac76]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Aug 6, 2024
1 parent 541d33b commit cff46d6
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changelog/11285.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:enhancement
gkehub: added `config_management.management` and `config_management.config_sync.enabled` fields to `google_gkehub_feature_membership`
```
```release-note:enhancement
clouddeploy: added `gke.proxy_url` field to `google_clouddeploy_target`
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21

require (
cloud.google.com/go/bigtable v1.27.2-0.20240730134218-123c88616251
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.68.0
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.70.0
github.com/apparentlymart/go-cidr v1.1.0
github.com/davecgh/go-spew v1.1.1
github.com/dnaeon/go-vcr v1.0.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.68.0 h1:LIPIYi4hy7ttUSrziY/TYwMDuEvvV593n80kRmz6nZ4=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.68.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.70.0 h1:dqqxHZYK0tlzViFqAbKzMIkfboQVWYN1CTEM2sjBtmQ=
github.com/GoogleCloudPlatform/declarative-resource-client-library v1.70.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg=
Expand Down
8 changes: 8 additions & 0 deletions google/services/clouddeploy/resource_clouddeploy_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ func ClouddeployTargetGkeSchema() *schema.Resource {
Optional: true,
Description: "Optional. If true, `cluster` is accessed using the private IP address of the control plane endpoint. Otherwise, the default IP address of the control plane endpoint is used. The default IP address is the private IP address for clusters with private control-plane endpoints and the public IP address otherwise. Only specify this option when `cluster` is a [private GKE cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).",
},

"proxy_url": {
Type: schema.TypeString,
Optional: true,
Description: "Optional. If set, used to configure a [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy) to the Kubernetes server.",
},
},
}
}
Expand Down Expand Up @@ -766,6 +772,7 @@ func expandClouddeployTargetGke(o interface{}) *clouddeploy.TargetGke {
return &clouddeploy.TargetGke{
Cluster: dcl.String(obj["cluster"].(string)),
InternalIP: dcl.Bool(obj["internal_ip"].(bool)),
ProxyUrl: dcl.String(obj["proxy_url"].(string)),
}
}

Expand All @@ -776,6 +783,7 @@ func flattenClouddeployTargetGke(obj *clouddeploy.TargetGke) interface{} {
transformed := map[string]interface{}{
"cluster": obj.Cluster,
"internal_ip": obj.InternalIP,
"proxy_url": obj.ProxyUrl,
}

return []interface{}{transformed}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ resource "google_clouddeploy_target" "primary" {
gke {
cluster = "projects/%{project_name}/locations/%{region}/clusters/different-example-cluster-name"
internal_ip = true
proxy_url = "http://10.0.0.1"
}
project = "%{project_name}"
Expand Down
19 changes: 18 additions & 1 deletion google/services/gkehub/resource_gke_hub_feature_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,17 @@ func GkeHubFeatureMembershipConfigmanagementSchema() *schema.Resource {
Elem: GkeHubFeatureMembershipConfigmanagementHierarchyControllerSchema(),
},

"management": {
Type: schema.TypeString,
Computed: true,
Optional: true,
Description: "Set this field to MANAGEMENT_AUTOMATIC to enable Config Sync auto-upgrades, and set this field to MANAGEMENT_MANUAL or MANAGEMENT_UNSPECIFIED to disable Config Sync auto-upgrades.",
},

"policy_controller": {
Type: schema.TypeList,
Optional: true,
Description: "Policy Controller configuration for the cluster.",
Description: "**DEPRECATED** Configuring Policy Controller through the configmanagement feature is no longer recommended. Use the policycontroller feature instead.",
MaxItems: 1,
Elem: GkeHubFeatureMembershipConfigmanagementPolicyControllerSchema(),
},
Expand Down Expand Up @@ -179,6 +186,12 @@ func GkeHubFeatureMembershipConfigmanagementBinauthzSchema() *schema.Resource {
func GkeHubFeatureMembershipConfigmanagementConfigSyncSchema() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Type: schema.TypeBool,
Optional: true,
Description: "Enables the installation of ConfigSync. If set to true, ConfigSync resources will be created and the other ConfigSync fields will be applied if exist. If set to false, all other ConfigSync fields will be ignored, ConfigSync resources will be deleted. If omitted, ConfigSync resources will be managed depends on the presence of the git or oci field.",
},

"git": {
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -985,6 +998,7 @@ func expandGkeHubFeatureMembershipConfigmanagement(o interface{}) *gkehub.Featur
Binauthz: expandGkeHubFeatureMembershipConfigmanagementBinauthz(obj["binauthz"]),
ConfigSync: expandGkeHubFeatureMembershipConfigmanagementConfigSync(obj["config_sync"]),
HierarchyController: expandGkeHubFeatureMembershipConfigmanagementHierarchyController(obj["hierarchy_controller"]),
Management: gkehub.FeatureMembershipConfigmanagementManagementEnumRef(obj["management"].(string)),
PolicyController: expandGkeHubFeatureMembershipConfigmanagementPolicyController(obj["policy_controller"]),
Version: dcl.StringOrNil(obj["version"].(string)),
}
Expand All @@ -998,6 +1012,7 @@ func flattenGkeHubFeatureMembershipConfigmanagement(obj *gkehub.FeatureMembershi
"binauthz": flattenGkeHubFeatureMembershipConfigmanagementBinauthz(obj.Binauthz),
"config_sync": flattenGkeHubFeatureMembershipConfigmanagementConfigSync(obj.ConfigSync),
"hierarchy_controller": flattenGkeHubFeatureMembershipConfigmanagementHierarchyController(obj.HierarchyController),
"management": obj.Management,
"policy_controller": flattenGkeHubFeatureMembershipConfigmanagementPolicyController(obj.PolicyController),
"version": obj.Version,
}
Expand Down Expand Up @@ -1042,6 +1057,7 @@ func expandGkeHubFeatureMembershipConfigmanagementConfigSync(o interface{}) *gke
}
obj := objArr[0].(map[string]interface{})
return &gkehub.FeatureMembershipConfigmanagementConfigSync{
Enabled: dcl.Bool(obj["enabled"].(bool)),
Git: expandGkeHubFeatureMembershipConfigmanagementConfigSyncGit(obj["git"]),
MetricsGcpServiceAccountEmail: dcl.String(obj["metrics_gcp_service_account_email"].(string)),
Oci: expandGkeHubFeatureMembershipConfigmanagementConfigSyncOci(obj["oci"]),
Expand All @@ -1055,6 +1071,7 @@ func flattenGkeHubFeatureMembershipConfigmanagementConfigSync(obj *gkehub.Featur
return nil
}
transformed := map[string]interface{}{
"enabled": obj.Enabled,
"git": flattenGkeHubFeatureMembershipConfigmanagementConfigSyncGit(obj.Git),
"metrics_gcp_service_account_email": obj.MetricsGcpServiceAccountEmail,
"oci": flattenGkeHubFeatureMembershipConfigmanagementConfigSyncOci(obj.Oci),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,13 @@ resource "google_gke_hub_feature_membership" "feature_member_1" {
version = "1.18.2"
config_sync {
source_format = "hierarchy"
enabled = true
git {
sync_repo = "https://github.com/GoogleCloudPlatform/magic-modules"
secret_type = "none"
}
}
management = "MANAGEMENT_AUTOMATIC"
}
}
Expand Down
4 changes: 4 additions & 0 deletions website/docs/r/clouddeploy_target.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ The `gke` block supports:
(Optional)
Optional. If true, `cluster` is accessed using the private IP address of the control plane endpoint. Otherwise, the default IP address of the control plane endpoint is used. The default IP address is the private IP address for clusters with private control-plane endpoints and the public IP address otherwise. Only specify this option when `cluster` is a [private GKE cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).

* `proxy_url` -
(Optional)
Optional. If set, used to configure a [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy) to the Kubernetes server.

The `multi_target` block supports:

* `target_ids` -
Expand Down

0 comments on commit cff46d6

Please sign in to comment.