Skip to content

Commit

Permalink
Fix reconciler config
Browse files Browse the repository at this point in the history
  • Loading branch information
roivaz committed Dec 7, 2023
1 parent 89d436a commit 874b875
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 74 deletions.
24 changes: 9 additions & 15 deletions controllers/reconciler_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,21 @@ func init() {
"spec.template.spec.schedulerName",
"spec.template.spec.restartPolicy",
"spec.template.spec.securityContext",
// "spec.template.spec.terminationGracePeriodSeconds",
"spec.template.spec.containers[*].terminationMessagePath",
"spec.template.spec.containers[*].terminationMessagePolicy",
"spec.template.spec.initContainers[*].terminationMessagePath",
"spec.template.spec.initContainers[*].terminationMessagePolicy",
},
})
config.SetDefaultReconcileConfigForGVK(
schema.FromAPIVersionAndKind("apps/v1", "StatefulSet"),
config.ReconcileConfigForGVK{
EnsureProperties: []string{
"metadata.annotations",
"metadata.labels",
"spec.minReadySeconds",
"spec.persistentVolumeClaimRetentionPolicy",
"spec.podManagementPolicy",
"spec.replicas",
"spec.selector",
"spec.serviceName",
Expand All @@ -81,12 +85,13 @@ func init() {
IgnoreProperties: []string{
"metadata.annotations['deployment.kubernetes.io/revision']",
"spec.template.spec.dnsPolicy",
"spec.template.spec.schedulerName",
"spec.template.spec.restartPolicy",
"spec.template.spec.schedulerName",
"spec.template.spec.securityContext",
// "spec.template.spec.terminationGracePeriodSeconds",
"spec.template.spec.containers[*].terminationMessagePath",
"spec.template.spec.containers[*].terminationMessagePolicy",
"spec.template.spec.initContainers[*].terminationMessagePath",
"spec.template.spec.initContainers[*].terminationMessagePolicy",
},
})
config.SetDefaultReconcileConfigForGVK(
Expand All @@ -113,18 +118,7 @@ func init() {
},
})
config.SetDefaultReconcileConfigForGVK(
schema.FromAPIVersionAndKind("policy/v1", "PodDisruptionBudget"),
config.ReconcileConfigForGVK{
EnsureProperties: []string{
"metadata.annotations",
"metadata.labels",
"spec.maxUnavailable",
"spec.minAvailable",
"spec.selector",
},
})
config.SetDefaultReconcileConfigForGVK(
schema.FromAPIVersionAndKind("external-secrets.io/v1alpha1", "ExternalSecret"),
schema.FromAPIVersionAndKind("external-secrets.io/v1beta1", "ExternalSecret"),
config.ReconcileConfigForGVK{
EnsureProperties: []string{
"metadata.annotations",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ require (
sigs.k8s.io/yaml v1.3.0
)

// replace github.com/3scale-ops/basereconciler v0.3.5 => /home/roi/github.com/3scale/basereconciler
// replace github.com/3scale-ops/basereconciler => /home/roi/github.com/3scale/basereconciler

require (
contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect
Expand Down
42 changes: 0 additions & 42 deletions go.sum

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions pkg/generators/sentinel/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ func (gen *Generator) statefulSet() *appsv1.StatefulSet {
SuccessThreshold: 1,
TimeoutSeconds: 5,
},
Resources: corev1.ResourceRequirements(*gen.Spec.Resources),
TerminationMessagePath: corev1.TerminationMessagePathDefault,
TerminationMessagePolicy: corev1.TerminationMessageReadFile,
Resources: corev1.ResourceRequirements(*gen.Spec.Resources),
VolumeMounts: []corev1.VolumeMount{
{Name: gen.GetComponent() + "-config-rw", MountPath: "/redis"},
},
Expand Down
6 changes: 2 additions & 4 deletions pkg/generators/system/app_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ func (gen *AppGenerator) deployment() *appsv1.Deployment {
Args: []string{
"bundle", "exec", "rake", "k8s:deploy",
},
Env: pod.BuildEnvironment(gen.Options),
ImagePullPolicy: *gen.Image.PullPolicy,
TerminationMessagePath: corev1.TerminationMessagePathDefault,
TerminationMessagePolicy: corev1.TerminationMessageReadFile,
Env: pod.BuildEnvironment(gen.Options),
ImagePullPolicy: *gen.Image.PullPolicy,
},
},
Containers: []corev1.Container{
Expand Down
10 changes: 4 additions & 6 deletions pkg/resource_builders/twemproxy/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ func TwemproxyContainer(twemproxySpec *saasv1alpha1.TwemproxySpec) corev1.Contai
pod.ContainerPortTCP(twemproxy, 22121),
pod.ContainerPortTCP("twem-metrics", int32(*twemproxySpec.Options.MetricsPort)),
),
Resources: corev1.ResourceRequirements(*twemproxySpec.Resources),
ImagePullPolicy: *twemproxySpec.Image.PullPolicy,
LivenessProbe: pod.ExecProbe(healthCommand, *twemproxySpec.LivenessProbe),
ReadinessProbe: pod.ExecProbe(healthCommand, *twemproxySpec.ReadinessProbe),
TerminationMessagePath: corev1.TerminationMessagePathDefault,
TerminationMessagePolicy: corev1.TerminationMessageReadFile,
Resources: corev1.ResourceRequirements(*twemproxySpec.Resources),
ImagePullPolicy: *twemproxySpec.Image.PullPolicy,
LivenessProbe: pod.ExecProbe(healthCommand, *twemproxySpec.LivenessProbe),
ReadinessProbe: pod.ExecProbe(healthCommand, *twemproxySpec.ReadinessProbe),
Lifecycle: &corev1.Lifecycle{
PreStop: &corev1.LifecycleHandler{
Exec: &corev1.ExecAction{
Expand Down
2 changes: 0 additions & 2 deletions pkg/resource_builders/twemproxy/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ func Test_AddTwemproxySidecar(t *testing.T) {
SuccessThreshold: *pointer.Int32(1),
FailureThreshold: *pointer.Int32(3),
},
TerminationMessagePath: corev1.TerminationMessagePathDefault,
TerminationMessagePolicy: corev1.TerminationMessageReadFile,
Lifecycle: &corev1.Lifecycle{
PreStop: &corev1.LifecycleHandler{
Exec: &corev1.ExecAction{
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package version

const (
version string = "v0.21.0-alpha.5"
version string = "v0.21.0-alpha.6"
)

// Current returns the current marin3r operator version
Expand Down

0 comments on commit 874b875

Please sign in to comment.