Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Invalid embedded-field initializers prevent the operator and tests from compiling, while inconsistent port overrides break delegated authentication and the sample exposes LDAP credentials over an unencrypted connection.
4 open issues
1 file not reviewed
api/v1alpha1/zz_generated.deepcopy.go: Generated file
What changed in this PR
Adds LDAP authentication to operator-managed Dragonfly deployments through spec.authentication.ldap, wiring each pod to an authentication sidecar.
Changes:
- Adds LDAP API fields and updates generated schemas and deep-copy support.
- Generates the sidecar, configuration, health probes, and Dragonfly authentication flags.
- Adds resource-generation tests, setup documentation, and an example.
| File | Description |
|---|---|
| README.md | Documents LDAP configuration and ACL requirements. |
| manifests/dragonfly-operator.yaml | Includes LDAP schema in the bundled installation manifest. |
| manifests/crd.yaml | Adds LDAP fields to the standalone CRD. |
| internal/resources/version.go | Defines the default sidecar image version. |
| internal/resources/resources.go | Generates the sidecar and authentication wiring. |
| internal/resources/resources_test.go | Tests sidecar generation, defaults, and overrides. |
| internal/resources/const.go | Defines sidecar and authentication constants. |
| config/samples/v1alpha1_dragonfly_ldap.yaml | Demonstrates LDAP configuration and Secrets. |
| config/crd/bases/dragonflydb.io_dragonflies.yaml | Adds the generated LDAP schema. |
| charts/dragonfly-operator/templates/crds.yaml | Exposes LDAP configuration through Helm’s CRD. |
| api/v1alpha1/zz_generated.deepcopy.go | Adds deep-copy support for LDAP settings. |
| api/v1alpha1/dragonfly_types.go | Defines the LDAP authentication API. |
Review effort: Balanced
Comment on lines
+736
to
+739
| HTTPGet: &corev1.HTTPGetAction{ | ||
| Path: "/healthz", | ||
| Port: intstr.FromInt32(AuthSidecarPort), | ||
| }, |
| Name: "LDAP_SEARCH_BIND_PASSWORD", | ||
| ValueFrom: &corev1.EnvVarSource{ | ||
| SecretKeyRef: &corev1.SecretKeySelector{ | ||
| Name: "ldap-bind", |
| key: acl | ||
| authentication: | ||
| ldap: | ||
| server: ldap://openldap.default.svc:389 |
| Image: image, | ||
| // On a duplicate name the kubelet uses the last entry, so the user's | ||
| // variables override the ones above. | ||
| Env: append(env, ldap.Env...), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Add
spec.authentication.ldap. When set, the operator adds the auth sidecar container to every Dragonfly pod and starts Dragonfly with--auth_validatepointing at it.