GoogleCloudPlatform / anthos-service-mesh-packages

Packaged configuration for setting up a Kubernetes cluster with Anthos Service Mesh features enabled
https://cloud.google.com/anthos/service-mesh
Apache License 2.0
133 stars 167 forks source link

asmcli validate incorrect ERROR: The service mesh feature is not enabled on project #1286

Open gbrayut opened 2 years ago

gbrayut commented 2 years ago

Testing with asmcli 1.13.2-asm.5+config2 I think the is_service_mesh_feature_enabled check is incorrect. It appears to be checking for featureState.lifecycleState which isn't part of the fleet mesh describe output. Example running asmcli validate against a working cluster using managed control plane:

$ asmcli validate -p my-project -n gke-iowa -l us-central1 --channel rapid  --fleet_id my-fleet-project --managed
... omitted ...
asmcli: Verifying cluster registration.
asmcli: Verified cluster is registered to my-fleet-project
asmcli: Checking required APIs...
asmcli: [ERROR]: The service mesh feature is not enabled on project my-project.
Please run the script with the '--enable_gcp_components' flag to allow the
script to enable it on your behalf.
Alternatively, use --enable_all|-e to allow this tool to handle all dependencies.
asmcli: Verifying cluster registration.
... omitted ...
asmcli: [WARNING]: Please see the errors above.

$ gcloud container fleet mesh describe --project=my-fleet-project
createTime: '2022-06-14T23:24:11.453828821Z'
membershipSpecs:
  projects/208759986499/locations/global/memberships/gke-iowa:
    mesh:
      controlPlane: MANUAL
membershipStates:
  projects/208759986499/locations/global/memberships/gke-iowa:
    servicemesh:
      controlPlaneManagement:
        state: DISABLED
    state:
      code: OK
      description: |-
        Revision(s) ready for use: asm-managed.
        All Canonical Services have been reconciled successfully.
      updateTime: '2022-07-26T19:50:59.546507248Z'
name: projects/my-fleet-project/locations/global/features/servicemesh
resourceState:
  state: ACTIVE
spec: {}
state:
  state: {}
updateTime: '2022-07-26T19:51:02.999752127Z'
zerobfd commented 2 years ago

This was fixed in #1287 and #1288, I'll close when the test/release process finishes.