Skip to content

Commit

Permalink
Bind pflags to default variable fields && Remove short flags as they'…
Browse files Browse the repository at this point in the history
…re not supported by pflags (flyteorg#124)

* * Bind pflags to default variable fields
* Remove short flags as they're not supported by pflags

Signed-off-by: Sean Lin <sean@union.ai>

* Add --default-var to config.go

Signed-off-by: Sean Lin <sean@union.ai>

* * merge change from master branch
* remove config_test as the generated test conflicts with it

Signed-off-by: Sean Lin <sean@union.ai>

* Add config_test.go to commit

Signed-off-by: Sean Lin <sean@union.ai>

* Update command help doc

Signed-off-by: Sean Lin <sean@union.ai>

* Use camelCase for flags

Signed-off-by: Sean Lin <sean@union.ai>

* Remove short flags from docs

Signed-off-by: Sean Lin <sean@union.ai>

* Update docs

Signed-off-by: Sean Lin <sean@union.ai>
mayitbeegh authored and robert-ulbrich-mercedes-benz committed Jul 2, 2024
1 parent c593bc5 commit f15ff9f
Showing 96 changed files with 504 additions and 502 deletions.
2 changes: 1 addition & 1 deletion flytectl/cmd/config/config.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import (
"github.com/flyteorg/flytectl/pkg/printer"
)

//go:generate pflags Config
//go:generate pflags Config --bind-default-var

var (
defaultConfig = &Config{}
6 changes: 3 additions & 3 deletions flytectl/cmd/config/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package clusterresourceattribute

//go:generate pflags AttrDeleteConfig --default-var DefaultDelConfig
//go:generate pflags AttrDeleteConfig --default-var DefaultDelConfig --bind-default-var

// AttrDeleteConfig Matchable resource attributes configuration passed from command line
type AttrDeleteConfig struct {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package clusterresourceattribute

//go:generate pflags AttrFetchConfig --default-var DefaultFetchConfig
//go:generate pflags AttrFetchConfig --default-var DefaultFetchConfig --bind-default-var

type AttrFetchConfig struct {
AttrFile string `json:"attrFile" pflag:",attribute file name to be used for generating attribute for the resource type."`
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package clusterresourceattribute

//go:generate pflags AttrUpdateConfig --default-var DefaultUpdateConfig
//go:generate pflags AttrUpdateConfig --default-var DefaultUpdateConfig --bind-default-var

// AttrUpdateConfig Matchable resource attributes configuration passed from command line
type AttrUpdateConfig struct {
4 changes: 2 additions & 2 deletions flytectl/cmd/config/subcommand/execution/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions flytectl/cmd/config/subcommand/execution/config_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package executionclusterlabel

//go:generate pflags AttrDeleteConfig --default-var DefaultDelConfig
//go:generate pflags AttrDeleteConfig --default-var DefaultDelConfig --bind-default-var

// AttrDeleteConfig Matchable resource attributes configuration passed from command line
type AttrDeleteConfig struct {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package executionclusterlabel

//go:generate pflags AttrFetchConfig --default-var DefaultFetchConfig
//go:generate pflags AttrFetchConfig --default-var DefaultFetchConfig --bind-default-var

type AttrFetchConfig struct {
AttrFile string `json:"attrFile" pflag:",attribute file name to be used for generating attribute for the resource type."`
Loading

0 comments on commit f15ff9f

Please sign in to comment.