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
Copy file name to clipboardExpand all lines: pkg/cli/push_external_opa.go
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ import (
26
26
varpushExternalOPAFilestring
27
27
varpushExternalOPASubDirstring
28
28
varpushExternalOPAHeaders []string
29
+
varpushExternalRegoVersionstring
29
30
30
31
constdefaultPushExternalOPASubDir="external-opa"
31
32
@@ -35,6 +36,7 @@ func init() {
35
36
pushExternalOPACmd.PersistentFlags().StringVarP(&pushExternalOPASubDir, "subdirectory", "s", defaultPushExternalOPASubDir, "Sub-directory within push-directory, to contain the external OPA file definition.")
36
37
pushExternalOPACmd.PersistentFlags().StringVarP(&pushExternalOPAFile, "file", "f", "external-sources.yaml", "file name of the external OPA file definition.")
37
38
pushExternalOPACmd.PersistentFlags().StringSliceVarP(&pushExternalOPAHeaders, "header", "", []string{}, "these headers are passed to the external service provider. i.e.: for authentication")
39
+
pushExternalOPACmd.PersistentFlags().StringVarP(&pushExternalRegoVersion, "rego-version", "v", "v0", "The version of Rego used to compile the policies.")
38
40
pushCmd.AddCommand(pushExternalOPACmd)
39
41
}
40
42
@@ -47,7 +49,7 @@ var pushExternalOPACmd = &cobra.Command{
Copy file name to clipboardExpand all lines: pkg/cli/push_opa.go
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,15 @@ import (
23
23
24
24
varpushOPASubDirstring
25
25
vardeleteMissingOPAbool
26
+
varpushRegoVersionstring
26
27
27
28
constdefaultPushOPASubDir="opa"
28
29
29
30
funcinit() {
30
31
pushOPACmd.PersistentFlags().BoolVarP(&deleteMissingOPA, "delete", "D", false, "Delete any OPA policies from Insights that are not present in the local directory.")
31
32
// This flag sets a variable defined in the parent `push` command.
32
33
pushOPACmd.PersistentFlags().StringVarP(&pushOPASubDir, "push-opa-subdirectory", "", defaultPushOPASubDir, "Sub-directory within push-directory, to contain OPA policies.")
34
+
pushOPACmd.PersistentFlags().StringVarP(&pushRegoVersion, "rego-version", "v", "v0", "The version of Rego used to compile the policies.")
33
35
pushCmd.AddCommand(pushOPACmd)
34
36
}
35
37
@@ -41,7 +43,7 @@ var pushOPACmd = &cobra.Command{
OPACmd.Flags().StringVarP(&insightsInfoContext, "insightsinfo-context", "t", "Agent", "An Insights context returned by the Insights-provided insightsinfo() rego function. The context returned by Insights plugins is typically one of: CI/CD, Admission, or Agent.")
91
91
OPACmd.Flags().StringVarP(&libsDir, "libs-dir", "L", "", "A directory containing additional rego libraries to load. This option is not required, but can be used to load additional rego libraries.")
92
92
OPACmd.Flags().BoolVarP(&expectActionItem.Default, "expect-action-item", "i", true, "Whether to expect the OPA policy to output one action item (true) or 0 action items (false). This option is applied to Kubernetes manifest files with no .success.yaml nor .failure.yaml extension.")
93
+
OPACmd.Flags().StringVarP(®oVersion, "rego-version", "v", "v0", "The version of the rego policy to validate. This option is not required, but can be used to specify the rego version to validate. Version can be v0 or v1")
0 commit comments