-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Affected components
- Fabric modules
- FAST
- Blueprints
- Other
The problem
Problem
- Error:400,
PolicyController
has its own API and cannot useConfigManagement
API
Requirement
- As per this document - https://cloud.google.com/kubernetes-engine/enterprise/policy-controller/docs/how-to/migrate-policy-controller-api#terraform, policy controller now has its own API and hence will have to be migrated to a separate resource like
servicemesh
.
Fix
- Create a separate resource block similar to
servicemesh
to enable and usePolicyController
using this block - https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/gke_hub_feature_membership#example-usage---policy-controller-with-custom-configurations - Remove this block -
dynamic "policy_controller" {
Release version
v42.0.0
Terraform version
v1.10.5
Steps to reproduce
- Create a
PolicyController
resource using theConfigManagement
and terraform apply
Expected behavior
- Enabled PolicyController feature in GKE Fleet
- Register the cluster that is being created with the policy controller
Actual behavior
- Observed the following error
│ Error: Error creating FeatureMembership: googleapi: Error 400: InvalidFieldError for field policyController.enabled: To use Policy Controller with version > 1.20.3, please use the PolicyController API directly http://cloud/kubernetes-engine/enterprise/policy-controller/docs/how-to/installing-policy-controller. To migrate from the ConfigManagement API to the PolicyController API, please follow the instructions at https://cloud.google.com/kubernetes-engine/enterprise/policy-controller/docs/how-to/migrate-policy-controller-api. │ Details: │ [ │ { │ "@type": "type.googleapis.com/google.rpc.RequestInfo", │ "requestId": "f028ca0afe765bb9" │ } │ ] │ │ with module.hub.google_gke_hub_feature_membership.default["gke-cams-cluster-1"], │ on modules/fabric/gke-hub/main.tf line 116, in resource "google_gke_hub_feature_membership" "default": │ 116: resource "google_gke_hub_feature_membership" "default" {
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels