You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2a69a93
Browse filesBrowse the repository at this point in the historyBrowse files
composeApplyCmd.Flags().BoolVar(&composeApplyCleanGitBranches, "clean-git-branches", false, "Remove git branches created by updatecli like '--clean-git-branches=true'")
69
75
composeApplyCmd.Flags().StringArrayVar(&pipelineIds, "pipeline-ids", []string{}, "Filter pipelines to apply by their pipeline IDs, accepted as a comma separated list")
70
76
composeApplyCmd.Flags().StringArrayVar(&labels, "labels", []string{}, "Filter pipelines to apply by their labels, accepted as a comma separated list (key:value)")
77
+
composeApplyCmd.Flags().StringArrayVar(&composeApplyOnlyPolicyIDs, "only-policy-ids", []string{}, "Filter policies to apply by their policy IDs, accepted as a comma separated list")
78
+
composeApplyCmd.Flags().StringArrayVar(&composeApplyIgnoredPolicyIDs, "ignored-policy-ids", []string{}, "Filter policies to ignore by their policy IDs, accepted as a comma separated list")
Copy file name to clipboardExpand all lines: cmd/compose_diff.go
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@ import (
10
10
)
11
11
12
12
var (
13
+
composeDiffOnlyPolicyIDs []string
14
+
composeDiffIgnoredPolicyIDs []string
15
+
13
16
composeDiffCmd=&cobra.Command{
14
17
Use: "diff",
15
18
Short: "diff show changes defined by the compose file",
@@ -24,7 +27,11 @@ var (
24
27
manifests:= []manifest.Manifest{}
25
28
fori:=rangecomposeFiles {
26
29
c:=composeFiles[i]
27
-
policies, err:=c.GetPolicies(disableTLS)
30
+
policies, err:=c.GetPolicies(
31
+
disableTLS,
32
+
parseParametersList(composeDiffOnlyPolicyIDs),
33
+
parseParametersList(composeDiffIgnoredPolicyIDs),
34
+
)
28
35
iferr!=nil {
29
36
logrus.Errorf("command failed: %s", err)
30
37
os.Exit(1)
@@ -56,6 +63,7 @@ func init() {
56
63
composeDiffCmd.Flags().BoolVar(&disableTLS, "disable-tls", false, "Disable TLS verification like '--disable-tls=true'")
57
64
composeDiffCmd.Flags().StringArrayVar(&pipelineIds, "pipeline-ids", []string{}, "Filter pipelines to apply by their IDs, accepted a comma separated list")
58
65
composeDiffCmd.Flags().StringArrayVar(&labels, "labels", []string{}, "Filter pipelines to apply by their labels, accepted as a comma separated list (key:value)")
59
-
66
+
composeDiffCmd.Flags().StringArrayVar(&composeDiffOnlyPolicyIDs, "only-policy-ids", []string{}, "Filter policies to apply by their policy IDs, accepted as a comma separated list")
67
+
composeDiffCmd.Flags().StringArrayVar(&composeDiffIgnoredPolicyIDs, "ignored-policy-ids", []string{}, "Filter policies to ignore by their policy IDs, accepted as a comma separated list")
Copy file name to clipboardExpand all lines: cmd/compose_show.go
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,9 @@ import (
11
11
)
12
12
13
13
var (
14
+
composeShowOnlyPolicyIDs []string
15
+
composeShowIgnoredPolicyIDs []string
16
+
14
17
composeShowCmd=&cobra.Command{
15
18
Use: "show",
16
19
Short: "show manifest(s) defined by the compose file that should be executed",
@@ -25,7 +28,11 @@ var (
25
28
manifests:= []manifest.Manifest{}
26
29
fori:=rangecomposeFiles {
27
30
c:=composeFiles[i]
28
-
policies, err:=c.GetPolicies(disableTLS)
31
+
policies, err:=c.GetPolicies(
32
+
disableTLS,
33
+
parseParametersList(composeShowOnlyPolicyIDs),
34
+
parseParametersList(composeShowIgnoredPolicyIDs),
35
+
)
29
36
iferr!=nil {
30
37
logrus.Errorf("command failed: %s", err)
31
38
os.Exit(1)
@@ -59,6 +66,8 @@ func init() {
59
66
composeShowCmd.Flags().BoolVar(&disableTLS, "disable-tls", false, "Disable TLS verification like '--disable-tls=true'")
60
67
composeShowCmd.Flags().StringArrayVar(&pipelineIds, "pipeline-ids", []string{}, "Filter pipelines to apply by their pipeline IDs, accepted a comma separated list")
61
68
composeShowCmd.Flags().StringArrayVar(&labels, "labels", []string{}, "Filter pipelines to apply by their labels, accepted as a comma separated list (key:value)")
69
+
composeShowCmd.Flags().StringArrayVar(&composeShowOnlyPolicyIDs, "only-policy-ids", []string{}, "Filter policies to apply by their policy IDs, accepted as a comma separated list")
70
+
composeShowCmd.Flags().StringArrayVar(&composeShowIgnoredPolicyIDs, "ignored-policy-ids", []string{}, "Filter policies to ignore by their policy IDs, accepted as a comma separated list")
logrus.Debugf("Policy %q is ignored, skipping", c.spec.Policies[i].Name)
125
+
continue
126
+
}
127
+
}
128
+
129
+
iflen(onlyPolicyIDs) >0 {
130
+
131
+
ifc.spec.Policies[i].ID=="" {
132
+
logrus.Debugf("Policy %q does not have an ID, skipping because only policies with IDs can be executed when the list of policies to execute is not empty", c.spec.Policies[i].Name)
0 commit comments