diff --git a/api/v1beta1/temporalcluster_defaults.go b/api/v1beta1/temporalcluster_defaults.go index 8a6578fb..ef4586d7 100644 --- a/api/v1beta1/temporalcluster_defaults.go +++ b/api/v1beta1/temporalcluster_defaults.go @@ -29,10 +29,11 @@ const ( defaultTemporalVersion = "1.23.0" defaultTemporalImage = "temporalio/server" - defaultTemporalUIVersion = "2.25.0" - defaultTemporalUIImage = "temporalio/ui" + defaultTemporalUIImage = "temporalio/ui" + defaultTemporalUITag = "2.25.0" defaultTemporalAdmintoolsImage = "temporalio/admin-tools" + defaultTemporalAdmintoolsTag = "1.23.1.1-tctl-1.18.1-cli-0.12.0" ) // Default set default fields values. @@ -64,6 +65,9 @@ func (c *TemporalCluster) Default() { if c.Spec.Image == "" { c.Spec.Image = defaultTemporalImage } + if c.Spec.Tag == "" { + c.Spec.Tag = c.Spec.Version.String() + } if c.Spec.Log == nil { c.Spec.Log = new(LogSpec) @@ -193,8 +197,12 @@ func (c *TemporalCluster) Default() { c.Spec.UI = new(TemporalUISpec) } - if c.Spec.UI.Version == "" { - c.Spec.UI.Version = defaultTemporalUIVersion + if c.Spec.UI.Tag == "" { + if c.Spec.UI.Version != "" { + c.Spec.UI.Tag = c.Spec.UI.Version + } else { + c.Spec.UI.Tag = defaultTemporalUITag + } } if c.Spec.UI.Image == "" { @@ -213,6 +221,10 @@ func (c *TemporalCluster) Default() { c.Spec.AdminTools.Image = defaultTemporalAdmintoolsImage } + if c.Spec.AdminTools.Tag == "" { + c.Spec.AdminTools.Tag = defaultTemporalAdmintoolsTag + } + if c.Spec.MTLS != nil { if c.Spec.MTLS.RefreshInterval == nil { c.Spec.MTLS.RefreshInterval = &metav1.Duration{Duration: time.Hour} diff --git a/api/v1beta1/temporalcluster_types.go b/api/v1beta1/temporalcluster_types.go index 010aec4b..8d52e144 100644 --- a/api/v1beta1/temporalcluster_types.go +++ b/api/v1beta1/temporalcluster_types.go @@ -550,12 +550,16 @@ type TemporalUISpec struct { // Enabled defines if the operator should deploy the web ui alongside the cluster. // +optional Enabled bool `json:"enabled"` - // Version defines the temporal ui version the instance should run. + // Deprecated. use `tag` instead. // +optional + // +deprecated Version string `json:"version"` // Image defines the temporal ui docker image the instance should run. // +optional Image string `json:"image"` + // Tag defines the temporal ui docker image tag the instance should run. + // +optional + Tag string `json:"tag"` // Number of desired replicas for the ui. Default to 1. // +kubebuilder:validation:Minimum=1 // +optional @@ -585,6 +589,9 @@ type TemporalAdminToolsSpec struct { // Image defines the temporal admin tools docker image the instance should run. // +optional Image string `json:"image"` + // Tag defines the temporal admin tools docker image tag the instance should run. + // +optional + Tag string `json:"tag"` // Compute Resources required by the ui. // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ // +optional @@ -1002,6 +1009,9 @@ type TemporalClusterSpec struct { // Image defines the temporal server docker image the cluster should use for each services. // +optional Image string `json:"image"` + // Tag defines the temporal server docker image tag the cluster should use for each services. + // +optional + Tag string `json:"tag"` // Version defines the temporal version the cluster to be deployed. // This version impacts the underlying persistence schemas versions. // +optional diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index d42b3b6c..20d87d3d 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Licensed to Alexandre VILAIN under one or more contributor // license agreements. See the NOTICE file distributed with @@ -431,7 +430,8 @@ func (in *DynamicConfigSpec) DeepCopyInto(out *DynamicConfigSpec) { if val == nil { (*out)[key] = nil } else { - in, out := &val, &outVal + inVal := (*in)[key] + in, out := &inVal, &outVal *out = make([]ConstrainedValue, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) @@ -641,7 +641,8 @@ func (in *MetricsSpec) DeepCopyInto(out *MetricsSpec) { if val == nil { (*out)[key] = nil } else { - in, out := &val, &outVal + inVal := (*in)[key] + in, out := &inVal, &outVal *out = make([]string, len(*in)) copy(*out, *in) } @@ -656,7 +657,8 @@ func (in *MetricsSpec) DeepCopyInto(out *MetricsSpec) { if val == nil { (*out)[key] = nil } else { - in, out := &val, &outVal + inVal := (*in)[key] + in, out := &inVal, &outVal *out = make([]string, len(*in)) copy(*out, *in) } diff --git a/config/crd/bases/temporal.io_temporalclusters.yaml b/config/crd/bases/temporal.io_temporalclusters.yaml index d14fc287..13590896 100644 --- a/config/crd/bases/temporal.io_temporalclusters.yaml +++ b/config/crd/bases/temporal.io_temporalclusters.yaml @@ -174,6 +174,9 @@ spec: More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object type: object + tag: + description: Tag defines the temporal admin tools docker image tag the instance should run. + type: string type: object archival: description: Archival allows Workflow Execution Event Histories and Visibility data backups for the temporal cluster. @@ -3553,6 +3556,9 @@ spec: type: object type: object type: object + tag: + description: Tag defines the temporal server docker image tag the cluster should use for each services. + type: string ui: description: UI allows configuration of the optional temporal web ui deployed alongside the cluster. properties: @@ -3747,8 +3753,11 @@ spec: (scope and select) objects. type: object type: object + tag: + description: Tag defines the temporal ui docker image tag the instance should run. + type: string version: - description: Version defines the temporal ui version the instance should run. + description: Deprecated. use `tag` instead. type: string type: object version: diff --git a/docs/api/v1beta1.md b/docs/api/v1beta1.md index 50822bd3..216e8b44 100644 --- a/docs/api/v1beta1.md +++ b/docs/api/v1beta1.md @@ -76,6 +76,18 @@ string +tag
+ +string + + + +(Optional) +

