fix: guard against missing healthcheck config
Also add support for liveness and readiness probes.
This commit is contained in:
@@ -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 }}
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user