Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass credentials and parameters to a dependency #424

Open
carolynvs opened this issue Jan 19, 2022 · 1 comment
Open

Pass credentials and parameters to a dependency #424

carolynvs opened this issue Jan 19, 2022 · 1 comment

Comments

@carolynvs
Copy link
Contributor

carolynvs commented Jan 19, 2022

When a bundle has a dependency, that dependency will also have its own parameters and credentials. How should the parent bundle decide which credentials and parameters to give to a dependency?

Here's one thought. I'm using yaml but this would all be defined in the custom dependencies section in bundle.json. In the example below, the parent bundle would pass its admin-kubeconfig credential to the mysql bundle's kubeconfig credential.

dependencies:
  requires:
    - name: mysql
       reference: getporter/mysql:v0.1.1
       credentials:
         kubeconfig:
           credential: admin-kubeconfig # pass the admin-kubeconfig credential to the kubeconfig credential
       parameters:
         databaseName:
           value: "wordpress" # hard code passing wordpress as the database name
         databaseUser:
           parameter: username # pass the username parameter to the databaseUser parameter

The example above demonstrates how a parent can pass its own parameters and credentials to the dependency. Another scenario is that the output from one dependency needs to be passed to another as a parameter/credential.

dependencies:
  requires:
    - name: mysql
       reference: getporter/mysql:v0.1.1
    - name: wordpress
       reference: getporter/wordpress:v0.1.1
       parameters:
         mysqlConnStr:
           dependency: mysql
           output: connectionString
@carolynvs
Copy link
Contributor Author

carolynvs commented Jan 19, 2022

If a mapping is provided, but the bundle doesn't expose that parameter/credential (i.e. they aren't in the interface) then it is ignored by the runtime. If it is exposed, the runtime does a typcheck to make sure it can be mapped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant