Skip to content

Commit

Permalink
Merge pull request #1125 from lcarva/EC-149
Browse files Browse the repository at this point in the history
Remove references to ec-policies//data
  • Loading branch information
lcarva authored Oct 25, 2023
2 parents 132d5c8 + 8d8e59e commit d05d0a2
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cmd/fetch/fetch_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func fetchPolicyCmd() *cobra.Command {
ec fetch policy \
--source github.com/enterprise-contract/ec-policies//policy/lib \
--source github.com/enterprise-contract/ec-policies//policy/release \
--data-source github.com/enterprise-contract/ec-policies//data
--data-source git::https://github.com/enterprise-contract/ec-policies//example/data
Fetching policies from multiple sources to an automatically generated temporary
work directory:
Expand Down
2 changes: 1 addition & 1 deletion cmd/inspect/inspect_policy_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func inspectPolicyDataCmd() *cobra.Command {
Example: hd.Doc(`
Print data from a given source url:
ec inspect policy-data --source quay.io/enterprise-contract/ec-policy-data
ec inspect policy-data --source git::https://github.com/enterprise-contract/ec-policies//example/data
`),

Args: cobra.NoArgs,
Expand Down
4 changes: 2 additions & 2 deletions cmd/validate/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func validateDefinitionCmd(validate definitionValidationFn) *cobra.Command {
}{
filePaths: []string{},
policyURLs: []string{"oci::quay.io/enterprise-contract/ec-pipeline-policy:latest"},
dataURLs: []string{"git::https://github.com/enterprise-contract/ec-policies.git//data"},
dataURLs: []string{"git::https://github.com/enterprise-contract/ec-policies//example/data"},
output: []string{"json"},
namespaces: []string{},
}
Expand Down Expand Up @@ -78,7 +78,7 @@ func validateDefinitionCmd(validate definitionValidationFn) *cobra.Command {
ec validate definition --file </path/to/pipeline/file> \
--policy git::https://github.com/enterprise-contract/ec-policies//policy/lib \
--policy git::https://github.com/enterprise-contract/ec-policies//policy/pipeline \
--data git::https://github.com/enterprise-contract/ec-policies//data
--data git::https://github.com/enterprise-contract/ec-policies//example/data
`),

RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
12 changes: 6 additions & 6 deletions docs/modules/ROOT/pages/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ec validate image --policy '{
"sources": [
{
"policy": ["oci::quay.io/enterprise-contract/ec-release-policy:latest"],
"data": ["oci::quay.io/enterprise-contract/ec-policy-data:latest"]
"data": ["git::https://github.com/enterprise-contract/ec-policies//example/data"]
}
]
}' ...
Expand Down Expand Up @@ -194,9 +194,9 @@ xref:ec-policies:ROOT:attachment$rule_data.yml[rule_data.yml]
allowing the same policy rules to be used to best fit your use cases.

There are different ways to create a custom data source. The simplest form is to
fork the ec-policies git repository and change the values of
`data/rule_data.yml` in your fork. Then, simply provide your fork as a data
source. For example:
copy the example/data directory of the ec-policies git repository to your own
repository, and change the values of `rule_data.yml`. Then, simply provide your
repo as a data source. For example:

[source,json]
----
Expand All @@ -207,7 +207,7 @@ source. For example:
"git::https://github.com/enterprise-contract/ec-policies.git//policy"
],
"data": [
"git::https://github.com/lcarva/ec-policies.git//data"
"git::https://github.com/enterprise-contract/ec-policies//example/data"
]
}
]
Expand Down Expand Up @@ -235,7 +235,7 @@ as a data source, for example:

NOTE: If the data source contains policy rules, those will be ignored.

NOTE: If you replace the default data source entirely, you must provide the full set of required data values.
NOTE: When providing a data source, you must provide the full set of required data values.
These are all the values defined in
xref:ec-policies:ROOT:attachment$rule_data.yml[data/rule_data.yml] and
xref:ec-policies:ROOT:attachment$acceptable_tekton_bundles.yml[data/acceptable_tekton_bundles.yml].
Expand Down
2 changes: 1 addition & 1 deletion hack/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
description: Demo Enterprise Contract policy configuration
sources:
- data:
- quay.io/enterprise-contract/ec-policy-data:latest
- git::https://github.com/enterprise-contract/ec-policies//example/data
name: Default EC policy
policy:
- quay.io/enterprise-contract/ec-release-policy:latest
Expand Down
2 changes: 1 addition & 1 deletion tasks/verify-definition/0.1/verify-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
- name: POLICY_DATA
type: string
description: The source containing the policy files.
default: git::github.com/enterprise-contract/ec-policies//data
default: git::https://github.com/enterprise-contract/ec-policies//example/data
- name: HOMEDIR
type: string
description: Value for the HOME environment variable.
Expand Down
2 changes: 1 addition & 1 deletion tasks/verify-enterprise-contract/0.1/tests/ecp-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
description: My custom enterprise contract policy configuration
sources:
- data:
- quay.io/enterprise-contract/ec-policy-data:latest
- git::https://github.com/enterprise-contract/ec-policies//example/data
name: ec-policy
policy:
- quay.io/enterprise-contract/ec-release-policy:latest

0 comments on commit d05d0a2

Please sign in to comment.