Skip to content

Commit

Permalink
Update Plugin Runtime and Decouple the Target association with the Co…
Browse files Browse the repository at this point in the history
…ntext commands (#524)

* Update Plugin Runtime and Decouple the Target association with the Context commands
* Removes the usage of deprecated functions
* Updates the `tanzu context list` and `tanzu context unset` commands to deprecated existing `--target` flag and introduce a new `--type` flag
* Updates the `tanzu context list` user experience for Table format
  • Loading branch information
anujc25 authored Oct 16, 2023
1 parent 4e3865f commit 99094df
Show file tree
Hide file tree
Showing 17 changed files with 399 additions and 2,079 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ require (
github.com/vmware-tanzu/carvel-ytt v0.40.0
github.com/vmware-tanzu/tanzu-cli/test/e2e/framework v0.0.0-00010101000000-000000000000
github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-20230523145612-1c6fbba34686
github.com/vmware-tanzu/tanzu-plugin-runtime v1.1.0-dev.0.20231011182819-6cabd029e112
github.com/vmware-tanzu/tanzu-plugin-runtime v1.1.0-dev.0.20231012220854-fa06151f040d
go.pinniped.dev v0.20.0
golang.org/x/mod v0.12.0
golang.org/x/oauth2 v0.8.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,8 @@ github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230419030809-7081502eb
github.com/vmware-tanzu/tanzu-framework/apis/run v0.0.0-20230419030809-7081502ebf68/go.mod h1:e1Uef+Ux5BIHpYwqbeP2ZZmOzehBcez2vUEWXHe+xHE=
github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-20230523145612-1c6fbba34686 h1:VcuXqUXFxm5WDqWkzAlU/6cJXua0ozELnqD59fy7J6E=
github.com/vmware-tanzu/tanzu-framework/capabilities/client v0.0.0-20230523145612-1c6fbba34686/go.mod h1:AFGOXZD4tH+KhpmtV0VjWjllXhr8y57MvOsIxTtywc4=
github.com/vmware-tanzu/tanzu-plugin-runtime v1.1.0-dev.0.20231011182819-6cabd029e112 h1:zTrAoW2vn6ap0WHJ5Jo/Vq9v5WYrVT455MtopOwzYNA=
github.com/vmware-tanzu/tanzu-plugin-runtime v1.1.0-dev.0.20231011182819-6cabd029e112/go.mod h1:wMK/qpJjU7hytDAGt3FX5/iGdlUK8TsJLu36pCr+Zvk=
github.com/vmware-tanzu/tanzu-plugin-runtime v1.1.0-dev.0.20231012220854-fa06151f040d h1:O+F9NhOEsTc/LP0Ur/IqQNZ5FlSiC8G7XUEuvcHKUXI=
github.com/vmware-tanzu/tanzu-plugin-runtime v1.1.0-dev.0.20231012220854-fa06151f040d/go.mod h1:wMK/qpJjU7hytDAGt3FX5/iGdlUK8TsJLu36pCr+Zvk=
github.com/xanzy/go-gitlab v0.83.0 h1:37p0MpTPNbsTMKX/JnmJtY8Ch1sFiJzVF342+RvZEGw=
github.com/xanzy/go-gitlab v0.83.0/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC15qOjWAw=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
Expand Down
1,810 changes: 2 additions & 1,808 deletions go.work.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/auth/csp/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ func initializeConfigSource(gsa configtypes.GlobalServerAuth) configSource {
Target: configtypes.TargetK8s,
},
},
CurrentContext: map[configtypes.Target]string{
configtypes.TargetTMC: globalServer.Name,
configtypes.TargetK8s: managementServer.Name,
CurrentContext: map[configtypes.ContextType]string{
configtypes.ContextTypeTMC: globalServer.Name,
configtypes.ContextTypeK8s: managementServer.Name,
},
}
return configSource{
Expand Down
8 changes: 6 additions & 2 deletions pkg/command/completion_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ const (
// Completion strings for the values of the --target flag
compGlobalTarget = "global\tApplicable globally"
compK8sTarget = "k8s\tFor interactions with a Kubernetes cluster"
compTAETarget = "tae\tFor interactions with a Application Engine endpoint"
compTMCTarget = "tmc\tFor interactions with a Mission-Control endpoint"
compTMCTarget = "tmc\tFor interactions with a Tanzu Mission Control endpoint"

// Completion strings for the values of the --type flag
compK8sContextType = "k8s\tContext for a Kubernetes cluster"
compTAEContextType = "tae\tContext for a Tanzu Application Engine endpoint"
compTMCContextType = "tmc\tContext for a Tanzu Mission Control endpoint"

// Completion strings for the values of the --output flag
compTableOutput = "table\tOutput results in human-readable format"
Expand Down
376 changes: 231 additions & 145 deletions pkg/command/context.go

Large diffs are not rendered by default.

Loading

0 comments on commit 99094df

Please sign in to comment.