Skip to content

Commit

Permalink
chore: operator should not revert readiness and liveness prob configu…
Browse files Browse the repository at this point in the history
…rations (#1743)

Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha authored Aug 16, 2023
1 parent f59c387 commit ea78a2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pkg/common/utils/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"os"
"regexp"
"runtime"
"sort"
"strings"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -60,6 +61,11 @@ func doGetEnvsByRegExp(regExp string, isArchitectureDependentEnvNameNeeded bool)
env = append(env, corev1.EnvVar{Name: envName, Value: pair[1]})
}
}

sort.Slice(env, func(i, j int) bool {
return strings.Compare(env[i].Name, env[j].Name) < 0
})

return env
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/deploy/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var DefaultDeploymentDiffOpts = cmp.Options{
cmpopts.IgnoreFields(appsv1.Deployment{}, "TypeMeta", "ObjectMeta", "Status"),
cmpopts.IgnoreFields(appsv1.DeploymentSpec{}, "Replicas", "RevisionHistoryLimit", "ProgressDeadlineSeconds"),
cmpopts.IgnoreFields(appsv1.DeploymentStrategy{}, "RollingUpdate"),
cmpopts.IgnoreFields(corev1.Container{}, "TerminationMessagePath", "TerminationMessagePolicy", "SecurityContext"),
cmpopts.IgnoreFields(corev1.Container{}, "ReadinessProbe", "LivenessProbe", "TerminationMessagePath", "TerminationMessagePolicy", "SecurityContext"),
cmpopts.IgnoreFields(corev1.PodSpec{}, "DNSPolicy", "SchedulerName", "SecurityContext", "DeprecatedServiceAccount"),
cmpopts.IgnoreFields(corev1.ConfigMapVolumeSource{}, "DefaultMode"),
cmpopts.IgnoreFields(corev1.SecretVolumeSource{}, "DefaultMode"),
Expand Down

0 comments on commit ea78a2c

Please sign in to comment.