-
Notifications
You must be signed in to change notification settings - Fork 83
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
database: avoid regenerating password (PROJQUAY-2319) #501
Conversation
Proceed to store database root password the same way we do for the DB_URI. By doing that we avoid postgres redeployment during every reconcile cycle.
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.
LGTM, from a code POV, just a couple nits
@@ -324,7 +333,7 @@ func KustomizationFor(ctx *quaycontext.QuayRegistryContext, quay *v1.QuayRegistr | |||
componentPaths = append(componentPaths, filepath.Join("..", "components", string(component.Kind))) | |||
managedFieldGroups = append(managedFieldGroups, fieldGroupNameFor(component.Kind)) | |||
|
|||
componentConfigFiles, err := componentConfigFilesFor(component.Kind, quay, quayConfigFiles) | |||
componentConfigFiles, err := componentConfigFilesFor(ctx, component.Kind, quay, quayConfigFiles) |
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.
Nit: Maybe a different name here would be a good idea, ctx
is traditionally always context.Context
. qCtx
or quayCtx
might distinguish it more.
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.
Following pre established standards here. I fully agree with you.
@@ -264,6 +264,14 @@ func KustomizationFor(ctx *quaycontext.QuayRegistryContext, quay *v1.QuayRegistr | |||
return nil, err | |||
} | |||
|
|||
if ctx.DbRootPw == "" { | |||
rootpw, err := generateRandomString(32) |
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.
Nit: maybe rootPw
to be consistent with the rest of the PR
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.
Yes, you are right. This was a copy and paste from a branch where I am working in refactoring this. I guess we can live with this until we land that other PR of mine.
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.
Approved
Proceed to store database root password the same way we do for the
DB_URI. By doing that we avoid postgres redeployment during every
reconcile cycle.