Răsfoiți Sursa

if the build method is registry with a tag, use the provided tag

Alexander Belanger 4 ani în urmă
părinte
comite
86a42c9363
1 a modificat fișierele cu 18 adăugiri și 0 ștergeri
  1. 18 0
      cli/cmd/apply.go

+ 18 - 0
cli/cmd/apply.go

@@ -289,6 +289,19 @@ func (d *Driver) applyApplication(resource *models.Resource, client *api.Client,
 		tag = commit.Sha[:7]
 	}
 
+	// if the method is registry and a tag is defined, we use the provided tag
+	if appConfig.Build.Method == "registry" {
+		imageSpl := strings.Split(appConfig.Build.Image, ":")
+
+		if len(imageSpl) == 2 {
+			tag = imageSpl[1]
+		}
+
+		if tag == "" {
+			tag = "latest"
+		}
+	}
+
 	sharedOpts := &deploy.SharedOpts{
 		ProjectID:       d.target.Project,
 		ClusterID:       d.target.Cluster,
@@ -453,6 +466,11 @@ func (d *Driver) updateApplication(resource *models.Resource, client *api.Client
 		}
 	}
 
+	// if the build method is registry and the image is set, use the image and compute the tag
+	if appConf.Build.Method == "registry" {
+
+	}
+
 	err = updateAgent.UpdateImageAndValues(appConf.Values)
 
 	if err != nil {