-
Notifications
You must be signed in to change notification settings - Fork 209
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
Add Redis secrets extension #2101
Conversation
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.
Looks great!
func secretsSpecified(obj *redis.Redis) (bool, bool) { | ||
if obj.Spec.OperatorSpec == nil || obj.Spec.OperatorSpec.Secrets == nil { | ||
return false, false | ||
} | ||
|
||
secrets := obj.Spec.OperatorSpec.Secrets | ||
hasSecrets := false | ||
hasEndpoints := false | ||
|
||
if secrets.PrimaryKey != nil || | ||
secrets.SecondaryKey != nil { | ||
hasSecrets = true | ||
} | ||
|
||
if secrets.HostName != nil || | ||
secrets.Port != nil || | ||
secrets.SSLPort != nil { | ||
hasEndpoints = true | ||
} | ||
|
||
return hasSecrets, hasEndpoints | ||
} |
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.
Not for this PR, but perhaps we should consider generating this, adding as a function on Spec
at the same time we add the Secrets
property.
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.
We could, although we need to make the azure-arm.yaml
config a bit more intelligent then in order to do it, as we have to classify secrets that come from the ListSecrets call vs "secrets" that come from the Status and are just there for convenience.
This gets extra complicated with Cosmos where there are actually 2 list secrets calls and 3 categories (secrets, readonly secrets, and endpoints).
I'll make a note to look into it though
6e9d635
to
6c800af
Compare
/ok-to-test sha=6c800af |
If applicable: