-
Notifications
You must be signed in to change notification settings - Fork 50
Vault Issue caused by passing nil check #295
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
Conversation
In the config.go dbconfig.Vault = &VaultConfig{
OCI: &OCIVault{
ID: ociVaultID,
// For the CLI, only the password may be loaded from a secret. If you need to load
// both the username and password from OCI Vault, use the exporter configuration file.
PasswordSecret: os.Getenv("OCI_VAULT_SECRET_NAME"),
},
} tells me the Username will always be an empty string, perhaps we need to replace the environment variables first and add one for username in order to support username retrieval from the vault. |
@aberinnj If you need to load both the username and password from OCI Vault, use the exporter configuration file. |
@andytael I don't, only the password, hence the issue. I think the problem will remain given the code referenced |
Wonder if this is the same problem #286 |
@andytael Yes, same issue, same problem caused by the same issue above, a vault request for the username is made when no username secret is supplied, leading to the an empty secretName in the POST |
@aberinnj Have you tested this in your environment and it works as expected? |
Yes, done |
Expected Behavior
Only the password secret is provided, retrieve only the password.
Actual Behavior
Both username and password are being retrieved, when only the password details is provided.
The second check without the necessary secretName causes the error in the Vault Request.
The Issue
The check here will cause an issue, if
OCIConfig
is defined, even with just the VaultID and now username or password secrets -- causing the nil check here to pass and therefore request the username and password from the vault.