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

feat: ACL with username #796

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions api/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (
// KubernetesConfig will be the JSON struct for Basic Redis Config
// +k8s:deepcopy-gen=true
type KubernetesConfig struct {
Image string `json:"image"`
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
ExistingPasswordSecret *ExistingPasswordSecret `json:"redisSecret,omitempty"`
ImagePullSecrets *[]corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
UpdateStrategy appsv1.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty"`
Service *ServiceConfig `json:"service,omitempty"`
IgnoreAnnotations []string `json:"ignoreAnnotations,omitempty"`
Image string `json:"image"`
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
ExistingAuthSecret *ExistingAuthSecret `json:"redisSecret,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Changing the field name would produce a breaking change here.
we are good with adding field but don't rename any field

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So... do you think this part needs to be modified?
@shubham-cmyk

ImagePullSecrets *[]corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
UpdateStrategy appsv1.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty"`
Service *ServiceConfig `json:"service,omitempty"`
IgnoreAnnotations []string `json:"ignoreAnnotations,omitempty"`
}

// ServiceConfig define the type of service to be created and its annotations
Expand All @@ -26,11 +26,12 @@ type ServiceConfig struct {
ServiceAnnotations map[string]string `json:"annotations,omitempty"`
}

// ExistingPasswordSecret is the struct to access the existing secret
// ExistingAuthSecret is the struct to access the existing secret
// +k8s:deepcopy-gen=true
type ExistingPasswordSecret struct {
Name *string `json:"name,omitempty"`
Key *string `json:"key,omitempty"`
type ExistingAuthSecret struct {
Name *string `json:"name,omitempty"`
UsernameKey *string `json:"username,omitempty"`
PasswordKey *string `json:"password,omitempty"`
}

// RedisExporter interface will have the information for redis exporter related stuff
Expand Down
11 changes: 6 additions & 5 deletions api/v1beta2/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ type RedisConfig struct {
common.RedisConfig `json:",inline"`
}

// ExistingPasswordSecret is the struct to access the existing secret
type ExistingPasswordSecret struct {
Name *string `json:"name,omitempty"`
Key *string `json:"key,omitempty"`
// ExistingAuthSecret is the struct to access the existing secret
type ExistingAuthSecret struct {
Name *string `json:"name,omitempty"`
UsernameKey *string `json:"username,omitempty"`
PasswordKey *string `json:"password,omitempty"`
}

// Storage is the inteface to add pvc and pv support in redis
Expand Down Expand Up @@ -71,7 +72,7 @@ type ACLConfig struct {
Secret *corev1.SecretVolumeSource `json:"secret,omitempty"`
}

// Probe is a interface for ReadinessProbe and LivenessProbe
// Probe is an interface for ReadinessProbe and LivenessProbe
type Probe struct {
common.Probe `json:",inline"`
}
Expand Down
17 changes: 11 additions & 6 deletions api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 14 additions & 9 deletions api/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions config/crd/bases/redis.redis.opstreelabs.in_redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -954,13 +954,15 @@ spec:
type: object
type: array
redisSecret:
description: ExistingPasswordSecret is the struct to access the
existing secret
description: ExistingAuthSecret is the struct to access the existing
secret
properties:
key:
type: string
name:
type: string
password:
type: string
username:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
Expand Down Expand Up @@ -5131,13 +5133,15 @@ spec:
type: object
type: array
redisSecret:
description: ExistingPasswordSecret is the struct to access the
existing secret
description: ExistingAuthSecret is the struct to access the existing
secret
properties:
key:
type: string
name:
type: string
password:
type: string
username:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
Expand Down
20 changes: 12 additions & 8 deletions config/crd/bases/redis.redis.opstreelabs.in_redisclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,15 @@ spec:
type: object
type: array
redisSecret:
description: ExistingPasswordSecret is the struct to access the
existing secret
description: ExistingAuthSecret is the struct to access the existing
secret
properties:
key:
type: string
name:
type: string
password:
type: string
username:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
Expand Down Expand Up @@ -5511,13 +5513,15 @@ spec:
type: object
type: array
redisSecret:
description: ExistingPasswordSecret is the struct to access the
existing secret
description: ExistingAuthSecret is the struct to access the existing
secret
properties:
key:
type: string
name:
type: string
password:
type: string
username:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -956,13 +956,15 @@ spec:
type: object
type: array
redisSecret:
description: ExistingPasswordSecret is the struct to access the
existing secret
description: ExistingAuthSecret is the struct to access the existing
secret
properties:
key:
type: string
name:
type: string
password:
type: string
username:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
Expand Down Expand Up @@ -5136,13 +5138,15 @@ spec:
type: object
type: array
redisSecret:
description: ExistingPasswordSecret is the struct to access the
existing secret
description: ExistingAuthSecret is the struct to access the existing
secret
properties:
key:
type: string
name:
type: string
password:
type: string
username:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
Expand Down
20 changes: 12 additions & 8 deletions config/crd/bases/redis.redis.opstreelabs.in_redissentinels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -957,13 +957,15 @@ spec:
type: object
type: array
redisSecret:
description: ExistingPasswordSecret is the struct to access the
existing secret
description: ExistingAuthSecret is the struct to access the existing
secret
properties:
key:
type: string
name:
type: string
password:
type: string
username:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
Expand Down Expand Up @@ -2901,13 +2903,15 @@ spec:
type: object
type: array
redisSecret:
description: ExistingPasswordSecret is the struct to access the
existing secret
description: ExistingAuthSecret is the struct to access the existing
secret
properties:
key:
type: string
name:
type: string
password:
type: string
username:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
Expand Down
1 change: 1 addition & 0 deletions example/v1beta2/backup_restore/backup/env-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stringData:
RESTIC_PASSWORD: abc@123
RESTIC_CACHE_DIR: "/tmp/restic_cache"
REDIS_PORT: "6379"
REDIS_USERNAME: "default"
REDIS_PASSWORD: ""
BACKUP_DESTINATION: AWS_S3
AWS_S3_BUCKET: shubham-redis
Expand Down
Loading
Loading