فهرست منبع

pass app name from the cli to parse yaml (#3524)

Feroze Mohideen 2 سال پیش
والد
کامیت
72a60c9c04
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 2 0
      api/client/porter_app.go
  2. 2 1
      cli/cmd/v2/apply.go

+ 2 - 0
api/client/porter_app.go

@@ -154,11 +154,13 @@ func (c *Client) ParseYAML(
 	ctx context.Context,
 	projectID, clusterID uint,
 	b64Yaml string,
+	appName string,
 ) (*porter_app.ParsePorterYAMLToProtoResponse, error) {
 	resp := &porter_app.ParsePorterYAMLToProtoResponse{}
 
 	req := &porter_app.ParsePorterYAMLToProtoRequest{
 		B64Yaml: b64Yaml,
+		AppName: appName,
 	}
 
 	err := c.postRequest(

+ 2 - 1
cli/cmd/v2/apply.go

@@ -35,7 +35,8 @@ func Apply(ctx context.Context, cliConf config.CLIConfig, client api.Client, por
 
 	b64YAML := base64.StdEncoding.EncodeToString(porterYaml)
 
-	parseResp, err := client.ParseYAML(ctx, cliConf.Project, cliConf.Cluster, b64YAML)
+	// last argument is passed to accommodate users with v1 porter yamls
+	parseResp, err := client.ParseYAML(ctx, cliConf.Project, cliConf.Cluster, b64YAML, os.Getenv("PORTER_STACK_NAME"))
 	if err != nil {
 		return fmt.Errorf("error calling parse yaml endpoint: %w", err)
 	}