From e9e71197a6e66c9141c64b29d49de535576b5964 Mon Sep 17 00:00:00 2001 From: tunahanertekin Date: Thu, 25 May 2023 17:45:09 +0300 Subject: [PATCH 1/2] refactor(api): add version field to launch config --- pkg/api/launch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/api/launch.go b/pkg/api/launch.go index be1d016..b2f68f3 100644 --- a/pkg/api/launch.go +++ b/pkg/api/launch.go @@ -17,6 +17,7 @@ type LaunchConfig struct { Logfile string `yaml:"logfile,omitempty"` Verbose bool `yaml:"verbose,omitempty"` Cache bool `yaml:"cache,omitempty"` + Version string `yaml:"version,omitempty"` } func (lc *LaunchConfig) PrintYAML() error { @@ -44,6 +45,9 @@ func (lc *LaunchConfig) Validate() error { if reflect.DeepEqual(lc.Organization, "") { return errors.New(".organization cannot be empty") } + if reflect.DeepEqual(lc.Version, "") { + return errors.New(".version cannot be empty") + } if err := lc.validateSteps(); err != nil { return err } From fa4999f2985859d798c692b2ae8568b78e1cbc3e Mon Sep 17 00:00:00 2001 From: tunahanertekin Date: Thu, 25 May 2023 17:45:30 +0300 Subject: [PATCH 2/2] refactor(step): include version to image name --- pkg/api/step.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/step.go b/pkg/api/step.go index e6cac36..e0da096 100644 --- a/pkg/api/step.go +++ b/pkg/api/step.go @@ -32,7 +32,7 @@ func (step *Step) Default(lc LaunchConfig) { } func (step *Step) setImageName(lc LaunchConfig) { - step.Image.Name = lc.Registry + "/" + lc.Organization + "/" + step.Image.Repository + ":" + step.Image.Tag + step.Image.Name = lc.Registry + "/" + lc.Organization + "/" + step.Image.Repository + ":" + step.Image.Tag + "-" + lc.Version } func (step *Step) setContext(lc LaunchConfig) {