jasonmimick / atlas-osb

DEPRECATED: See https://github.com/mongodb/atlas-osb
https://github.com/mongodb/atlas-osb
Apache License 2.0
0 stars 2 forks source link

Issues interpolating org_id values in plan templates #45

Open tanjoht opened 4 years ago

tanjoht commented 4 years ago

As an operator, the org_id value should be obtained through the "keys" env variables? (use case: 1 set of "plan templates" for each of the different environments/orgs)

Error:

cf create-service mongodb-atlas-template replica-m10 atlas-replica-m10-test3 Creating service instance atlas-replica-m10-test3 in org test / space tanjoht as admin... Service broker error: credentials for project ID "" not found FAILED

Plan: name: replica-m10 description: This is the Basic Plan template for 1 project, 1 cluster, 1 dbuser, and 1 secure connection. free: true apiKey: {{ mustToJson (index .credentials.Orgs (default "default_org" .org_id)) }} project: name: {{ .instance_name }} desc: Created from a template cluster: name: {{ .instance_name }} providerBackupEnabled: {{ default "true" .backups }} providerSettings: providerName: {{ default "AZURE" .provider }} instanceSizeName: {{ default "M10" .instance_size }} regionName: {{ default "US_EAST_2" .region }} labels:

keys: "orgs": { "default_org": { "publicKey": "x, "privateKey": "x", "id": "atlas-osb-api-key", "desc": "API Key for Atlas OSB", "roles": [ { "orgId" : "x" } ] },

jasonmimick commented 4 years ago

Can you attach your broker app logs? We will investigate- Thanks.

jasonmimick commented 4 years ago

@tanjoht - I checked the implementation and it seems the original code has some dependecies on the "keys" for the orgs and projects being the actual IDs.

We will keep this issue open and address it when our main go engineer returns from vacation.

So - to be clear - we will fix this, so that you do not need to have hard coded org ids in your templates for the BETA release (at least).

Thanks-

jasonmimick commented 4 years ago

This should be next up to work on @vasilevp for the week Aug 10. I think probably need to refactor the credentials/credentials.go so that the keys for the projects and the orgs can be any string (well valid string, like "foo-bar-1234-zxy, etc"). The keys can be the actual _id for the Project or Org, but just should not need to be the internal id. This is to facilitate uses referencing the key from their templates, it should be natural for humans to read and comprehend.