apigee / apigee-remote-service-cli

Apigee Remote Service CLI
Apache License 2.0
20 stars 10 forks source link

Error re-running "cli provision" #121

Closed gbrail closed 3 years ago

gbrail commented 3 years ago

If I try to run "apigee-remote-service-cli provision" more than once for the same GCP project, I get the following:

Error: creating policy secret data: POST https://apigee.googleapis.com/v1/organizations/XXX/environments/YYY/resourcefiles?name=remote-service&type=properties: 409 {409 cannot create resource organizations/XXX/environments/YYY/resourcefiles/properties/remote-service; already exists ALREADY_EXISTS}

This may have to do with the specific version of Apigee SaaS that I am using.

Deleting the resource using the API and re-running works fine.

rockspore commented 3 years ago

This is expected such that it does not overwrite the existing resources. To overwrite the resource, one needs to run the provision command with the rotate flag, for example, --rotate 1.

Such implementation is to make it "consistent" with Apigee Hybrid, where users themselves need to apply the new config.yaml to the cluster to replace the secrets/configmaps.

theganyo commented 3 years ago

We could add an explanatory message to this.

rockspore commented 3 years ago

We will change the provision logic to return a config with secrets in the existing propertysets in this case.