Merge pull request #6520 from dokku/healthcheck-fixes

Guard against missing healthcheck config
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2024-01-24 02:40:18 -05:00
commit e164f8393a
3 files changed
+12 -4

No files matched your search

+2 -2
View File
@@ -115,7 +115,7 @@ type WaitForPodToExistInput struct {
LabelSelector string LabelSelector string
} }
func applyClusterIssuers(ctx context.Context, appName string) error { func applyClusterIssuers(ctx context.Context) error {
chartDir, err := os.MkdirTemp("", "cluster-issuer-chart-") chartDir, err := os.MkdirTemp("", "cluster-issuer-chart-")
if err != nil { if err != nil {
return fmt.Errorf("Error creating cluster-issuer chart directory: %w", err) return fmt.Errorf("Error creating cluster-issuer chart directory: %w", err)
@@ -126,7 +126,7 @@ func applyClusterIssuers(ctx context.Context, appName string) error {
chart := &Chart{ chart := &Chart{
ApiVersion: "v2", ApiVersion: "v2",
AppVersion: "1.0.0", AppVersion: "1.0.0",
Name: appName, Name: "cluster-issuers",
Version: "0.0.1", Version: "0.0.1",
} }
@@ -82,10 +82,18 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if $config.healthchecks.startup }} {{- if and $config.healthchecks $config.healthchecks.startup }}
startupProbe: startupProbe:
{{ $config.healthchecks.startup | toJson | indent 10 }} {{ $config.healthchecks.startup | toJson | indent 10 }}
{{- end }} {{- end }}
{{- if and $config.healthchecks $config.healthchecks.liveness }}
livenessProbe:
{{ $config.healthchecks.liveness | toJson | indent 10 }}
{{- end }}
{{- if and $config.healthchecks $config.healthchecks.readiness }}
readinessProbe:
{{ $config.healthchecks.readiness | toJson | indent 10 }}
{{- end }}
{{- if $.Values.global.image.working_dir }} {{- if $.Values.global.image.working_dir }}
workingDir: {{ $.Values.global.image.working_dir }} workingDir: {{ $.Values.global.image.working_dir }}
{{- end }} {{- end }}
+1 -1
View File
@@ -222,7 +222,7 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e
return fmt.Errorf("Error loading environment for deployment: %w", err) return fmt.Errorf("Error loading environment for deployment: %w", err)
} }
err = applyClusterIssuers(ctx, appName) err = applyClusterIssuers(ctx)
if err != nil { if err != nil {
return fmt.Errorf("Error applying cluster issuers: %w", err) return fmt.Errorf("Error applying cluster issuers: %w", err)
} }