Tag defines the temporal server docker image tag the cluster should use for each services.

+ + + + version
github.com/alexandrevilain/temporal-operator/pkg/version.Version @@ -4574,6 +4586,18 @@ string +tag
+ +string + + + +(Optional) +

Tag defines the temporal admin tools docker image tag the instance should run.

+ + + + resources
@@ -4787,6 +4811,18 @@ string +tag
+ +string + + + +(Optional) +

Tag defines the temporal server docker image tag the cluster should use for each services.

+ + + + version
github.com/alexandrevilain/temporal-operator/pkg/version.Version @@ -6027,7 +6063,7 @@ string (Optional) -

Version defines the temporal ui version the instance should run.

+

Deprecated. use tag instead.

@@ -6044,6 +6080,18 @@ string +tag
+ +string + + + +(Optional) +

Tag defines the temporal ui docker image tag the instance should run.

+ + + + replicas
int32 diff --git a/internal/resource/admintools/deployment_builder.go b/internal/resource/admintools/deployment_builder.go index 844cac75..bc1ed54d 100644 --- a/internal/resource/admintools/deployment_builder.go +++ b/internal/resource/admintools/deployment_builder.go @@ -134,7 +134,7 @@ func (b *DeploymentBuilder) Update(object client.Object) error { Containers: []corev1.Container{ { Name: "admintools", - Image: fmt.Sprintf("%s:%s", b.instance.Spec.AdminTools.Image, b.instance.Spec.Version), + Image: fmt.Sprintf("%s:%s", b.instance.Spec.AdminTools.Image, b.instance.Spec.AdminTools.Tag), ImagePullPolicy: corev1.PullIfNotPresent, TerminationMessagePath: corev1.TerminationMessagePathDefault, TerminationMessagePolicy: corev1.TerminationMessageReadFile, diff --git a/internal/resource/base/deployment_builder.go b/internal/resource/base/deployment_builder.go index aac87be5..7e8a1941 100644 --- a/internal/resource/base/deployment_builder.go +++ b/internal/resource/base/deployment_builder.go @@ -349,7 +349,7 @@ func (b *DeploymentBuilder) Update(object client.Object) error { Containers: []corev1.Container{ { Name: "service", // name "service" is here to simplify overrides - Image: fmt.Sprintf("%s:%s", b.instance.Spec.Image, b.instance.Spec.Version), + Image: fmt.Sprintf("%s:%s", b.instance.Spec.Image, b.instance.Spec.Tag), ImagePullPolicy: corev1.PullIfNotPresent, Resources: b.service.Resources, TerminationMessagePath: corev1.TerminationMessagePathDefault, diff --git a/internal/resource/persistence/schema_setup_job_builder.go b/internal/resource/persistence/schema_setup_job_builder.go index 6d3b09c7..44871806 100644 --- a/internal/resource/persistence/schema_setup_job_builder.go +++ b/internal/resource/persistence/schema_setup_job_builder.go @@ -123,7 +123,7 @@ func (b *SchemaJobBuilder) Build() client.Object { Containers: []corev1.Container{ { Name: "schema-script-runner", - Image: fmt.Sprintf("%s:%s", b.instance.Spec.AdminTools.Image, b.instance.Spec.Version), + Image: fmt.Sprintf("%s:%s", b.instance.Spec.AdminTools.Image, b.instance.Spec.AdminTools.Tag), ImagePullPolicy: corev1.PullIfNotPresent, Resources: b.instance.Spec.JobResources, TerminationMessagePath: corev1.TerminationMessagePathDefault, diff --git a/internal/resource/ui/deployment_builder.go b/internal/resource/ui/deployment_builder.go index a5dbec42..d7b92df0 100644 --- a/internal/resource/ui/deployment_builder.go +++ b/internal/resource/ui/deployment_builder.go @@ -127,7 +127,7 @@ func (b *DeploymentBuilder) Update(object client.Object) error { Containers: []corev1.Container{ { Name: "ui", - Image: fmt.Sprintf("%s:%s", b.instance.Spec.UI.Image, b.instance.Spec.UI.Version), + Image: fmt.Sprintf("%s:%s", b.instance.Spec.UI.Image, b.instance.Spec.UI.Tag), ImagePullPolicy: corev1.PullIfNotPresent, Resources: b.instance.Spec.UI.Resources, TerminationMessagePath: corev1.TerminationMessagePathDefault, diff --git a/pkg/version/zz_generated.deepcopy.go b/pkg/version/zz_generated.deepcopy.go index f203531a..59dd5200 100644 --- a/pkg/version/zz_generated.deepcopy.go +++ b/pkg/version/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated // Licensed to Alexandre VILAIN under one or more contributor // license agreements. See the NOTICE file distributed with