@@ -15,9 +15,7 @@ import (
1515
1616 "github.com/fatih/color"
1717 app_api "github.com/porter-dev/porter/api/server/handlers/porter_app"
18- "github.com/porter-dev/porter/internal/porter_app"
1918 v2 "github.com/porter-dev/porter/internal/porter_app/v2"
20- "gopkg.in/yaml.v3"
2119
2220 "github.com/porter-dev/porter/api/types"
2321 "github.com/porter-dev/porter/internal/models"
@@ -121,36 +119,12 @@ func Apply(ctx context.Context, inp ApplyInput) error {
121119 color .New (color .FgGreen ).Printf ("Using Porter YAML at path: %s\n " , inp .PorterYamlPath ) // nolint:errcheck,gosec
122120 }
123121
124- if b64YAML == "" {
125- color .New (color .FgGreen ).Printf ("No Porter YAML found, using default configuration...\n " ) // nolint:errcheck,gosec
126- if inp .AppName == "" {
127- return errors .New ("no porter yaml found and app name not specified" )
128- }
129-
130- app := v2.PorterApp {
131- Version : string (porter_app .PorterYamlVersion_V2 ),
132- Name : inp .AppName ,
133- }
134-
135- by , err := yaml .Marshal (app )
136- if err != nil {
137- return fmt .Errorf ("error marshaling default porter yaml: %w" , err )
138- }
139-
140- b64YAML = base64 .StdEncoding .EncodeToString (by )
141- }
142-
143122 commitSHA := commitSHAFromEnv ()
144123 gitSource , err := gitSourceFromEnv ()
145124 if err != nil {
146125 return fmt .Errorf ("error getting git source from env: %w" , err )
147126 }
148127
149- parseRes , err := client .ParseYAML (ctx , cliConf .Project , cliConf .Cluster , b64YAML , inp .AppName , inp .PatchOperations )
150- if err != nil {
151- return fmt .Errorf ("error parsing porter yaml: %w" , err )
152- }
153-
154128 updateInput := api.UpdateAppInput {
155129 ProjectID : cliConf .Project ,
156130 ClusterID : cliConf .Cluster ,
@@ -159,11 +133,10 @@ func Apply(ctx context.Context, inp ApplyInput) error {
159133 GitSource : gitSource ,
160134 DeploymentTargetId : deploymentTargetID ,
161135 CommitSHA : commitSHA ,
162- Base64AppProto : parseRes .B64AppProto ,
163- Variables : parseRes .EnvVariables ,
164- Secrets : parseRes .EnvSecrets ,
136+ Base64PorterYAML : b64YAML ,
165137 WithPredeploy : inp .WithPredeploy ,
166138 Exact : inp .Exact ,
139+ PatchOperations : inp .PatchOperations ,
167140 }
168141
169142 updateResp , err := client .UpdateApp (ctx , updateInput )
0 commit comments