-
Notifications
You must be signed in to change notification settings - Fork 7
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
Tweak how GetControllerCredentials works #1025
Tweak how GetControllerCredentials works #1025
Conversation
internal/db/secrets.go
Outdated
@@ -130,6 +130,10 @@ func (d *Database) GetControllerCredentials(ctx context.Context, controllerName | |||
const op = errors.Op("database.GetControllerCredentials") | |||
secret := dbmodel.NewSecret(names.ControllerTagKind, controllerName, nil) | |||
err := d.GetSecret(ctx, &secret) | |||
// It is expected for this interface that a non-existent controller credential return empty username/password. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think perhaps put this in the godoc too as it's an interesting behaviour
internal/db/secrets_test.go
Outdated
c.Assert(err, qt.Equals, nil) | ||
ctx := context.Background() | ||
controllerName := "beef1beef2-0000-0000-000011112222" | ||
// Get ControllerCred |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment? No I'll remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving but two comments
Description
The GetControllerCredentials implementation in Vault will not return an error when controller credentials are not found, this updates the Postgres secret store to match Vault. If it doesn't work like that then one is unable to add a controller to JIMM.
Engineering checklist
Check only items that apply