Skip to content
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

Merged
merged 1 commit into from
Feb 18, 2022
Merged

Conversation

matthchr
Copy link
Member

If applicable:

  • this PR contains tests

Copy link
Member

@theunrepentantgeek theunrepentantgeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Comment on lines +78 to +99
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
}
Copy link
Member

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.

Copy link
Member Author

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

@matthchr matthchr force-pushed the feature/redis-secrets branch from 6e9d635 to 6c800af Compare February 18, 2022 00:42
@matthchr
Copy link
Member Author

/ok-to-test sha=6c800af

@matthchr matthchr merged commit 2ebd073 into Azure:main Feb 18, 2022
@matthchr matthchr deleted the feature/redis-secrets branch February 18, 2022 01:25
@matthchr matthchr mentioned this pull request Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants