Skip to content

Commit

Permalink
Merge pull request #1024 from aziontech/remove-prune
Browse files Browse the repository at this point in the history
chore: remove unused flag
  • Loading branch information
PatrickMenoti authored Dec 10, 2024
2 parents 9e874d8 + a6ed112 commit 0af11e7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
1 change: 0 additions & 1 deletion messages/deploy/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ var (
EdgeApplicationDeploySync = "Synchronizes the local azion.json file with remote resources"
EdgeApplicationDeployLocal = "Runs the entire build and deploy process locally"
EdgeApplicationDeployDryrun = "Simulates the deploy process without carrying out any actual action"
EdgeApplicationDeployPrune = "If passed, resources no longer found in the manifest.json file will not be deleted"
EnvFlag = "Relative path to where your custom .env file is stored"
OriginsSuccessful = "Created Origin for Edge Application\n"
OriginsUpdateSuccessful = "Updated Origin for Edge Application %v with ID %v \n"
Expand Down
4 changes: 1 addition & 3 deletions pkg/cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ var (
ProjectConf string
Sync bool
DryRun bool
Prune bool
Local bool
Env string
Logs = contracts.Logs{}
Expand Down Expand Up @@ -123,7 +122,6 @@ func NewCobraCmd(deploy *DeployCmd) *cobra.Command {
deployCmd.Flags().BoolVar(&Sync, "sync", false, msg.EdgeApplicationDeploySync)
deployCmd.Flags().BoolVar(&Local, "local", false, msg.EdgeApplicationDeployLocal)
deployCmd.Flags().BoolVar(&DryRun, "dry-run", false, msg.EdgeApplicationDeployDryrun)
deployCmd.Flags().BoolVar(&Prune, "prune", false, msg.EdgeApplicationDeployPrune)
deployCmd.Flags().StringVar(&Env, "env", ".edge/.env", msg.EnvFlag)
return deployCmd
}
Expand Down Expand Up @@ -152,7 +150,7 @@ func (cmd *DeployCmd) Run(f *cmdutil.Factory) error {

if Local {
deployLocal := deploy.NewDeployCmd(f)
return deployLocal.ExternalRun(f, ProjectConf, Env, Sync, Auto, SkipBuild, Prune)
return deployLocal.ExternalRun(f, ProjectConf, Env, Sync, Auto, SkipBuild)
}

msgs := []string{}
Expand Down
6 changes: 2 additions & 4 deletions pkg/cmd/deploy_remote/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ var (
SkipBuild bool
ProjectConf string
Sync bool
Prune bool
Env string
)

Expand Down Expand Up @@ -98,12 +97,11 @@ func NewCmd(f *cmdutil.Factory) *cobra.Command {
return NewCobraCmd(NewDeployCmd(f))
}

func (cmd *DeployCmd) ExternalRun(f *cmdutil.Factory, configPath string, env string, shouldSync, auto, skipBuild, prune bool) error {
func (cmd *DeployCmd) ExternalRun(f *cmdutil.Factory, configPath string, env string, shouldSync, auto, skipBuild bool) error {
ProjectConf = configPath
Sync = shouldSync
Env = env
Auto = auto
Prune = prune
SkipBuild = skipBuild
return cmd.Run(f)
}
Expand Down Expand Up @@ -231,7 +229,7 @@ func (cmd *DeployCmd) Run(f *cmdutil.Factory) error {
}
}

err = interpreter.CreateResources(conf, manifestStructure, f, ProjectConf, Prune, &msgs)
err = interpreter.CreateResources(conf, manifestStructure, f, ProjectConf, &msgs)
if err != nil {
return err
}
Expand Down
9 changes: 3 additions & 6 deletions pkg/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func (man *ManifestInterpreter) CreateResources(
manifest *contracts.Manifest,
f *cmdutil.Factory,
projectConf string,
prune bool,
msgs *[]string) error {

logger.FInfoFlags(f.IOStreams.Out, msg.CreatingManifest, f.Format, f.Out)
Expand Down Expand Up @@ -336,11 +335,9 @@ func (man *ManifestInterpreter) CreateResources(
}
}

if !prune {
err = deleteResources(ctx, f, conf, msgs)
if err != nil {
return err
}
err = deleteResources(ctx, f, conf, msgs)
if err != nil {
return err
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/manifest/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestDeployCmd(t *testing.T) {
pathManifest := "fixtures/manifest.json"
manifest, err := interpreter.ReadManifest(pathManifest, f, &msgs)
require.NoError(t, err)
err = interpreter.CreateResources(options, manifest, f, "azion", true, &msgs)
err = interpreter.CreateResources(options, manifest, f, "azion", &msgs)
require.NoError(t, err)
})

Expand Down

0 comments on commit 0af11e7

Please sign in to comment.