Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
# other
.DS_Store
.vscode
/.idea
__debug_bin
/.dev
1 change: 1 addition & 0 deletions cmd/template/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func getSource(validateSource ValidateSource, validateOptions template.ValidateO

if validateOptions.WithComponents {
source.SetValidateComponents(true)
source.SetValidateForOrganizationId(validateOptions.Organization)
}

action := sdk.ValidateSourceStringAsTemplateValidateActionSource(source)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ toolchain go1.23.2
replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16

require (
bunnyshell.com/dev v0.7.0
bunnyshell.com/sdk v0.20.0
bunnyshell.com/dev v0.7.1
bunnyshell.com/sdk v0.20.1
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/MakeNowJust/heredoc v1.0.0
github.com/avast/retry-go/v4 v4.6.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bunnyshell.com/dev v0.7.0 h1:O66E0uTWSjx5ARI4Gyb19hmk9NX4uhFoyEP/nm/8kHY=
bunnyshell.com/dev v0.7.0/go.mod h1:+Xk46UXX9AW0nHrFMdO/IwpUPfALrck1/qI+LIXsDmE=
bunnyshell.com/sdk v0.20.0 h1:xcoDn0x1JqexMy5vYGqTBK4DGdY3juc+5DU7vb1yFeA=
bunnyshell.com/sdk v0.20.0/go.mod h1:RfgfUzZ4WHZGCkToUfu2/hoQS6XsQc8IdPTVAlpS138=
bunnyshell.com/dev v0.7.1 h1:mNLF0h2bbrTi9LNr2e2zFUC2fGg8TUh/9SM5rTXkzDI=
bunnyshell.com/dev v0.7.1/go.mod h1:+Xk46UXX9AW0nHrFMdO/IwpUPfALrck1/qI+LIXsDmE=
bunnyshell.com/sdk v0.20.1 h1:YxmYrW8UXGNNtLe+l6pXFKyndgwyEyQtdX0f5rHV1fE=
bunnyshell.com/sdk v0.20.1/go.mod h1:RfgfUzZ4WHZGCkToUfu2/hoQS6XsQc8IdPTVAlpS138=
github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
Expand Down
13 changes: 13 additions & 0 deletions pkg/api/component/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ type ListOptions struct {
Name string
ClusterStatus string
OperationStatus string

GitRepository string
GitBranch string
}

func NewListOptions() *ListOptions {
Expand All @@ -32,6 +35,8 @@ func (lo *ListOptions) UpdateFlagSet(flags *pflag.FlagSet) {
flags.StringVar(&lo.ClusterStatus, "clusterStatus", lo.ClusterStatus, "Filter by Cluster Status")
flags.StringVar(&lo.OperationStatus, "operationStatus", lo.OperationStatus, "Filter by Operation Status")
flags.StringVar(&lo.Name, "componentName", lo.OperationStatus, "Filter by Name")
flags.StringVar(&lo.GitRepository, "gitRepo", lo.GitRepository, "Filter by Git Repository")
flags.StringVar(&lo.GitBranch, "gitBranch", lo.GitBranch, "Filter by Git Branch")

lo.ListOptions.UpdateFlagSet(flags)
}
Expand Down Expand Up @@ -89,5 +94,13 @@ func applyOptions(request sdk.ApiComponentListRequest, options *ListOptions) sdk
request = request.Name(options.Name)
}

if options.GitRepository != "" {
request = request.GitRepository(options.GitRepository)
}

if options.GitBranch != "" {
request = request.GitBranch(options.GitBranch)
}

return request
}
13 changes: 13 additions & 0 deletions pkg/api/environment/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ type ListOptions struct {
ClusterStatus string
OperationStatus string

ComponentGitRepository string
ComponentGitBranch string

Search string

Labels map[string]string
Expand All @@ -38,6 +41,8 @@ func (lo *ListOptions) UpdateFlagSet(flags *pflag.FlagSet) {
flags.StringVar(&lo.OperationStatus, "operationStatus", lo.OperationStatus, "Filter by Operation Status")
flags.StringVar(&lo.KubernetesIntegration, "k8sCluster", lo.KubernetesIntegration, "Filter by K8SIntegrationID")
flags.StringVar(&lo.Search, "search", lo.Search, "Search by name")
flags.StringVar(&lo.ComponentGitRepository, "componentGitRepo", lo.ComponentGitRepository, "Filter by Component Git Repository")
flags.StringVar(&lo.ComponentGitBranch, "componentGitBranch", lo.ComponentGitBranch, "Filter by Component Git Branch")

flags.StringToStringVar(&lo.Labels, "label", lo.Labels, "Filter by label (key=value)")

Expand Down Expand Up @@ -101,6 +106,14 @@ func applyOptions(request sdk.ApiEnvironmentListRequest, options *ListOptions) s
request = request.Type_(options.Type)
}

if options.ComponentGitRepository != "" {
request = request.ComponentGitRepository(options.ComponentGitRepository)
}

if options.ComponentGitBranch != "" {
request = request.ComponentGitBranch(options.ComponentGitBranch)
}

if len(options.Labels) > 0 {
request = request.Labels(options.Labels)
}
Expand Down
Loading