77 "strings"
88
99 console "github.com/pluralsh/console-client-go"
10- consoleclient "github.com/pluralsh/deployment-operator/pkg/client"
1110 "github.com/pluralsh/polly/algorithms"
1211 "github.com/samber/lo"
1312 batchv1 "k8s.io/api/batch/v1"
@@ -16,6 +15,8 @@ import (
1615 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1716 "k8s.io/apimachinery/pkg/types"
1817 "sigs.k8s.io/controller-runtime/pkg/log"
18+
19+ consoleclient "github.com/pluralsh/deployment-operator/pkg/client"
1920)
2021
2122const (
@@ -33,11 +34,11 @@ var (
3334 }
3435
3536 defaultContainerVersions = map [console.StackType ]string {
36- console .StackTypeTerraform : "latest " ,
37+ console .StackTypeTerraform : "1.8.2 " ,
3738 console .StackTypeAnsible : "latest" ,
3839 }
3940
40- defaultImageTag = "0.4.28 "
41+ defaultImageTag = "0.4.29 "
4142)
4243
4344func init () {
@@ -191,15 +192,16 @@ func (r *StackReconciler) getDefaultContainer(run *console.StackRunFragment) cor
191192
192193func (r * StackReconciler ) getDefaultContainerImage (run * console.StackRunFragment ) string {
193194 image := defaultContainerImages [run .Type ]
194- if run .Configuration != nil && run .Configuration .Image != nil && * run .Configuration .Image != "" {
195- image = * run .Configuration .Image
196- }
197-
198195 version := defaultContainerVersions [run .Type ]
199196 if run .Configuration != nil && run .Configuration .Version != "" {
200197 version = run .Configuration .Version
201198 }
202199
200+ if run .Configuration != nil && run .Configuration .Image != nil && * run .Configuration .Image != "" {
201+ image = * run .Configuration .Image
202+ return fmt .Sprintf ("%s:%s" , image , version )
203+ }
204+
203205 return fmt .Sprintf ("%s:%s-%s-%s" , image , defaultImageTag , strings .ToLower (string (run .Type )), version )
204206}
205207
0 commit comments