Move all provisioners that rely on changing the command line to the credential usage level
Platform or tool
ngrok, mysql, Akamai
Desired or expected behavior
No DefaultProvisioner modifies the command line. This is an easy step we could make for a couple of plugins right now, to make sure every plugin works as expected with the Terraform plugin.
A validation function would be a nice add-on, to make sure that default provisioners don't overwrite the command line in the future, until a better solution is available.
Current behavior
Plugins ngrok and mysql will not work with the Terraform plugin because plugins with multiple credentials ignore command line modification coming from a credential's DefaultProvisioner
What should be done
- For ngrok: we need to use the env var provisioner as the default provisioner while moving the provisioner which includes command line modifications to the credential usage level:
in
ngrok.go:
Uses: []schema.CredentialUsage{
{
Name: credname.Credentials,
Provisioner: // file provisioner init func here
},
},
- For mysql:
Build an env var provisioner and set is as the default provisioner while moving the file, command-line modifying provisioner to the executable > credential usage level (similarly to the above description for ngrok). Here are the env vars mysql is using: https://dev.mysql.com/doc/refman/8.0/en/environment-variables.html
- For Akamai:
DefaultProvisioner: provision.TempFile(configFile,
provision.Filename(".edgerc"),
provision.AddArgs( < // this should not be in the default provisioner but the specialised provisioner
"--edgerc", "{{ .Path }}", <
"--section", "default", <
),
provision.SetPathAsEnvVar("EDGERC"), // for Akamai Terraform provider
),
I am happy to take this on.
All of them are being tracked here individually:
- https://github.com/1Password/shell-plugins/issues/274
- https://github.com/1Password/shell-plugins/issues/277
- https://github.com/1Password/shell-plugins/issues/278
I'll monitor and close this parent issue when all child issues are addressed.