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

Deduplicate Exporter Struct #463

Merged
merged 2 commits into from
Sep 5, 2022
Merged
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
19 changes: 4 additions & 15 deletions api/redisfailover/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type RedisSettings struct {
ShutdownConfigMap string `json:"shutdownConfigMap,omitempty"`
Storage RedisStorage `json:"storage,omitempty"`
InitContainers []corev1.Container `json:"initContainers,omitempty"`
Exporter RedisExporter `json:"exporter,omitempty"`
Exporter Exporter `json:"exporter,omitempty"`
ExtraContainers []corev1.Container `json:"extraContainers,omitempty"`
Affinity *corev1.Affinity `json:"affinity,omitempty"`
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
Expand Down Expand Up @@ -86,7 +86,7 @@ type SentinelSettings struct {
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
InitContainers []corev1.Container `json:"initContainers,omitempty"`
Exporter SentinelExporter `json:"exporter,omitempty"`
Exporter Exporter `json:"exporter,omitempty"`
ExtraContainers []corev1.Container `json:"extraContainers,omitempty"`
ConfigCopy SentinelConfigCopy `json:"configCopy,omitempty"`
HostNetwork bool `json:"hostNetwork,omitempty"`
Expand All @@ -107,19 +107,8 @@ type BootstrapSettings struct {
AllowSentinels bool `json:"allowSentinels,omitempty"`
}

// RedisExporter defines the specification for the redis exporter
type RedisExporter struct {
Enabled bool `json:"enabled,omitempty"`
Image string `json:"image,omitempty"`
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"`
Args []string `json:"args,omitempty"`
Env []corev1.EnvVar `json:"env,omitempty"`
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
}

// SentinelExporter defines the specification for the sentinel exporter
type SentinelExporter struct {
// Exporter defines the specification for the redis/sentinel exporter
type Exporter struct {
Enabled bool `json:"enabled,omitempty"`
Image string `json:"image,omitempty"`
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions api/redisfailover/v1/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestValidate(t *testing.T) {
Image: defaultImage,
Replicas: defaultRedisNumber,
Port: defaultRedisPort,
Exporter: RedisExporter{
Exporter: Exporter{
Image: defaultExporterImage,
},
CustomConfig: expectedRedisCustomConfig,
Expand All @@ -114,7 +114,7 @@ func TestValidate(t *testing.T) {
Image: defaultImage,
Replicas: defaultSentinelNumber,
CustomConfig: expectedSentinelCustomConfig,
Exporter: SentinelExporter{
Exporter: Exporter{
Image: defaultSentinelExporterImage,
},
},
Expand Down
78 changes: 20 additions & 58 deletions api/redisfailover/v1/zz_generated.deepcopy.go

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

Loading