Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove environment flag from graph #8099

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions pkg/cli/cmd/app/graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/radius-project/radius/pkg/cli/framework"
"github.com/radius-project/radius/pkg/cli/output"
"github.com/radius-project/radius/pkg/cli/workspaces"
"github.com/radius-project/radius/pkg/ucp/resources"
"github.com/spf13/cobra"
)

Expand All @@ -39,7 +38,6 @@ rad app graph my-application`,

commonflags.AddWorkspaceFlag(cmd)
commonflags.AddResourceGroupFlag(cmd)
commonflags.AddEnvironmentNameFlag(cmd)
commonflags.AddApplicationNameFlag(cmd)

return cmd, runner
Expand All @@ -52,7 +50,6 @@ type Runner struct {
Output output.Interface

ApplicationName string
EnvironmentName string
Workspace *workspaces.Workspace
}

Expand Down Expand Up @@ -89,20 +86,13 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error {
}

// Validate that the application exists
app, err := client.GetApplication(cmd.Context(), r.ApplicationName)
_, err = client.GetApplication(cmd.Context(), r.ApplicationName)
if clients.Is404Error(err) {
return clierrors.Message("Application %q does not exist or has been deleted.", r.ApplicationName)
} else if err != nil {
return err
}

parsed, err := resources.ParseResource(*app.Properties.Environment)
if err != nil {
return err
}

r.EnvironmentName = parsed.Name()

return nil
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/cli/cmd/app/graph/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func Test_Validate(t *testing.T) {
runner := r.(*Runner)
// These values are used by Run()
require.Equal(t, "test-app", runner.ApplicationName)
require.Equal(t, "test-env", runner.EnvironmentName)
},
},
{
Expand All @@ -79,7 +78,6 @@ func Test_Validate(t *testing.T) {
runner := r.(*Runner)
// These values are used by Run()
require.Equal(t, "test-app", runner.ApplicationName)
require.Equal(t, "test-env", runner.EnvironmentName)
},
},
{
Expand Down Expand Up @@ -181,7 +179,6 @@ func Test_Run(t *testing.T) {

// Populated by Validate()
ApplicationName: "test-app",
EnvironmentName: "test-env",
}

err := runner.Run(context.Background())
Expand Down
Loading