From c31e31809471d3a60610258f2e100670e2c60c69 Mon Sep 17 00:00:00 2001 From: hectorj2f Date: Wed, 18 May 2022 14:48:23 +0200 Subject: [PATCH 1/5] chore: rename cosigned to policy-controller Signed-off-by: hectorj2f --- .../testdata/config-image-policies.yaml | 2 +- .../register.go | 4 +- .../v1alpha1/clusterimagepolicy_conversion.go | 2 +- .../clusterimagepolicy_conversion_test.go | 2 +- .../v1alpha1/clusterimagepolicy_defaults.go | 0 .../clusterimagepolicy_defaults_test.go | 0 .../v1alpha1/clusterimagepolicy_types.go | 0 .../v1alpha1/clusterimagepolicy_validation.go | 0 .../clusterimagepolicy_validation_test.go | 0 .../v1alpha1/doc.go | 2 +- .../v1alpha1/register.go | 4 +- .../v1alpha1/zz_generated.deepcopy.go | 0 .../v1beta1/clusterimagepolicy_conversion.go | 0 .../clusterimagepolicy_conversion_test.go | 0 .../v1beta1/clusterimagepolicy_defaults.go | 0 .../clusterimagepolicy_defaults_test.go | 0 .../v1beta1/clusterimagepolicy_types.go | 0 .../v1beta1/clusterimagepolicy_validation.go | 0 .../clusterimagepolicy_validation_test.go | 0 .../v1beta1/doc.go | 2 +- .../v1beta1/register.go | 4 +- .../v1beta1/zz_generated.deepcopy.go | 0 pkg/client/clientset/versioned/clientset.go | 32 +-- .../versioned/fake/clientset_generated.go | 20 +- .../clientset/versioned/fake/register.go | 8 +- .../clientset/versioned/scheme/register.go | 8 +- .../v1alpha1/clusterimagepolicy.go | 4 +- .../v1alpha1/doc.go | 0 .../v1alpha1/fake/doc.go | 0 .../v1alpha1/fake/fake_clusterimagepolicy.go | 8 +- .../fake/fake_policycontroller_client.go} | 8 +- .../v1alpha1/generated_expansion.go | 0 .../v1alpha1/policycontroller_client.go} | 32 +-- .../v1beta1/clusterimagepolicy.go | 4 +- .../v1beta1/doc.go | 0 .../v1beta1/fake/doc.go | 0 .../v1beta1/fake/fake_clusterimagepolicy.go | 8 +- .../fake/fake_policycontroller_client.go} | 8 +- .../v1beta1/generated_expansion.go | 0 .../v1beta1/policycontroller_client.go} | 32 +-- .../informers/externalversions/factory.go | 8 +- .../informers/externalversions/generic.go | 12 +- .../interface.go | 6 +- .../v1alpha1/clusterimagepolicy.go | 12 +- .../v1alpha1/interface.go | 0 .../v1beta1/clusterimagepolicy.go | 12 +- .../v1beta1/interface.go | 0 pkg/client/injection/client/client.go | 96 +++---- .../clusterimagepolicy/clusterimagepolicy.go | 24 +- .../v1alpha1/clusterimagepolicy/fake/fake.go | 4 +- .../filtered/clusterimagepolicy.go | 24 +- .../clusterimagepolicy/filtered/fake/fake.go | 4 +- .../clusterimagepolicy/clusterimagepolicy.go | 24 +- .../v1beta1/clusterimagepolicy/fake/fake.go | 4 +- .../filtered/clusterimagepolicy.go | 24 +- .../clusterimagepolicy/filtered/fake/fake.go | 4 +- .../v1alpha1/clusterimagepolicy/controller.go | 6 +- .../v1alpha1/clusterimagepolicy/reconciler.go | 10 +- .../v1alpha1/clusterimagepolicy/state.go | 2 +- .../v1beta1/clusterimagepolicy/controller.go | 6 +- .../v1beta1/clusterimagepolicy/reconciler.go | 10 +- .../v1beta1/clusterimagepolicy/state.go | 2 +- .../v1alpha1/clusterimagepolicy.go | 2 +- .../v1alpha1/expansion_generated.go | 0 .../v1beta1/clusterimagepolicy.go | 2 +- .../v1beta1/expansion_generated.go | 0 .../clusterimagepolicy_types.go | 2 +- pkg/cosign/kubernetes/webhook/validation.go | 2 +- .../kubernetes/webhook/validator_test.go | 2 +- pkg/policy/eval_test.go | 4 +- .../clusterimagepolicy/clusterimagepolicy.go | 4 +- .../clusterimagepolicy_test.go | 4 +- .../clusterimagepolicy/controller.go | 6 +- .../clusterimagepolicy/controller_test.go | 2 +- .../testing/v1alpha1/clusterimagepolicy.go | 4 +- pkg/reconciler/testing/v1alpha1/listers.go | 4 +- test/ci.mk | 16 +- test/e2e_test_cluster_image_policy.sh | 18 +- ..._cluster_image_policy_with_attestations.sh | 8 +- test/e2e_test_policy_controller.sh | 260 ++++++++++++++++++ test/e2e_test_policy_crd.sh | 10 +- .../e2e/cip-key-with-attestations.yaml | 4 +- .../e2e/cip-key.yaml | 4 +- .../e2e/cip-keyless-with-attestations.yaml | 4 +- .../cip-keyless-with-identities-mismatch.yaml | 4 +- .../e2e/cip-keyless-with-identities.yaml | 4 +- .../e2e/cip-keyless.yaml | 4 +- ...s-two-signatures-and-two-attestations.yaml | 4 +- .../invalid/empty-keyless-ref.yaml | 2 +- .../invalid/empty-keyref-and-keylessref.yaml | 2 +- .../invalid/empty-keyref.yaml | 2 +- .../invalid/invalid-glob.yaml | 2 +- .../invalid/invalid-pubkey.yaml | 2 +- .../keylessref-with-empty-authorities.yaml | 2 +- .../keylessref-with-empty-identities.yaml | 2 +- .../keylessref-with-malformed-issuer.yaml | 2 +- .../keylessref-with-malformed-subject.yaml | 2 +- .../keylessref-with-multiple-properties.yaml | 2 +- .../keyref-with-multiple-properties.yaml | 2 +- .../invalid/valid-keyref-and-keylessref.yaml | 2 +- .../valid/valid-policy-glob.yaml | 2 +- .../valid/valid-policy.yaml | 2 +- 102 files changed, 577 insertions(+), 317 deletions(-) rename pkg/apis/{cosigned => policycontroller}/register.go (92%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy_conversion.go (98%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy_conversion_test.go (98%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy_defaults.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy_defaults_test.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy_types.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy_validation.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy_validation_test.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/doc.go (93%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/register.go (90%) rename pkg/apis/{cosigned => policycontroller}/v1alpha1/zz_generated.deepcopy.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/clusterimagepolicy_conversion.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/clusterimagepolicy_conversion_test.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/clusterimagepolicy_defaults.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/clusterimagepolicy_defaults_test.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/clusterimagepolicy_types.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/clusterimagepolicy_validation.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/clusterimagepolicy_validation_test.go (100%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/doc.go (93%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/register.go (90%) rename pkg/apis/{cosigned => policycontroller}/v1beta1/zz_generated.deepcopy.go (100%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy.go (97%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1alpha1/doc.go (100%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1alpha1/fake/doc.go (100%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1alpha1/fake/fake_clusterimagepolicy.go (93%) rename pkg/client/clientset/versioned/typed/{cosigned/v1alpha1/fake/fake_cosigned_client.go => policycontroller/v1alpha1/fake/fake_policycontroller_client.go} (80%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1alpha1/generated_expansion.go (100%) rename pkg/client/clientset/versioned/typed/{cosigned/v1alpha1/cosigned_client.go => policycontroller/v1alpha1/policycontroller_client.go} (63%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1beta1/clusterimagepolicy.go (97%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1beta1/doc.go (100%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1beta1/fake/doc.go (100%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1beta1/fake/fake_clusterimagepolicy.go (93%) rename pkg/client/clientset/versioned/typed/{cosigned/v1beta1/fake/fake_cosigned_client.go => policycontroller/v1beta1/fake/fake_policycontroller_client.go} (80%) rename pkg/client/clientset/versioned/typed/{cosigned => policycontroller}/v1beta1/generated_expansion.go (100%) rename pkg/client/clientset/versioned/typed/{cosigned/v1beta1/cosigned_client.go => policycontroller/v1beta1/policycontroller_client.go} (64%) rename pkg/client/informers/externalversions/{cosigned => policycontroller}/interface.go (95%) rename pkg/client/informers/externalversions/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy.go (86%) rename pkg/client/informers/externalversions/{cosigned => policycontroller}/v1alpha1/interface.go (100%) rename pkg/client/informers/externalversions/{cosigned => policycontroller}/v1beta1/clusterimagepolicy.go (86%) rename pkg/client/informers/externalversions/{cosigned => policycontroller}/v1beta1/interface.go (100%) rename pkg/client/injection/informers/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy/clusterimagepolicy.go (73%) rename pkg/client/injection/informers/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy/fake/fake.go (90%) rename pkg/client/injection/informers/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go (76%) rename pkg/client/injection/informers/{cosigned/v1beta1 => policycontroller/v1alpha1}/clusterimagepolicy/filtered/fake/fake.go (92%) rename pkg/client/injection/informers/{cosigned => policycontroller}/v1beta1/clusterimagepolicy/clusterimagepolicy.go (73%) rename pkg/client/injection/informers/{cosigned => policycontroller}/v1beta1/clusterimagepolicy/fake/fake.go (90%) rename pkg/client/injection/informers/{cosigned => policycontroller}/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go (76%) rename pkg/client/injection/informers/{cosigned/v1alpha1 => policycontroller/v1beta1}/clusterimagepolicy/filtered/fake/fake.go (92%) rename pkg/client/injection/reconciler/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy/controller.go (95%) rename pkg/client/injection/reconciler/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy/reconciler.go (96%) rename pkg/client/injection/reconciler/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy/state.go (97%) rename pkg/client/injection/reconciler/{cosigned => policycontroller}/v1beta1/clusterimagepolicy/controller.go (95%) rename pkg/client/injection/reconciler/{cosigned => policycontroller}/v1beta1/clusterimagepolicy/reconciler.go (96%) rename pkg/client/injection/reconciler/{cosigned => policycontroller}/v1beta1/clusterimagepolicy/state.go (97%) rename pkg/client/listers/{cosigned => policycontroller}/v1alpha1/clusterimagepolicy.go (97%) rename pkg/client/listers/{cosigned => policycontroller}/v1alpha1/expansion_generated.go (100%) rename pkg/client/listers/{cosigned => policycontroller}/v1beta1/clusterimagepolicy.go (97%) rename pkg/client/listers/{cosigned => policycontroller}/v1beta1/expansion_generated.go (100%) create mode 100755 test/e2e_test_policy_controller.sh rename test/testdata/{cosigned => policy-controller}/e2e/cip-key-with-attestations.yaml (93%) rename test/testdata/{cosigned => policy-controller}/e2e/cip-key.yaml (90%) rename test/testdata/{cosigned => policy-controller}/e2e/cip-keyless-with-attestations.yaml (92%) rename test/testdata/{cosigned => policy-controller}/e2e/cip-keyless-with-identities-mismatch.yaml (90%) rename test/testdata/{cosigned => policy-controller}/e2e/cip-keyless-with-identities.yaml (89%) rename test/testdata/{cosigned => policy-controller}/e2e/cip-keyless.yaml (88%) rename test/testdata/{cosigned => policy-controller}/e2e/cip-requires-two-signatures-and-two-attestations.yaml (97%) rename test/testdata/{cosigned => policy-controller}/invalid/empty-keyless-ref.yaml (93%) rename test/testdata/{cosigned => policy-controller}/invalid/empty-keyref-and-keylessref.yaml (93%) rename test/testdata/{cosigned => policy-controller}/invalid/empty-keyref.yaml (93%) rename test/testdata/{cosigned => policy-controller}/invalid/invalid-glob.yaml (94%) rename test/testdata/{cosigned => policy-controller}/invalid/invalid-pubkey.yaml (93%) rename test/testdata/{cosigned => policy-controller}/invalid/keylessref-with-empty-authorities.yaml (93%) rename test/testdata/{cosigned => policy-controller}/invalid/keylessref-with-empty-identities.yaml (93%) rename test/testdata/{cosigned => policy-controller}/invalid/keylessref-with-malformed-issuer.yaml (93%) rename test/testdata/{cosigned => policy-controller}/invalid/keylessref-with-malformed-subject.yaml (93%) rename test/testdata/{cosigned => policy-controller}/invalid/keylessref-with-multiple-properties.yaml (94%) rename test/testdata/{cosigned => policy-controller}/invalid/keyref-with-multiple-properties.yaml (94%) rename test/testdata/{cosigned => policy-controller}/invalid/valid-keyref-and-keylessref.yaml (93%) rename test/testdata/{cosigned => policy-controller}/valid/valid-policy-glob.yaml (96%) rename test/testdata/{cosigned => policy-controller}/valid/valid-policy.yaml (98%) diff --git a/pkg/apis/config/testdata/config-image-policies.yaml b/pkg/apis/config/testdata/config-image-policies.yaml index 3fa056e86b8..bb4ad4e7fae 100644 --- a/pkg/apis/config/testdata/config-image-policies.yaml +++ b/pkg/apis/config/testdata/config-image-policies.yaml @@ -18,7 +18,7 @@ metadata: name: config-image-policies namespace: cosign-system labels: - cosigned.sigstore.dev/release: devel + policycontroller.sigstore.dev/release: devel data: _example: | diff --git a/pkg/apis/cosigned/register.go b/pkg/apis/policycontroller/register.go similarity index 92% rename from pkg/apis/cosigned/register.go rename to pkg/apis/policycontroller/register.go index c4f2dcf5567..f8960442625 100644 --- a/pkg/apis/cosigned/register.go +++ b/pkg/apis/policycontroller/register.go @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -package cosigned +package policycontroller import "k8s.io/apimachinery/pkg/runtime/schema" const ( // GroupName is the name of the API group. - GroupName = "cosigned.sigstore.dev" + GroupName = "policycontroller.sigstore.dev" ) var ( diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_conversion.go b/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion.go similarity index 98% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_conversion.go rename to pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion.go index 18ff95216eb..9e067750f59 100644 --- a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_conversion.go +++ b/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" v1 "k8s.io/api/core/v1" "knative.dev/pkg/apis" ) diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_conversion_test.go b/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion_test.go similarity index 98% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_conversion_test.go rename to pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion_test.go index 775730d2dcb..fd2c0d870e2 100644 --- a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_conversion_test.go +++ b/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion_test.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" ) // Test v1alpha1 -> v1beta1 -> v1alpha1 diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_defaults.go b/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_defaults.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_defaults.go rename to pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_defaults.go diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_defaults_test.go b/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_defaults_test.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_defaults_test.go rename to pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_defaults_test.go diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_types.go b/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_types.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_types.go rename to pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_types.go diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_validation.go b/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_validation.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_validation.go rename to pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_validation.go diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_validation_test.go b/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_validation_test.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_validation_test.go rename to pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_validation_test.go diff --git a/pkg/apis/cosigned/v1alpha1/doc.go b/pkg/apis/policycontroller/v1alpha1/doc.go similarity index 93% rename from pkg/apis/cosigned/v1alpha1/doc.go rename to pkg/apis/policycontroller/v1alpha1/doc.go index db76518485c..5619e7dc1b4 100644 --- a/pkg/apis/cosigned/v1alpha1/doc.go +++ b/pkg/apis/policycontroller/v1alpha1/doc.go @@ -13,5 +13,5 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +groupName=cosigned.sigstore.dev +// +groupName=policycontroller.sigstore.dev package v1alpha1 diff --git a/pkg/apis/cosigned/v1alpha1/register.go b/pkg/apis/policycontroller/v1alpha1/register.go similarity index 90% rename from pkg/apis/cosigned/v1alpha1/register.go rename to pkg/apis/policycontroller/v1alpha1/register.go index baa765853b0..d30bdefe963 100644 --- a/pkg/apis/cosigned/v1alpha1/register.go +++ b/pkg/apis/policycontroller/v1alpha1/register.go @@ -15,7 +15,7 @@ package v1alpha1 import ( - "github.com/sigstore/cosign/pkg/apis/cosigned" + policycontroller "github.com/sigstore/cosign/pkg/apis/policycontroller" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -23,7 +23,7 @@ import ( ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: cosigned.GroupName, Version: "v1alpha1"} +var SchemeGroupVersion = schema.GroupVersion{Group: policycontroller.GroupName, Version: "v1alpha1"} // Kind takes an unqualified kind and returns back a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/pkg/apis/cosigned/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/policycontroller/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/zz_generated.deepcopy.go rename to pkg/apis/policycontroller/v1alpha1/zz_generated.deepcopy.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_conversion.go b/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_conversion.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_conversion.go rename to pkg/apis/policycontroller/v1beta1/clusterimagepolicy_conversion.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_conversion_test.go b/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_conversion_test.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_conversion_test.go rename to pkg/apis/policycontroller/v1beta1/clusterimagepolicy_conversion_test.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_defaults.go b/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_defaults.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_defaults.go rename to pkg/apis/policycontroller/v1beta1/clusterimagepolicy_defaults.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_defaults_test.go b/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_defaults_test.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_defaults_test.go rename to pkg/apis/policycontroller/v1beta1/clusterimagepolicy_defaults_test.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_types.go b/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_types.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_types.go rename to pkg/apis/policycontroller/v1beta1/clusterimagepolicy_types.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_validation.go b/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_validation.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_validation.go rename to pkg/apis/policycontroller/v1beta1/clusterimagepolicy_validation.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_validation_test.go b/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_validation_test.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_validation_test.go rename to pkg/apis/policycontroller/v1beta1/clusterimagepolicy_validation_test.go diff --git a/pkg/apis/cosigned/v1beta1/doc.go b/pkg/apis/policycontroller/v1beta1/doc.go similarity index 93% rename from pkg/apis/cosigned/v1beta1/doc.go rename to pkg/apis/policycontroller/v1beta1/doc.go index 56d342553c7..d760ba90fa5 100644 --- a/pkg/apis/cosigned/v1beta1/doc.go +++ b/pkg/apis/policycontroller/v1beta1/doc.go @@ -13,5 +13,5 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +groupName=cosigned.sigstore.dev +// +groupName=policycontroller.sigstore.dev package v1beta1 diff --git a/pkg/apis/cosigned/v1beta1/register.go b/pkg/apis/policycontroller/v1beta1/register.go similarity index 90% rename from pkg/apis/cosigned/v1beta1/register.go rename to pkg/apis/policycontroller/v1beta1/register.go index 8dfb06ec6d1..b18174acc18 100644 --- a/pkg/apis/cosigned/v1beta1/register.go +++ b/pkg/apis/policycontroller/v1beta1/register.go @@ -15,7 +15,7 @@ package v1beta1 import ( - "github.com/sigstore/cosign/pkg/apis/cosigned" + policycontroller "github.com/sigstore/cosign/pkg/apis/policycontroller" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -23,7 +23,7 @@ import ( ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: cosigned.GroupName, Version: "v1beta1"} +var SchemeGroupVersion = schema.GroupVersion{Group: policycontroller.GroupName, Version: "v1beta1"} // Kind takes an unqualified kind and returns back a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/pkg/apis/cosigned/v1beta1/zz_generated.deepcopy.go b/pkg/apis/policycontroller/v1beta1/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/zz_generated.deepcopy.go rename to pkg/apis/policycontroller/v1beta1/zz_generated.deepcopy.go diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index e023fa11ed2..b49256a0879 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -20,8 +20,8 @@ import ( "fmt" "net/http" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1alpha1" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1beta1" + policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1" + policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -29,26 +29,26 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - CosignedV1alpha1() cosignedv1alpha1.CosignedV1alpha1Interface - CosignedV1beta1() cosignedv1beta1.CosignedV1beta1Interface + PolicycontrollerV1alpha1() policycontrollerv1alpha1.PolicycontrollerV1alpha1Interface + PolicycontrollerV1beta1() policycontrollerv1beta1.PolicycontrollerV1beta1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - cosignedV1alpha1 *cosignedv1alpha1.CosignedV1alpha1Client - cosignedV1beta1 *cosignedv1beta1.CosignedV1beta1Client + policycontrollerV1alpha1 *policycontrollerv1alpha1.PolicycontrollerV1alpha1Client + policycontrollerV1beta1 *policycontrollerv1beta1.PolicycontrollerV1beta1Client } -// CosignedV1alpha1 retrieves the CosignedV1alpha1Client -func (c *Clientset) CosignedV1alpha1() cosignedv1alpha1.CosignedV1alpha1Interface { - return c.cosignedV1alpha1 +// PolicycontrollerV1alpha1 retrieves the PolicycontrollerV1alpha1Client +func (c *Clientset) PolicycontrollerV1alpha1() policycontrollerv1alpha1.PolicycontrollerV1alpha1Interface { + return c.policycontrollerV1alpha1 } -// CosignedV1beta1 retrieves the CosignedV1beta1Client -func (c *Clientset) CosignedV1beta1() cosignedv1beta1.CosignedV1beta1Interface { - return c.cosignedV1beta1 +// PolicycontrollerV1beta1 retrieves the PolicycontrollerV1beta1Client +func (c *Clientset) PolicycontrollerV1beta1() policycontrollerv1beta1.PolicycontrollerV1beta1Interface { + return c.policycontrollerV1beta1 } // Discovery retrieves the DiscoveryClient @@ -95,11 +95,11 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, var cs Clientset var err error - cs.cosignedV1alpha1, err = cosignedv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.policycontrollerV1alpha1, err = policycontrollerv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } - cs.cosignedV1beta1, err = cosignedv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.policycontrollerV1beta1, err = policycontrollerv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -124,8 +124,8 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.cosignedV1alpha1 = cosignedv1alpha1.New(c) - cs.cosignedV1beta1 = cosignedv1beta1.New(c) + cs.policycontrollerV1alpha1 = policycontrollerv1alpha1.New(c) + cs.policycontrollerV1beta1 = policycontrollerv1beta1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 19f931ae9b6..bd6b5828a20 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -18,10 +18,10 @@ package fake import ( clientset "github.com/sigstore/cosign/pkg/client/clientset/versioned" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1alpha1" - fakecosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1beta1" - fakecosignedv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake" + policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1" + fakepolicycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake" + policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1" + fakepolicycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -79,12 +79,12 @@ var ( _ testing.FakeClient = &Clientset{} ) -// CosignedV1alpha1 retrieves the CosignedV1alpha1Client -func (c *Clientset) CosignedV1alpha1() cosignedv1alpha1.CosignedV1alpha1Interface { - return &fakecosignedv1alpha1.FakeCosignedV1alpha1{Fake: &c.Fake} +// PolicycontrollerV1alpha1 retrieves the PolicycontrollerV1alpha1Client +func (c *Clientset) PolicycontrollerV1alpha1() policycontrollerv1alpha1.PolicycontrollerV1alpha1Interface { + return &fakepolicycontrollerv1alpha1.FakePolicycontrollerV1alpha1{Fake: &c.Fake} } -// CosignedV1beta1 retrieves the CosignedV1beta1Client -func (c *Clientset) CosignedV1beta1() cosignedv1beta1.CosignedV1beta1Interface { - return &fakecosignedv1beta1.FakeCosignedV1beta1{Fake: &c.Fake} +// PolicycontrollerV1beta1 retrieves the PolicycontrollerV1beta1Client +func (c *Clientset) PolicycontrollerV1beta1() policycontrollerv1beta1.PolicycontrollerV1beta1Interface { + return &fakepolicycontrollerv1beta1.FakePolicycontrollerV1beta1{Fake: &c.Fake} } diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index cd26fda450b..4d459f361c4 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -17,8 +17,8 @@ package fake import ( - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,8 +30,8 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - cosignedv1alpha1.AddToScheme, - cosignedv1beta1.AddToScheme, + policycontrollerv1alpha1.AddToScheme, + policycontrollerv1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index cfe12d5ee5f..82a9c5709cd 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -17,8 +17,8 @@ package scheme import ( - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,8 +30,8 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - cosignedv1alpha1.AddToScheme, - cosignedv1beta1.AddToScheme, + policycontrollerv1alpha1.AddToScheme, + policycontrollerv1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/clusterimagepolicy.go b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/clusterimagepolicy.go similarity index 97% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/clusterimagepolicy.go index ae8e6c7d8b0..c364c6fa1b3 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/clusterimagepolicy.go +++ b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/clusterimagepolicy.go @@ -20,7 +20,7 @@ import ( "context" "time" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" scheme "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -53,7 +53,7 @@ type clusterImagePolicies struct { } // newClusterImagePolicies returns a ClusterImagePolicies -func newClusterImagePolicies(c *CosignedV1alpha1Client) *clusterImagePolicies { +func newClusterImagePolicies(c *PolicycontrollerV1alpha1Client) *clusterImagePolicies { return &clusterImagePolicies{ client: c.RESTClient(), } diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/doc.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/doc.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/doc.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/fake_clusterimagepolicy.go b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_clusterimagepolicy.go similarity index 93% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/fake_clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_clusterimagepolicy.go index 43f370cbdb4..3d880567e76 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/fake_clusterimagepolicy.go +++ b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_clusterimagepolicy.go @@ -19,7 +19,7 @@ package fake import ( "context" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,12 +30,12 @@ import ( // FakeClusterImagePolicies implements ClusterImagePolicyInterface type FakeClusterImagePolicies struct { - Fake *FakeCosignedV1alpha1 + Fake *FakePolicycontrollerV1alpha1 } -var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "cosigned.sigstore.dev", Version: "v1alpha1", Resource: "clusterimagepolicies"} +var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "policycontroller.sigstore.dev", Version: "v1alpha1", Resource: "clusterimagepolicies"} -var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "cosigned.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy"} +var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "policycontroller.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy"} // Get takes name of the clusterImagePolicy, and returns the corresponding clusterImagePolicy object, and an error if there is any. func (c *FakeClusterImagePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterImagePolicy, err error) { diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/fake_cosigned_client.go b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_policycontroller_client.go similarity index 80% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/fake_cosigned_client.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_policycontroller_client.go index 77a953449a8..92562e91bdf 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/fake_cosigned_client.go +++ b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_policycontroller_client.go @@ -17,22 +17,22 @@ package fake import ( - v1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeCosignedV1alpha1 struct { +type FakePolicycontrollerV1alpha1 struct { *testing.Fake } -func (c *FakeCosignedV1alpha1) ClusterImagePolicies() v1alpha1.ClusterImagePolicyInterface { +func (c *FakePolicycontrollerV1alpha1) ClusterImagePolicies() v1alpha1.ClusterImagePolicyInterface { return &FakeClusterImagePolicies{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeCosignedV1alpha1) RESTClient() rest.Interface { +func (c *FakePolicycontrollerV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/generated_expansion.go similarity index 100% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/generated_expansion.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/cosigned_client.go b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/policycontroller_client.go similarity index 63% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/cosigned_client.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/policycontroller_client.go index bf26d015cc2..94fe33033a8 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/cosigned_client.go +++ b/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/policycontroller_client.go @@ -19,29 +19,29 @@ package v1alpha1 import ( "net/http" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type CosignedV1alpha1Interface interface { +type PolicycontrollerV1alpha1Interface interface { RESTClient() rest.Interface ClusterImagePoliciesGetter } -// CosignedV1alpha1Client is used to interact with features provided by the cosigned.sigstore.dev group. -type CosignedV1alpha1Client struct { +// PolicycontrollerV1alpha1Client is used to interact with features provided by the policycontroller.sigstore.dev group. +type PolicycontrollerV1alpha1Client struct { restClient rest.Interface } -func (c *CosignedV1alpha1Client) ClusterImagePolicies() ClusterImagePolicyInterface { +func (c *PolicycontrollerV1alpha1Client) ClusterImagePolicies() ClusterImagePolicyInterface { return newClusterImagePolicies(c) } -// NewForConfig creates a new CosignedV1alpha1Client for the given config. +// NewForConfig creates a new PolicycontrollerV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*CosignedV1alpha1Client, error) { +func NewForConfig(c *rest.Config) (*PolicycontrollerV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -53,9 +53,9 @@ func NewForConfig(c *rest.Config) (*CosignedV1alpha1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new CosignedV1alpha1Client for the given config and http client. +// NewForConfigAndClient creates a new PolicycontrollerV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CosignedV1alpha1Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicycontrollerV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -64,12 +64,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CosignedV1alpha1Cli if err != nil { return nil, err } - return &CosignedV1alpha1Client{client}, nil + return &PolicycontrollerV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new CosignedV1alpha1Client for the given config and +// NewForConfigOrDie creates a new PolicycontrollerV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CosignedV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *PolicycontrollerV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -77,9 +77,9 @@ func NewForConfigOrDie(c *rest.Config) *CosignedV1alpha1Client { return client } -// New creates a new CosignedV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *CosignedV1alpha1Client { - return &CosignedV1alpha1Client{c} +// New creates a new PolicycontrollerV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *PolicycontrollerV1alpha1Client { + return &PolicycontrollerV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -97,7 +97,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *CosignedV1alpha1Client) RESTClient() rest.Interface { +func (c *PolicycontrollerV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/clusterimagepolicy.go b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/clusterimagepolicy.go similarity index 97% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1beta1/clusterimagepolicy.go index 82e50d66f2e..4b1e670bf24 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/clusterimagepolicy.go +++ b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/clusterimagepolicy.go @@ -20,7 +20,7 @@ import ( "context" "time" - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" scheme "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -53,7 +53,7 @@ type clusterImagePolicies struct { } // newClusterImagePolicies returns a ClusterImagePolicies -func newClusterImagePolicies(c *CosignedV1beta1Client) *clusterImagePolicies { +func newClusterImagePolicies(c *PolicycontrollerV1beta1Client) *clusterImagePolicies { return &clusterImagePolicies{ client: c.RESTClient(), } diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/doc.go b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/doc.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1beta1/doc.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/doc.go b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/doc.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/fake_clusterimagepolicy.go b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_clusterimagepolicy.go similarity index 93% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/fake_clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_clusterimagepolicy.go index 9120290357a..b6592a8e3b4 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/fake_clusterimagepolicy.go +++ b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_clusterimagepolicy.go @@ -19,7 +19,7 @@ package fake import ( "context" - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,12 +30,12 @@ import ( // FakeClusterImagePolicies implements ClusterImagePolicyInterface type FakeClusterImagePolicies struct { - Fake *FakeCosignedV1beta1 + Fake *FakePolicycontrollerV1beta1 } -var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "cosigned.sigstore.dev", Version: "v1beta1", Resource: "clusterimagepolicies"} +var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "policycontroller.sigstore.dev", Version: "v1beta1", Resource: "clusterimagepolicies"} -var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "cosigned.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy"} +var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "policycontroller.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy"} // Get takes name of the clusterImagePolicy, and returns the corresponding clusterImagePolicy object, and an error if there is any. func (c *FakeClusterImagePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterImagePolicy, err error) { diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/fake_cosigned_client.go b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_policycontroller_client.go similarity index 80% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/fake_cosigned_client.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_policycontroller_client.go index eca513ac70e..f86282c33c4 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/fake_cosigned_client.go +++ b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_policycontroller_client.go @@ -17,22 +17,22 @@ package fake import ( - v1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeCosignedV1beta1 struct { +type FakePolicycontrollerV1beta1 struct { *testing.Fake } -func (c *FakeCosignedV1beta1) ClusterImagePolicies() v1beta1.ClusterImagePolicyInterface { +func (c *FakePolicycontrollerV1beta1) ClusterImagePolicies() v1beta1.ClusterImagePolicyInterface { return &FakeClusterImagePolicies{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeCosignedV1beta1) RESTClient() rest.Interface { +func (c *FakePolicycontrollerV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/generated_expansion.go b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/generated_expansion.go similarity index 100% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1beta1/generated_expansion.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/cosigned_client.go b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/policycontroller_client.go similarity index 64% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/cosigned_client.go rename to pkg/client/clientset/versioned/typed/policycontroller/v1beta1/policycontroller_client.go index 90bbd4d7097..fad29722bf0 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/cosigned_client.go +++ b/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/policycontroller_client.go @@ -19,29 +19,29 @@ package v1beta1 import ( "net/http" - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type CosignedV1beta1Interface interface { +type PolicycontrollerV1beta1Interface interface { RESTClient() rest.Interface ClusterImagePoliciesGetter } -// CosignedV1beta1Client is used to interact with features provided by the cosigned.sigstore.dev group. -type CosignedV1beta1Client struct { +// PolicycontrollerV1beta1Client is used to interact with features provided by the policycontroller.sigstore.dev group. +type PolicycontrollerV1beta1Client struct { restClient rest.Interface } -func (c *CosignedV1beta1Client) ClusterImagePolicies() ClusterImagePolicyInterface { +func (c *PolicycontrollerV1beta1Client) ClusterImagePolicies() ClusterImagePolicyInterface { return newClusterImagePolicies(c) } -// NewForConfig creates a new CosignedV1beta1Client for the given config. +// NewForConfig creates a new PolicycontrollerV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*CosignedV1beta1Client, error) { +func NewForConfig(c *rest.Config) (*PolicycontrollerV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -53,9 +53,9 @@ func NewForConfig(c *rest.Config) (*CosignedV1beta1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new CosignedV1beta1Client for the given config and http client. +// NewForConfigAndClient creates a new PolicycontrollerV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CosignedV1beta1Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicycontrollerV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -64,12 +64,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CosignedV1beta1Clie if err != nil { return nil, err } - return &CosignedV1beta1Client{client}, nil + return &PolicycontrollerV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new CosignedV1beta1Client for the given config and +// NewForConfigOrDie creates a new PolicycontrollerV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *CosignedV1beta1Client { +func NewForConfigOrDie(c *rest.Config) *PolicycontrollerV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -77,9 +77,9 @@ func NewForConfigOrDie(c *rest.Config) *CosignedV1beta1Client { return client } -// New creates a new CosignedV1beta1Client for the given RESTClient. -func New(c rest.Interface) *CosignedV1beta1Client { - return &CosignedV1beta1Client{c} +// New creates a new PolicycontrollerV1beta1Client for the given RESTClient. +func New(c rest.Interface) *PolicycontrollerV1beta1Client { + return &PolicycontrollerV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -97,7 +97,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *CosignedV1beta1Client) RESTClient() rest.Interface { +func (c *PolicycontrollerV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index dd335c60f74..b5d2716e3f4 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -22,8 +22,8 @@ import ( time "time" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - cosigned "github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned" internalinterfaces "github.com/sigstore/cosign/pkg/client/informers/externalversions/internalinterfaces" + policycontroller "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -170,9 +170,9 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - Cosigned() cosigned.Interface + Policycontroller() policycontroller.Interface } -func (f *sharedInformerFactory) Cosigned() cosigned.Interface { - return cosigned.New(f, f.namespace, f.tweakListOptions) +func (f *sharedInformerFactory) Policycontroller() policycontroller.Interface { + return policycontroller.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 3875bd4e9fc..e6ebf78bdbd 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -19,8 +19,8 @@ package externalversions import ( "fmt" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -51,13 +51,13 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=cosigned.sigstore.dev, Version=v1alpha1 + // Group=policycontroller.sigstore.dev, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithResource("clusterimagepolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Cosigned().V1alpha1().ClusterImagePolicies().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Policycontroller().V1alpha1().ClusterImagePolicies().Informer()}, nil - // Group=cosigned.sigstore.dev, Version=v1beta1 + // Group=policycontroller.sigstore.dev, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithResource("clusterimagepolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Cosigned().V1beta1().ClusterImagePolicies().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Policycontroller().V1beta1().ClusterImagePolicies().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/cosigned/interface.go b/pkg/client/informers/externalversions/policycontroller/interface.go similarity index 95% rename from pkg/client/informers/externalversions/cosigned/interface.go rename to pkg/client/informers/externalversions/policycontroller/interface.go index 96625713d1f..20eb005c11f 100644 --- a/pkg/client/informers/externalversions/cosigned/interface.go +++ b/pkg/client/informers/externalversions/policycontroller/interface.go @@ -14,12 +14,12 @@ // Code generated by informer-gen. DO NOT EDIT. -package cosigned +package policycontroller import ( - v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1alpha1" - v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1beta1" internalinterfaces "github.com/sigstore/cosign/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1" + v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1" ) // Interface provides access to each of this group's versions. diff --git a/pkg/client/informers/externalversions/cosigned/v1alpha1/clusterimagepolicy.go b/pkg/client/informers/externalversions/policycontroller/v1alpha1/clusterimagepolicy.go similarity index 86% rename from pkg/client/informers/externalversions/cosigned/v1alpha1/clusterimagepolicy.go rename to pkg/client/informers/externalversions/policycontroller/v1alpha1/clusterimagepolicy.go index 6403e4fdc68..50b3b076ce2 100644 --- a/pkg/client/informers/externalversions/cosigned/v1alpha1/clusterimagepolicy.go +++ b/pkg/client/informers/externalversions/policycontroller/v1alpha1/clusterimagepolicy.go @@ -20,10 +20,10 @@ import ( "context" time "time" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" internalinterfaces "github.com/sigstore/cosign/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -59,16 +59,16 @@ func NewFilteredClusterImagePolicyInformer(client versioned.Interface, resyncPer if tweakListOptions != nil { tweakListOptions(&options) } - return client.CosignedV1alpha1().ClusterImagePolicies().List(context.TODO(), options) + return client.PolicycontrollerV1alpha1().ClusterImagePolicies().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CosignedV1alpha1().ClusterImagePolicies().Watch(context.TODO(), options) + return client.PolicycontrollerV1alpha1().ClusterImagePolicies().Watch(context.TODO(), options) }, }, - &cosignedv1alpha1.ClusterImagePolicy{}, + &policycontrollerv1alpha1.ClusterImagePolicy{}, resyncPeriod, indexers, ) @@ -79,7 +79,7 @@ func (f *clusterImagePolicyInformer) defaultInformer(client versioned.Interface, } func (f *clusterImagePolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&cosignedv1alpha1.ClusterImagePolicy{}, f.defaultInformer) + return f.factory.InformerFor(&policycontrollerv1alpha1.ClusterImagePolicy{}, f.defaultInformer) } func (f *clusterImagePolicyInformer) Lister() v1alpha1.ClusterImagePolicyLister { diff --git a/pkg/client/informers/externalversions/cosigned/v1alpha1/interface.go b/pkg/client/informers/externalversions/policycontroller/v1alpha1/interface.go similarity index 100% rename from pkg/client/informers/externalversions/cosigned/v1alpha1/interface.go rename to pkg/client/informers/externalversions/policycontroller/v1alpha1/interface.go diff --git a/pkg/client/informers/externalversions/cosigned/v1beta1/clusterimagepolicy.go b/pkg/client/informers/externalversions/policycontroller/v1beta1/clusterimagepolicy.go similarity index 86% rename from pkg/client/informers/externalversions/cosigned/v1beta1/clusterimagepolicy.go rename to pkg/client/informers/externalversions/policycontroller/v1beta1/clusterimagepolicy.go index e952111966d..a2e22a381ea 100644 --- a/pkg/client/informers/externalversions/cosigned/v1beta1/clusterimagepolicy.go +++ b/pkg/client/informers/externalversions/policycontroller/v1beta1/clusterimagepolicy.go @@ -20,10 +20,10 @@ import ( "context" time "time" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" internalinterfaces "github.com/sigstore/cosign/pkg/client/informers/externalversions/internalinterfaces" - v1beta1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -59,16 +59,16 @@ func NewFilteredClusterImagePolicyInformer(client versioned.Interface, resyncPer if tweakListOptions != nil { tweakListOptions(&options) } - return client.CosignedV1beta1().ClusterImagePolicies().List(context.TODO(), options) + return client.PolicycontrollerV1beta1().ClusterImagePolicies().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CosignedV1beta1().ClusterImagePolicies().Watch(context.TODO(), options) + return client.PolicycontrollerV1beta1().ClusterImagePolicies().Watch(context.TODO(), options) }, }, - &cosignedv1beta1.ClusterImagePolicy{}, + &policycontrollerv1beta1.ClusterImagePolicy{}, resyncPeriod, indexers, ) @@ -79,7 +79,7 @@ func (f *clusterImagePolicyInformer) defaultInformer(client versioned.Interface, } func (f *clusterImagePolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&cosignedv1beta1.ClusterImagePolicy{}, f.defaultInformer) + return f.factory.InformerFor(&policycontrollerv1beta1.ClusterImagePolicy{}, f.defaultInformer) } func (f *clusterImagePolicyInformer) Lister() v1beta1.ClusterImagePolicyLister { diff --git a/pkg/client/informers/externalversions/cosigned/v1beta1/interface.go b/pkg/client/informers/externalversions/policycontroller/v1beta1/interface.go similarity index 100% rename from pkg/client/informers/externalversions/cosigned/v1beta1/interface.go rename to pkg/client/informers/externalversions/policycontroller/v1beta1/interface.go diff --git a/pkg/client/injection/client/client.go b/pkg/client/injection/client/client.go index 2a4e5914d85..bb465b97b50 100644 --- a/pkg/client/injection/client/client.go +++ b/pkg/client/injection/client/client.go @@ -22,11 +22,11 @@ import ( errors "errors" fmt "fmt" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - typedcosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1alpha1" - typedcosignedv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1beta1" + typedpolicycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1" + typedpolicycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" @@ -96,40 +96,40 @@ func convert(from interface{}, to runtime.Object) error { return nil } -// CosignedV1alpha1 retrieves the CosignedV1alpha1Client -func (w *wrapClient) CosignedV1alpha1() typedcosignedv1alpha1.CosignedV1alpha1Interface { - return &wrapCosignedV1alpha1{ +// PolicycontrollerV1alpha1 retrieves the PolicycontrollerV1alpha1Client +func (w *wrapClient) PolicycontrollerV1alpha1() typedpolicycontrollerv1alpha1.PolicycontrollerV1alpha1Interface { + return &wrapPolicycontrollerV1alpha1{ dyn: w.dyn, } } -type wrapCosignedV1alpha1 struct { +type wrapPolicycontrollerV1alpha1 struct { dyn dynamic.Interface } -func (w *wrapCosignedV1alpha1) RESTClient() rest.Interface { +func (w *wrapPolicycontrollerV1alpha1) RESTClient() rest.Interface { panic("RESTClient called on dynamic client!") } -func (w *wrapCosignedV1alpha1) ClusterImagePolicies() typedcosignedv1alpha1.ClusterImagePolicyInterface { - return &wrapCosignedV1alpha1ClusterImagePolicyImpl{ +func (w *wrapPolicycontrollerV1alpha1) ClusterImagePolicies() typedpolicycontrollerv1alpha1.ClusterImagePolicyInterface { + return &wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl{ dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "cosigned.sigstore.dev", + Group: "policycontroller.sigstore.dev", Version: "v1alpha1", Resource: "clusterimagepolicies", }), } } -type wrapCosignedV1alpha1ClusterImagePolicyImpl struct { +type wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl struct { dyn dynamic.NamespaceableResourceInterface } -var _ typedcosignedv1alpha1.ClusterImagePolicyInterface = (*wrapCosignedV1alpha1ClusterImagePolicyImpl)(nil) +var _ typedpolicycontrollerv1alpha1.ClusterImagePolicyInterface = (*wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl)(nil) -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Create(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.CreateOptions) (*v1alpha1.ClusterImagePolicy, error) { +func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Create(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.CreateOptions) (*v1alpha1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policycontroller.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy", }) @@ -148,15 +148,15 @@ func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Create(ctx context.Context, return out, nil } -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return w.dyn.Delete(ctx, name, opts) } -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { return w.dyn.DeleteCollection(ctx, opts, listOpts) } -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterImagePolicy, error) { +func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterImagePolicy, error) { uo, err := w.dyn.Get(ctx, name, opts) if err != nil { return nil, err @@ -168,7 +168,7 @@ func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Get(ctx context.Context, na return out, nil } -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterImagePolicyList, error) { +func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterImagePolicyList, error) { uo, err := w.dyn.List(ctx, opts) if err != nil { return nil, err @@ -180,7 +180,7 @@ func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) List(ctx context.Context, o return out, nil } -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterImagePolicy, err error) { +func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterImagePolicy, err error) { uo, err := w.dyn.Patch(ctx, name, pt, data, opts) if err != nil { return nil, err @@ -192,9 +192,9 @@ func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Patch(ctx context.Context, return out, nil } -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { +func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policycontroller.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy", }) @@ -213,9 +213,9 @@ func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Update(ctx context.Context, return out, nil } -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { +func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policycontroller.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy", }) @@ -234,44 +234,44 @@ func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) UpdateStatus(ctx context.Co return out, nil } -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return nil, errors.New("NYI: Watch") } -// CosignedV1beta1 retrieves the CosignedV1beta1Client -func (w *wrapClient) CosignedV1beta1() typedcosignedv1beta1.CosignedV1beta1Interface { - return &wrapCosignedV1beta1{ +// PolicycontrollerV1beta1 retrieves the PolicycontrollerV1beta1Client +func (w *wrapClient) PolicycontrollerV1beta1() typedpolicycontrollerv1beta1.PolicycontrollerV1beta1Interface { + return &wrapPolicycontrollerV1beta1{ dyn: w.dyn, } } -type wrapCosignedV1beta1 struct { +type wrapPolicycontrollerV1beta1 struct { dyn dynamic.Interface } -func (w *wrapCosignedV1beta1) RESTClient() rest.Interface { +func (w *wrapPolicycontrollerV1beta1) RESTClient() rest.Interface { panic("RESTClient called on dynamic client!") } -func (w *wrapCosignedV1beta1) ClusterImagePolicies() typedcosignedv1beta1.ClusterImagePolicyInterface { - return &wrapCosignedV1beta1ClusterImagePolicyImpl{ +func (w *wrapPolicycontrollerV1beta1) ClusterImagePolicies() typedpolicycontrollerv1beta1.ClusterImagePolicyInterface { + return &wrapPolicycontrollerV1beta1ClusterImagePolicyImpl{ dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "cosigned.sigstore.dev", + Group: "policycontroller.sigstore.dev", Version: "v1beta1", Resource: "clusterimagepolicies", }), } } -type wrapCosignedV1beta1ClusterImagePolicyImpl struct { +type wrapPolicycontrollerV1beta1ClusterImagePolicyImpl struct { dyn dynamic.NamespaceableResourceInterface } -var _ typedcosignedv1beta1.ClusterImagePolicyInterface = (*wrapCosignedV1beta1ClusterImagePolicyImpl)(nil) +var _ typedpolicycontrollerv1beta1.ClusterImagePolicyInterface = (*wrapPolicycontrollerV1beta1ClusterImagePolicyImpl)(nil) -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Create(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.CreateOptions) (*v1beta1.ClusterImagePolicy, error) { +func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Create(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.CreateOptions) (*v1beta1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policycontroller.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy", }) @@ -290,15 +290,15 @@ func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Create(ctx context.Context, return out, nil } -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return w.dyn.Delete(ctx, name, opts) } -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { return w.dyn.DeleteCollection(ctx, opts, listOpts) } -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterImagePolicy, error) { +func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterImagePolicy, error) { uo, err := w.dyn.Get(ctx, name, opts) if err != nil { return nil, err @@ -310,7 +310,7 @@ func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Get(ctx context.Context, nam return out, nil } -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterImagePolicyList, error) { +func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterImagePolicyList, error) { uo, err := w.dyn.List(ctx, opts) if err != nil { return nil, err @@ -322,7 +322,7 @@ func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) List(ctx context.Context, op return out, nil } -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterImagePolicy, err error) { +func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterImagePolicy, err error) { uo, err := w.dyn.Patch(ctx, name, pt, data, opts) if err != nil { return nil, err @@ -334,9 +334,9 @@ func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Patch(ctx context.Context, n return out, nil } -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { +func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policycontroller.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy", }) @@ -355,9 +355,9 @@ func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Update(ctx context.Context, return out, nil } -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { +func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policycontroller.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy", }) @@ -376,6 +376,6 @@ func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) UpdateStatus(ctx context.Con return out, nil } -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return nil, errors.New("NYI: Watch") } diff --git a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/clusterimagepolicy.go b/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/clusterimagepolicy.go similarity index 73% rename from pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/clusterimagepolicy.go rename to pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/clusterimagepolicy.go index 2ff92059607..e50f2c4f268 100644 --- a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/clusterimagepolicy.go @@ -19,12 +19,12 @@ package clusterimagepolicy import ( context "context" - apiscosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + apispolicycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1" client "github.com/sigstore/cosign/pkg/client/injection/client" factory "github.com/sigstore/cosign/pkg/client/injection/informers/factory" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/v1alpha1" + policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" cache "k8s.io/client-go/tools/cache" @@ -43,7 +43,7 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Cosigned().V1alpha1().ClusterImagePolicies() + inf := f.Policycontroller().V1alpha1().ClusterImagePolicies() return context.WithValue(ctx, Key{}, inf), inf.Informer() } @@ -57,7 +57,7 @@ func Get(ctx context.Context) v1alpha1.ClusterImagePolicyInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1alpha1.ClusterImagePolicyInformer from context.") + "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1.ClusterImagePolicyInformer from context.") } return untyped.(v1alpha1.ClusterImagePolicyInformer) } @@ -69,13 +69,13 @@ type wrapper struct { } var _ v1alpha1.ClusterImagePolicyInformer = (*wrapper)(nil) -var _ cosignedv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policycontrollerv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apiscosignedv1alpha1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicycontrollerv1alpha1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() cosignedv1alpha1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policycontrollerv1alpha1.ClusterImagePolicyLister { return w } @@ -87,8 +87,8 @@ func (w *wrapper) SetResourceVersion(resourceVersion string) { w.resourceVersion = resourceVersion } -func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1alpha1.ClusterImagePolicy, err error) { - lo, err := w.client.CosignedV1alpha1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ +func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1alpha1.ClusterImagePolicy, err error) { + lo, err := w.client.PolicycontrollerV1alpha1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ LabelSelector: selector.String(), ResourceVersion: w.resourceVersion, }) @@ -101,8 +101,8 @@ func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1alpha1.Cl return ret, nil } -func (w *wrapper) Get(name string) (*apiscosignedv1alpha1.ClusterImagePolicy, error) { - return w.client.CosignedV1alpha1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ +func (w *wrapper) Get(name string) (*apispolicycontrollerv1alpha1.ClusterImagePolicy, error) { + return w.client.PolicycontrollerV1alpha1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ ResourceVersion: w.resourceVersion, }) } diff --git a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/fake/fake.go b/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/fake/fake.go similarity index 90% rename from pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/fake/fake.go rename to pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/fake/fake.go index eb8a3f43e2f..1f31e71ef44 100644 --- a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/fake/fake.go +++ b/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/fake/fake.go @@ -19,8 +19,8 @@ package fake import ( context "context" - clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy" fake "github.com/sigstore/cosign/pkg/client/injection/informers/factory/fake" + clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -33,6 +33,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Cosigned().V1alpha1().ClusterImagePolicies() + inf := f.Policycontroller().V1alpha1().ClusterImagePolicies() return context.WithValue(ctx, clusterimagepolicy.Key{}, inf), inf.Informer() } diff --git a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go b/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go similarity index 76% rename from pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go rename to pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go index 9bf353eec2e..b224b3166d6 100644 --- a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go @@ -19,12 +19,12 @@ package filtered import ( context "context" - apiscosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + apispolicycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1" client "github.com/sigstore/cosign/pkg/client/injection/client" filtered "github.com/sigstore/cosign/pkg/client/injection/informers/factory/filtered" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/v1alpha1" + policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" cache "k8s.io/client-go/tools/cache" @@ -53,7 +53,7 @@ func withInformer(ctx context.Context) (context.Context, []controller.Informer) infs := []controller.Informer{} for _, selector := range labelSelectors { f := filtered.Get(ctx, selector) - inf := f.Cosigned().V1alpha1().ClusterImagePolicies() + inf := f.Policycontroller().V1alpha1().ClusterImagePolicies() ctx = context.WithValue(ctx, Key{Selector: selector}, inf) infs = append(infs, inf.Informer()) } @@ -79,7 +79,7 @@ func Get(ctx context.Context, selector string) v1alpha1.ClusterImagePolicyInform untyped := ctx.Value(Key{Selector: selector}) if untyped == nil { logging.FromContext(ctx).Panicf( - "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1alpha1.ClusterImagePolicyInformer with selector %s from context.", selector) + "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1.ClusterImagePolicyInformer with selector %s from context.", selector) } return untyped.(v1alpha1.ClusterImagePolicyInformer) } @@ -91,23 +91,23 @@ type wrapper struct { } var _ v1alpha1.ClusterImagePolicyInformer = (*wrapper)(nil) -var _ cosignedv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policycontrollerv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apiscosignedv1alpha1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicycontrollerv1alpha1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() cosignedv1alpha1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policycontrollerv1alpha1.ClusterImagePolicyLister { return w } -func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1alpha1.ClusterImagePolicy, err error) { +func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1alpha1.ClusterImagePolicy, err error) { reqs, err := labels.ParseToRequirements(w.selector) if err != nil { return nil, err } selector = selector.Add(reqs...) - lo, err := w.client.CosignedV1alpha1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ + lo, err := w.client.PolicycontrollerV1alpha1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ LabelSelector: selector.String(), // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. }) @@ -120,9 +120,9 @@ func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1alpha1.Cl return ret, nil } -func (w *wrapper) Get(name string) (*apiscosignedv1alpha1.ClusterImagePolicy, error) { +func (w *wrapper) Get(name string) (*apispolicycontrollerv1alpha1.ClusterImagePolicy, error) { // TODO(mattmoor): Check that the fetched object matches the selector. - return w.client.CosignedV1alpha1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ + return w.client.PolicycontrollerV1alpha1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. }) } diff --git a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered/fake/fake.go b/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/fake/fake.go similarity index 92% rename from pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered/fake/fake.go rename to pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/fake/fake.go index 9ae1b0a8f2b..18467dd5a8f 100644 --- a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered/fake/fake.go +++ b/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/fake/fake.go @@ -19,8 +19,8 @@ package fake import ( context "context" - filtered "github.com/sigstore/cosign/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered" factoryfiltered "github.com/sigstore/cosign/pkg/client/injection/informers/factory/filtered" + filtered "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -42,7 +42,7 @@ func withInformer(ctx context.Context) (context.Context, []controller.Informer) infs := []controller.Informer{} for _, selector := range labelSelectors { f := factoryfiltered.Get(ctx, selector) - inf := f.Cosigned().V1beta1().ClusterImagePolicies() + inf := f.Policycontroller().V1alpha1().ClusterImagePolicies() ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) infs = append(infs, inf.Informer()) } diff --git a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/clusterimagepolicy.go b/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/clusterimagepolicy.go similarity index 73% rename from pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/clusterimagepolicy.go rename to pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/clusterimagepolicy.go index 93ad5da2422..418700dc7dc 100644 --- a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/clusterimagepolicy.go @@ -19,12 +19,12 @@ package clusterimagepolicy import ( context "context" - apiscosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + apispolicycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1" client "github.com/sigstore/cosign/pkg/client/injection/client" factory "github.com/sigstore/cosign/pkg/client/injection/informers/factory" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/v1beta1" + policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" cache "k8s.io/client-go/tools/cache" @@ -43,7 +43,7 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Cosigned().V1beta1().ClusterImagePolicies() + inf := f.Policycontroller().V1beta1().ClusterImagePolicies() return context.WithValue(ctx, Key{}, inf), inf.Informer() } @@ -57,7 +57,7 @@ func Get(ctx context.Context) v1beta1.ClusterImagePolicyInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1beta1.ClusterImagePolicyInformer from context.") + "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1.ClusterImagePolicyInformer from context.") } return untyped.(v1beta1.ClusterImagePolicyInformer) } @@ -69,13 +69,13 @@ type wrapper struct { } var _ v1beta1.ClusterImagePolicyInformer = (*wrapper)(nil) -var _ cosignedv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policycontrollerv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apiscosignedv1beta1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicycontrollerv1beta1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() cosignedv1beta1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policycontrollerv1beta1.ClusterImagePolicyLister { return w } @@ -87,8 +87,8 @@ func (w *wrapper) SetResourceVersion(resourceVersion string) { w.resourceVersion = resourceVersion } -func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1beta1.ClusterImagePolicy, err error) { - lo, err := w.client.CosignedV1beta1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ +func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1beta1.ClusterImagePolicy, err error) { + lo, err := w.client.PolicycontrollerV1beta1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ LabelSelector: selector.String(), ResourceVersion: w.resourceVersion, }) @@ -101,8 +101,8 @@ func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1beta1.Clu return ret, nil } -func (w *wrapper) Get(name string) (*apiscosignedv1beta1.ClusterImagePolicy, error) { - return w.client.CosignedV1beta1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ +func (w *wrapper) Get(name string) (*apispolicycontrollerv1beta1.ClusterImagePolicy, error) { + return w.client.PolicycontrollerV1beta1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ ResourceVersion: w.resourceVersion, }) } diff --git a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/fake/fake.go b/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/fake/fake.go similarity index 90% rename from pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/fake/fake.go rename to pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/fake/fake.go index 195133defd0..5d17892c965 100644 --- a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/fake/fake.go +++ b/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/fake/fake.go @@ -19,8 +19,8 @@ package fake import ( context "context" - clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy" fake "github.com/sigstore/cosign/pkg/client/injection/informers/factory/fake" + clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -33,6 +33,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Cosigned().V1beta1().ClusterImagePolicies() + inf := f.Policycontroller().V1beta1().ClusterImagePolicies() return context.WithValue(ctx, clusterimagepolicy.Key{}, inf), inf.Informer() } diff --git a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go b/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go similarity index 76% rename from pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go rename to pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go index 642dc133dc5..2c177e71c9a 100644 --- a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go @@ -19,12 +19,12 @@ package filtered import ( context "context" - apiscosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + apispolicycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1" client "github.com/sigstore/cosign/pkg/client/injection/client" filtered "github.com/sigstore/cosign/pkg/client/injection/informers/factory/filtered" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/v1beta1" + policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" cache "k8s.io/client-go/tools/cache" @@ -53,7 +53,7 @@ func withInformer(ctx context.Context) (context.Context, []controller.Informer) infs := []controller.Informer{} for _, selector := range labelSelectors { f := filtered.Get(ctx, selector) - inf := f.Cosigned().V1beta1().ClusterImagePolicies() + inf := f.Policycontroller().V1beta1().ClusterImagePolicies() ctx = context.WithValue(ctx, Key{Selector: selector}, inf) infs = append(infs, inf.Informer()) } @@ -79,7 +79,7 @@ func Get(ctx context.Context, selector string) v1beta1.ClusterImagePolicyInforme untyped := ctx.Value(Key{Selector: selector}) if untyped == nil { logging.FromContext(ctx).Panicf( - "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/cosigned/v1beta1.ClusterImagePolicyInformer with selector %s from context.", selector) + "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1.ClusterImagePolicyInformer with selector %s from context.", selector) } return untyped.(v1beta1.ClusterImagePolicyInformer) } @@ -91,23 +91,23 @@ type wrapper struct { } var _ v1beta1.ClusterImagePolicyInformer = (*wrapper)(nil) -var _ cosignedv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policycontrollerv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apiscosignedv1beta1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicycontrollerv1beta1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() cosignedv1beta1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policycontrollerv1beta1.ClusterImagePolicyLister { return w } -func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1beta1.ClusterImagePolicy, err error) { +func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1beta1.ClusterImagePolicy, err error) { reqs, err := labels.ParseToRequirements(w.selector) if err != nil { return nil, err } selector = selector.Add(reqs...) - lo, err := w.client.CosignedV1beta1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ + lo, err := w.client.PolicycontrollerV1beta1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ LabelSelector: selector.String(), // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. }) @@ -120,9 +120,9 @@ func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1beta1.Clu return ret, nil } -func (w *wrapper) Get(name string) (*apiscosignedv1beta1.ClusterImagePolicy, error) { +func (w *wrapper) Get(name string) (*apispolicycontrollerv1beta1.ClusterImagePolicy, error) { // TODO(mattmoor): Check that the fetched object matches the selector. - return w.client.CosignedV1beta1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ + return w.client.PolicycontrollerV1beta1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. }) } diff --git a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered/fake/fake.go b/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/fake/fake.go similarity index 92% rename from pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered/fake/fake.go rename to pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/fake/fake.go index 09735da0edb..631a62e80e8 100644 --- a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered/fake/fake.go +++ b/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/fake/fake.go @@ -19,8 +19,8 @@ package fake import ( context "context" - filtered "github.com/sigstore/cosign/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered" factoryfiltered "github.com/sigstore/cosign/pkg/client/injection/informers/factory/filtered" + filtered "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -42,7 +42,7 @@ func withInformer(ctx context.Context) (context.Context, []controller.Informer) infs := []controller.Informer{} for _, selector := range labelSelectors { f := factoryfiltered.Get(ctx, selector) - inf := f.Cosigned().V1alpha1().ClusterImagePolicies() + inf := f.Policycontroller().V1beta1().ClusterImagePolicies() ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) infs = append(infs, inf.Informer()) } diff --git a/pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/controller.go b/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/controller.go similarity index 95% rename from pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/controller.go rename to pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/controller.go index 8bb13274a3e..b169ac26c05 100644 --- a/pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/controller.go +++ b/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/controller.go @@ -24,7 +24,7 @@ import ( versionedscheme "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" client "github.com/sigstore/cosign/pkg/client/injection/client" - clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy" + clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy" zap "go.uber.org/zap" corev1 "k8s.io/api/core/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -42,7 +42,7 @@ import ( const ( defaultControllerAgentName = "clusterimagepolicy-controller" - defaultFinalizerName = "clusterimagepolicies.cosigned.sigstore.dev" + defaultFinalizerName = "clusterimagepolicies.policycontroller.sigstore.dev" ) // NewImpl returns a controller.Impl that handles queuing and feeding work from @@ -96,7 +96,7 @@ func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsF logger = logger.With( zap.String(logkey.ControllerType, ctrTypeName), - zap.String(logkey.Kind, "cosigned.sigstore.dev.ClusterImagePolicy"), + zap.String(logkey.Kind, "policycontroller.sigstore.dev.ClusterImagePolicy"), ) impl := controller.NewContext(ctx, rec, controller.ControllerOptions{WorkQueueName: ctrTypeName, Logger: logger}) diff --git a/pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/reconciler.go b/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/reconciler.go similarity index 96% rename from pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/reconciler.go rename to pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/reconciler.go index 861103f2bbd..8972125277e 100644 --- a/pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/reconciler.go +++ b/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/reconciler.go @@ -21,9 +21,9 @@ import ( json "encoding/json" fmt "fmt" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/v1alpha1" + policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" zap "go.uber.org/zap" v1 "k8s.io/api/core/v1" errors "k8s.io/apimachinery/pkg/api/errors" @@ -80,7 +80,7 @@ type reconcilerImpl struct { Client versioned.Interface // Listers index properties about resources. - Lister cosignedv1alpha1.ClusterImagePolicyLister + Lister policycontrollerv1alpha1.ClusterImagePolicyLister // Recorder is an event recorder for recording Event resources to the // Kubernetes API. @@ -103,7 +103,7 @@ var _ controller.Reconciler = (*reconcilerImpl)(nil) // Check that our generated Reconciler is always LeaderAware. var _ reconciler.LeaderAware = (*reconcilerImpl)(nil) -func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister cosignedv1alpha1.ClusterImagePolicyLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler { +func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister policycontrollerv1alpha1.ClusterImagePolicyLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler { // Check the options function input. It should be 0 or 1. if len(options) > 1 { logger.Fatal("Up to one options struct is supported, found: ", len(options)) @@ -316,7 +316,7 @@ func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource return resource, err } - patcher := r.Client.CosignedV1alpha1().ClusterImagePolicies() + patcher := r.Client.PolicycontrollerV1alpha1().ClusterImagePolicies() resourceName := resource.Name updated, err := patcher.Patch(ctx, resourceName, types.MergePatchType, patch, metav1.PatchOptions{}) diff --git a/pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/state.go b/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/state.go similarity index 97% rename from pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/state.go rename to pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/state.go index 284dd1d4ff4..d1eeb4479c8 100644 --- a/pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/state.go +++ b/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/state.go @@ -19,7 +19,7 @@ package clusterimagepolicy import ( fmt "fmt" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" types "k8s.io/apimachinery/pkg/types" cache "k8s.io/client-go/tools/cache" reconciler "knative.dev/pkg/reconciler" diff --git a/pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/controller.go b/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/controller.go similarity index 95% rename from pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/controller.go rename to pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/controller.go index 1dd6081ee4f..8a61f951722 100644 --- a/pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/controller.go +++ b/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/controller.go @@ -24,7 +24,7 @@ import ( versionedscheme "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" client "github.com/sigstore/cosign/pkg/client/injection/client" - clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy" + clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy" zap "go.uber.org/zap" corev1 "k8s.io/api/core/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -42,7 +42,7 @@ import ( const ( defaultControllerAgentName = "clusterimagepolicy-controller" - defaultFinalizerName = "clusterimagepolicies.cosigned.sigstore.dev" + defaultFinalizerName = "clusterimagepolicies.policycontroller.sigstore.dev" ) // NewImpl returns a controller.Impl that handles queuing and feeding work from @@ -96,7 +96,7 @@ func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsF logger = logger.With( zap.String(logkey.ControllerType, ctrTypeName), - zap.String(logkey.Kind, "cosigned.sigstore.dev.ClusterImagePolicy"), + zap.String(logkey.Kind, "policycontroller.sigstore.dev.ClusterImagePolicy"), ) impl := controller.NewContext(ctx, rec, controller.ControllerOptions{WorkQueueName: ctrTypeName, Logger: logger}) diff --git a/pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/reconciler.go b/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/reconciler.go similarity index 96% rename from pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/reconciler.go rename to pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/reconciler.go index 88fa7a3fe26..50192a870f5 100644 --- a/pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/reconciler.go +++ b/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/reconciler.go @@ -21,9 +21,9 @@ import ( json "encoding/json" fmt "fmt" - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/v1beta1" + policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1beta1" zap "go.uber.org/zap" v1 "k8s.io/api/core/v1" errors "k8s.io/apimachinery/pkg/api/errors" @@ -80,7 +80,7 @@ type reconcilerImpl struct { Client versioned.Interface // Listers index properties about resources. - Lister cosignedv1beta1.ClusterImagePolicyLister + Lister policycontrollerv1beta1.ClusterImagePolicyLister // Recorder is an event recorder for recording Event resources to the // Kubernetes API. @@ -103,7 +103,7 @@ var _ controller.Reconciler = (*reconcilerImpl)(nil) // Check that our generated Reconciler is always LeaderAware. var _ reconciler.LeaderAware = (*reconcilerImpl)(nil) -func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister cosignedv1beta1.ClusterImagePolicyLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler { +func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister policycontrollerv1beta1.ClusterImagePolicyLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler { // Check the options function input. It should be 0 or 1. if len(options) > 1 { logger.Fatal("Up to one options struct is supported, found: ", len(options)) @@ -316,7 +316,7 @@ func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource return resource, err } - patcher := r.Client.CosignedV1beta1().ClusterImagePolicies() + patcher := r.Client.PolicycontrollerV1beta1().ClusterImagePolicies() resourceName := resource.Name updated, err := patcher.Patch(ctx, resourceName, types.MergePatchType, patch, metav1.PatchOptions{}) diff --git a/pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/state.go b/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/state.go similarity index 97% rename from pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/state.go rename to pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/state.go index 7bb1188e615..f616c8432de 100644 --- a/pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/state.go +++ b/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/state.go @@ -19,7 +19,7 @@ package clusterimagepolicy import ( fmt "fmt" - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" types "k8s.io/apimachinery/pkg/types" cache "k8s.io/client-go/tools/cache" reconciler "knative.dev/pkg/reconciler" diff --git a/pkg/client/listers/cosigned/v1alpha1/clusterimagepolicy.go b/pkg/client/listers/policycontroller/v1alpha1/clusterimagepolicy.go similarity index 97% rename from pkg/client/listers/cosigned/v1alpha1/clusterimagepolicy.go rename to pkg/client/listers/policycontroller/v1alpha1/clusterimagepolicy.go index dcb0d873d31..5eb7e9a0ec5 100644 --- a/pkg/client/listers/cosigned/v1alpha1/clusterimagepolicy.go +++ b/pkg/client/listers/policycontroller/v1alpha1/clusterimagepolicy.go @@ -17,7 +17,7 @@ package v1alpha1 import ( - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/cosigned/v1alpha1/expansion_generated.go b/pkg/client/listers/policycontroller/v1alpha1/expansion_generated.go similarity index 100% rename from pkg/client/listers/cosigned/v1alpha1/expansion_generated.go rename to pkg/client/listers/policycontroller/v1alpha1/expansion_generated.go diff --git a/pkg/client/listers/cosigned/v1beta1/clusterimagepolicy.go b/pkg/client/listers/policycontroller/v1beta1/clusterimagepolicy.go similarity index 97% rename from pkg/client/listers/cosigned/v1beta1/clusterimagepolicy.go rename to pkg/client/listers/policycontroller/v1beta1/clusterimagepolicy.go index 81332814b0f..a44ce329efb 100644 --- a/pkg/client/listers/cosigned/v1beta1/clusterimagepolicy.go +++ b/pkg/client/listers/policycontroller/v1beta1/clusterimagepolicy.go @@ -17,7 +17,7 @@ package v1beta1 import ( - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/cosigned/v1beta1/expansion_generated.go b/pkg/client/listers/policycontroller/v1beta1/expansion_generated.go similarity index 100% rename from pkg/client/listers/cosigned/v1beta1/expansion_generated.go rename to pkg/client/listers/policycontroller/v1beta1/expansion_generated.go diff --git a/pkg/cosign/kubernetes/webhook/clusterimagepolicy/clusterimagepolicy_types.go b/pkg/cosign/kubernetes/webhook/clusterimagepolicy/clusterimagepolicy_types.go index 2a6ccf576aa..c5c41bace7c 100644 --- a/pkg/cosign/kubernetes/webhook/clusterimagepolicy/clusterimagepolicy_types.go +++ b/pkg/cosign/kubernetes/webhook/clusterimagepolicy/clusterimagepolicy_types.go @@ -25,7 +25,7 @@ import ( "github.com/google/go-containerregistry/pkg/authn/k8schain" "github.com/google/go-containerregistry/pkg/name" "github.com/google/go-containerregistry/pkg/v1/remote" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" ociremote "github.com/sigstore/cosign/pkg/oci/remote" "knative.dev/pkg/apis" kubeclient "knative.dev/pkg/client/injection/kube/client" diff --git a/pkg/cosign/kubernetes/webhook/validation.go b/pkg/cosign/kubernetes/webhook/validation.go index 278cc5439fc..0e3b42de637 100644 --- a/pkg/cosign/kubernetes/webhook/validation.go +++ b/pkg/cosign/kubernetes/webhook/validation.go @@ -28,7 +28,7 @@ import ( "knative.dev/pkg/logging" "github.com/sigstore/cosign/cmd/cosign/cli/fulcio/fulcioroots" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" "github.com/sigstore/cosign/pkg/cosign" "github.com/sigstore/cosign/pkg/oci" ociremote "github.com/sigstore/cosign/pkg/oci/remote" diff --git a/pkg/cosign/kubernetes/webhook/validator_test.go b/pkg/cosign/kubernetes/webhook/validator_test.go index 54db376a1e1..8f73fc783d2 100644 --- a/pkg/cosign/kubernetes/webhook/validator_test.go +++ b/pkg/cosign/kubernetes/webhook/validator_test.go @@ -35,7 +35,7 @@ import ( "github.com/google/go-containerregistry/pkg/authn/k8schain" "github.com/google/go-containerregistry/pkg/name" "github.com/sigstore/cosign/pkg/apis/config" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" "github.com/sigstore/cosign/pkg/cosign" webhookcip "github.com/sigstore/cosign/pkg/cosign/kubernetes/webhook/clusterimagepolicy" "github.com/sigstore/cosign/pkg/oci" diff --git a/pkg/policy/eval_test.go b/pkg/policy/eval_test.go index f83166ae0c2..3b001312a8b 100644 --- a/pkg/policy/eval_test.go +++ b/pkg/policy/eval_test.go @@ -28,7 +28,7 @@ const ( "predicateType": "cosign.sigstore.dev/attestation/v1", "subject": [ { - "name": "registry.local:5000/cosigned/demo", + "name": "registry.local:5000/policy-controller/demo", "digest": { "sha256": "416cc82c76114b1744ea58bcbf2f411a0f2de4b0456703bf1bb83d33656951bc" } @@ -46,7 +46,7 @@ const ( "predicateType": "cosign.sigstore.dev/attestation/vuln/v1", "subject": [ { - "name": "registry.local:5000/cosigned/demo", + "name": "registry.local:5000/policy-controller/demo", "digest": { "sha256": "416cc82c76114b1744ea58bcbf2f411a0f2de4b0456703bf1bb83d33656951bc" } diff --git a/pkg/reconciler/clusterimagepolicy/clusterimagepolicy.go b/pkg/reconciler/clusterimagepolicy/clusterimagepolicy.go index ec6420fe02d..a26c24927e5 100644 --- a/pkg/reconciler/clusterimagepolicy/clusterimagepolicy.go +++ b/pkg/reconciler/clusterimagepolicy/clusterimagepolicy.go @@ -21,9 +21,9 @@ import ( "strings" "github.com/sigstore/cosign/pkg/apis/config" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" "github.com/sigstore/cosign/pkg/apis/utils" - clusterimagepolicyreconciler "github.com/sigstore/cosign/pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy" + clusterimagepolicyreconciler "github.com/sigstore/cosign/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy" webhookcip "github.com/sigstore/cosign/pkg/cosign/kubernetes/webhook/clusterimagepolicy" "github.com/sigstore/cosign/pkg/reconciler/clusterimagepolicy/resources" diff --git a/pkg/reconciler/clusterimagepolicy/clusterimagepolicy_test.go b/pkg/reconciler/clusterimagepolicy/clusterimagepolicy_test.go index 2c25232a2a5..d95be2da9b8 100644 --- a/pkg/reconciler/clusterimagepolicy/clusterimagepolicy_test.go +++ b/pkg/reconciler/clusterimagepolicy/clusterimagepolicy_test.go @@ -25,9 +25,9 @@ import ( logtesting "knative.dev/pkg/logging/testing" "github.com/sigstore/cosign/pkg/apis/config" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" fakecosignclient "github.com/sigstore/cosign/pkg/client/injection/client/fake" - "github.com/sigstore/cosign/pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy" + "github.com/sigstore/cosign/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/reconciler/clusterimagepolicy/controller.go b/pkg/reconciler/clusterimagepolicy/controller.go index 3c77fc8c2ce..672300fcf92 100644 --- a/pkg/reconciler/clusterimagepolicy/controller.go +++ b/pkg/reconciler/clusterimagepolicy/controller.go @@ -32,15 +32,15 @@ import ( "knative.dev/pkg/system" "github.com/sigstore/cosign/pkg/apis/config" - clusterimagepolicyinformer "github.com/sigstore/cosign/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy" - clusterimagepolicyreconciler "github.com/sigstore/cosign/pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy" + clusterimagepolicyinformer "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy" + clusterimagepolicyreconciler "github.com/sigstore/cosign/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy" cminformer "knative.dev/pkg/injection/clients/namespacedkube/informers/core/v1/configmap" secretinformer "knative.dev/pkg/injection/clients/namespacedkube/informers/core/v1/secret" ) // This is what the default finalizer name is, but make it explicit so we can // use it in tests as well. -const finalizerName = "clusterimagepolicies.cosigned.sigstore.dev" +const finalizerName = "clusterimagepolicies.policycontroller.sigstore.dev" // NewController creates a Reconciler and returns the result of NewImpl. func NewController( diff --git a/pkg/reconciler/clusterimagepolicy/controller_test.go b/pkg/reconciler/clusterimagepolicy/controller_test.go index 6c2a8672471..1d08ac77f4b 100644 --- a/pkg/reconciler/clusterimagepolicy/controller_test.go +++ b/pkg/reconciler/clusterimagepolicy/controller_test.go @@ -21,7 +21,7 @@ import ( rtesting "knative.dev/pkg/reconciler/testing" // Fake injection informers - _ "github.com/sigstore/cosign/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/fake" + _ "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/fake" _ "knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/fake" _ "knative.dev/pkg/injection/clients/namespacedkube/informers/core/v1/configmap/fake" _ "knative.dev/pkg/injection/clients/namespacedkube/informers/core/v1/secret/fake" diff --git a/pkg/reconciler/testing/v1alpha1/clusterimagepolicy.go b/pkg/reconciler/testing/v1alpha1/clusterimagepolicy.go index 6087260f959..b30ee409179 100644 --- a/pkg/reconciler/testing/v1alpha1/clusterimagepolicy.go +++ b/pkg/reconciler/testing/v1alpha1/clusterimagepolicy.go @@ -18,11 +18,11 @@ import ( "context" "time" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -const finalizerName = "clusterimagepolicies.cosigned.sigstore.dev" +const finalizerName = "clusterimagepolicies.policycontroller.sigstore.dev" // ClusterImagePolicyOption enables further configuration of a ClusterImagePolicy. type ClusterImagePolicyOption func(*v1alpha1.ClusterImagePolicy) diff --git a/pkg/reconciler/testing/v1alpha1/listers.go b/pkg/reconciler/testing/v1alpha1/listers.go index 1c04d40845d..9d2a67c0d01 100644 --- a/pkg/reconciler/testing/v1alpha1/listers.go +++ b/pkg/reconciler/testing/v1alpha1/listers.go @@ -15,9 +15,9 @@ package testing import ( - "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" fakecosignclientset "github.com/sigstore/cosign/pkg/client/clientset/versioned/fake" - cosignlisters "github.com/sigstore/cosign/pkg/client/listers/cosigned/v1alpha1" + cosignlisters "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" fakekubeclientset "k8s.io/client-go/kubernetes/fake" diff --git a/test/ci.mk b/test/ci.mk index 00af339a778..5e144d121a6 100644 --- a/test/ci.mk +++ b/test/ci.mk @@ -6,9 +6,9 @@ sign-container: ko cosign sign --key .github/workflows/cosign-test.key -a GIT_HASH=$(GIT_HASH) ${KO_PREFIX}/cosign:$(GIT_HASH) -.PHONY: sign-cosigned -sign-cosigned: - cosign sign --key .github/workflows/cosign-test.key -a GIT_HASH=$(GIT_HASH) ${KO_PREFIX}/cosigned:$(GIT_HASH) +.PHONY: sign-policy-controller +sign-policy-controller: + cosign sign --key .github/workflows/cosign-test.key -a GIT_HASH=$(GIT_HASH) ${KO_PREFIX}/policy-controller:$(GIT_HASH) .PHONY: sign-sget sign-sget: @@ -19,10 +19,10 @@ sign-keyless-cosign: cosign sign -a sha=$(GIT_HASH) -a run_id=${GITHUB_RUN_ID} -a run_attempt=${GITHUB_RUN_ATTEMPT} ${KO_PREFIX}/cosign:$(GIT_HASH) cosign sign -a sha=$(GIT_HASH) -a run_id=${GITHUB_RUN_ID} -a run_attempt=${GITHUB_RUN_ATTEMPT} ${KO_PREFIX}/cosign:$(GIT_VERSION) -.PHONY: sign-keyless-cosigned -sign-keyless-cosigned: - cosign sign -a sha=$(GIT_HASH) -a run_id=${GITHUB_RUN_ID} -a run_attempt=${GITHUB_RUN_ATTEMPT} ${KO_PREFIX}/cosigned:$(GIT_HASH) - cosign sign -a sha=$(GIT_HASH) -a run_id=${GITHUB_RUN_ID} -a run_attempt=${GITHUB_RUN_ATTEMPT} ${KO_PREFIX}/cosigned:$(GIT_VERSION) +.PHONY: sign-keyless-policy-controller +sign-keyless-policy-controller: + cosign sign -a sha=$(GIT_HASH) -a run_id=${GITHUB_RUN_ID} -a run_attempt=${GITHUB_RUN_ATTEMPT} ${KO_PREFIX}/policy-controller:$(GIT_HASH) + cosign sign -a sha=$(GIT_HASH) -a run_id=${GITHUB_RUN_ID} -a run_attempt=${GITHUB_RUN_ATTEMPT} ${KO_PREFIX}/policy-controller:$(GIT_VERSION) .PHONY: sign-keyless-sget sign-keyless-sget: @@ -30,7 +30,7 @@ sign-keyless-sget: cosign sign -a sha=$(GIT_HASH) -a run_id=${GITHUB_RUN_ID} -a run_attempt=${GITHUB_RUN_ATTEMPT} ${KO_PREFIX}/sget:$(GIT_VERSION) .PHONY: sign-keyless-container -sign-keyless-container: ko sign-keyless-cosign sign-keyless-cosigned sign-keyless-sget +sign-keyless-container: ko sign-keyless-cosign sign-keyless-policy-controller sign-keyless-sget .PHONY: sign-blob-experimental sign-blob-experimental: diff --git a/test/e2e_test_cluster_image_policy.sh b/test/e2e_test_cluster_image_policy.sh index 6d63cfa909b..9ed2f2c6671 100755 --- a/test/e2e_test_cluster_image_policy.sh +++ b/test/e2e_test_cluster_image_policy.sh @@ -113,7 +113,7 @@ popd echo '::endgroup::' echo '::group:: Deploy ClusterImagePolicy with keyless signing' -kubectl apply -f ./test/testdata/cosigned/e2e/cip-keyless.yaml +kubectl apply -f ./test/testdata/policy-controller/e2e/cip-keyless.yaml echo '::endgroup::' echo '::group:: Sign demo image' @@ -126,7 +126,7 @@ echo '::endgroup::' echo '::group:: Create test namespace and label for verification' kubectl create namespace demo-keyless-signing -kubectl label namespace demo-keyless-signing cosigned.sigstore.dev/include=true +kubectl label namespace demo-keyless-signing policycontroller.sigstore.dev/include=true export NS=demo-keyless-signing echo '::endgroup::' @@ -151,7 +151,7 @@ fi echo '::endgroup::' echo '::group:: Add cip with identities that match issuer/subject' -kubectl apply -f ./test/testdata/cosigned/e2e/cip-keyless-with-identities.yaml +kubectl apply -f ./test/testdata/policy-controller/e2e/cip-keyless-with-identities.yaml # make sure the reconciler has enough time to update the configmap sleep 5 echo '::endgroup::' @@ -167,7 +167,7 @@ fi echo '::endgroup::' echo '::group:: Add cip with identities that do not match issuer/subject' -kubectl apply -f ./test/testdata/cosigned/e2e/cip-keyless-with-identities-mismatch.yaml +kubectl apply -f ./test/testdata/policy-controller/e2e/cip-keyless-with-identities-mismatch.yaml # make sure the reconciler has enough time to update the configmap sleep 5 echo '::endgroup::' @@ -190,13 +190,13 @@ echo '::endgroup::' echo '::group:: Deploy ClusterImagePolicy With Key Signing' yq '. | .spec.authorities[0].key.data |= load_str("cosign-colocated-signing.pub")' \ - ./test/testdata/cosigned/e2e/cip-key.yaml | \ + ./test/testdata/policy-controller/e2e/cip-key.yaml | \ kubectl apply -f - echo '::endgroup::' echo '::group:: Create and label new namespace for verification' kubectl create namespace demo-key-signing -kubectl label namespace demo-key-signing cosigned.sigstore.dev/include=true +kubectl label namespace demo-key-signing policycontroller.sigstore.dev/include=true echo '::group:: Verify blocks unsigned with the key' if kubectl create -n demo-key-signing job demo --image=${demoimage}; then @@ -242,7 +242,7 @@ echo '::endgroup::' echo '::group:: Deploy ClusterImagePolicy With Remote Public Key But Missing Source' yq '. | .metadata.name = "image-policy-remote-source" | .spec.authorities[0].key.data |= load_str("cosign-remote-signing.pub")' \ - ./test/testdata/cosigned/e2e/cip-key.yaml | \ + ./test/testdata/policy-controller/e2e/cip-key.yaml | \ kubectl apply -f - echo '::endgroup::' @@ -264,7 +264,7 @@ echo '::endgroup::' echo '::group:: Create test namespace and label for remote key verification' kubectl create namespace demo-key-remote -kubectl label namespace demo-key-remote cosigned.sigstore.dev/include=true +kubectl label namespace demo-key-remote policycontroller.sigstore.dev/include=true echo '::endgroup::' echo '::group:: Verify with three CIP, one without correct Source set' @@ -278,7 +278,7 @@ echo '::group:: Deploy ClusterImagePolicy With Remote Public Key With Source' yq '. | .metadata.name = "image-policy-remote-source" | .spec.authorities[0].key.data |= load_str("cosign-remote-signing.pub") | .spec.authorities[0] += {"source": [{"oci": env(KO_DOCKER_REPO)+"/remote-signature"}]}' \ - ./test/testdata/cosigned/e2e/cip-key.yaml | \ + ./test/testdata/policy-controller/e2e/cip-key.yaml | \ kubectl apply -f - echo '::endgroup::' diff --git a/test/e2e_test_cluster_image_policy_with_attestations.sh b/test/e2e_test_cluster_image_policy_with_attestations.sh index ce95ff76f2a..d963c9b1e8f 100755 --- a/test/e2e_test_cluster_image_policy_with_attestations.sh +++ b/test/e2e_test_cluster_image_policy_with_attestations.sh @@ -97,12 +97,12 @@ echo '::endgroup::' echo '::group:: Create and label new namespace for verification' kubectl create namespace demo-attestations -kubectl label namespace demo-attestations cosigned.sigstore.dev/include=true +kubectl label namespace demo-attestations policycontroller.sigstore.dev/include=true export NS=demo-attestations echo '::endgroup::' echo '::group:: Create CIP that requires keyless signature and custom attestation with policy' -kubectl apply -f ./test/testdata/cosigned/e2e/cip-keyless-with-attestations.yaml +kubectl apply -f ./test/testdata/policy-controller/e2e/cip-keyless-with-attestations.yaml # allow things to propagate sleep 5 echo '::endgroup::' @@ -151,7 +151,7 @@ echo '::endgroup::' # Ok, so now we have satisfied the keyless requirements, one signature, one # custom attestation. Let's now do it for 'keyful' one. echo '::group:: Create CIP that requires a keyful signature and an attestation' -yq '. | .spec.authorities[0].key.data |= load_str("cosign.pub") | .spec.authorities[1].key.data |= load_str("cosign.pub")' ./test/testdata/cosigned/e2e/cip-key-with-attestations.yaml | kubectl apply -f - +yq '. | .spec.authorities[0].key.data |= load_str("cosign.pub") | .spec.authorities[1].key.data |= load_str("cosign.pub")' ./test/testdata/policy-controller/e2e/cip-key-with-attestations.yaml | kubectl apply -f - # allow things to propagate sleep 5 echo '::endgroup::' @@ -206,7 +206,7 @@ echo '::endgroup::' # one custom attestation that's signed by key. # Note we have to bake in the inline data from the keys above echo '::group:: Add cip for two signatures and two attestations' -yq '. | .spec.authorities[1].key.data |= load_str("cosign.pub") | .spec.authorities[3].key.data |= load_str("cosign.pub")' ./test/testdata/cosigned/e2e/cip-requires-two-signatures-and-two-attestations.yaml | kubectl apply -f - +yq '. | .spec.authorities[1].key.data |= load_str("cosign.pub") | .spec.authorities[3].key.data |= load_str("cosign.pub")' ./test/testdata/policy-controller/e2e/cip-requires-two-signatures-and-two-attestations.yaml | kubectl apply -f - # allow things to propagate sleep 5 echo '::endgroup::' diff --git a/test/e2e_test_policy_controller.sh b/test/e2e_test_policy_controller.sh new file mode 100755 index 00000000000..8081a315b38 --- /dev/null +++ b/test/e2e_test_policy_controller.sh @@ -0,0 +1,260 @@ +#!/usr/bin/env bash +# +# Copyright 2021 The Sigstore Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + + +echo '::group:: publish test image' +DIGEST=$(ko publish -B ./cmd/sample) +cat > pod.yaml < distroless-pod.yaml < job.yaml < cronjob.yaml < manykeys.pem <> manykeys.pem + +# Save the old key +kubectl get secret -n cosign-system verification-key -o=json | jq -r '.data["cosign.key"]' | base64 --decode > cosign.key +kubectl delete secret -n cosign-system verification-key +kubectl create secret generic -n cosign-system verification-key --from-file=cosign.pub=manykeys.pem --from-literal=cosign.password=${COSIGN_PASSWORD} --from-file=cosign.key + +echo '::group:: disable verification' +kubectl label namespace default --overwrite policycontroller.sigstore.dev/include=false +echo '::endgroup::' + + +echo '::group:: test pod success (before labeling)' +# This time it should succeed! +if ! kubectl create -f pod.yaml ; then + echo Failed to create Pod in namespace without label! + exit 1 +else + echo Successfully created Pod in namespace without label. +fi +echo '::endgroup::' + + +echo '::group:: test job success' +# This time it should succeed! +if ! kubectl create -f job.yaml ; then + echo Failed to create Job in namespace without label! + exit 1 +else + echo Successfully created Job in namespace without label. +fi +echo '::endgroup::' + +echo '::group:: test cronjob success' +# This time it should succeed! +if ! kubectl create -f cronjob.yaml ; then + echo Failed to create CronJob in namespace without label! + exit 1 +else + echo Successfully created CronJob in namespace without label. +fi +echo '::endgroup::' + +echo '::group:: enable verification' +kubectl label namespace default --overwrite policycontroller.sigstore.dev/include=true +echo '::endgroup::' + + +echo '::group:: test pod rejection' +if kubectl create -f pod.yaml ; then + echo Failed to block Pod creation! + exit 1 +else + echo Successfully blocked Pod creation. +fi +echo '::endgroup::' + + +echo '::group:: test job rejection' +if kubectl create -f job.yaml ; then + echo Failed to block Job creation! + exit 1 +else + echo Successfully blocked Job creation. +fi +echo '::endgroup::' + +echo '::group:: test cronjob rejection' +if kubectl create -f cronjob.yaml ; then + echo Failed to block CronJob creation! + exit 1 +else + echo Successfully blocked CronJob creation. +fi +echo '::endgroup::' + +echo '::group:: sign test image' +cosign sign --key k8s://cosign-system/verification-key $DIGEST +echo '::endgroup::' + + + +echo '::group:: test pod digest resolution' +IMAGE=$(kubectl create --dry-run=server -f pod.yaml -oyaml | yq e '.spec.containers[0].image' -) + +if [ "$IMAGE" != "$DIGEST" ] ; then + echo Failed to resolve tag to digest! + exit 1 +else + echo Successfully resolved tag to digest. +fi +echo '::endgroup::' + +echo '::group:: test job digest resolution' +IMAGE=$(kubectl create --dry-run=server -f job.yaml -oyaml | yq e '.spec.template.spec.containers[0].image' -) + +if [ "$IMAGE" != "$DIGEST" ] ; then + echo Failed to resolve tag to digest! + exit 1 +else + echo Successfully resolved tag to digest. +fi +echo '::endgroup::' + +echo '::group:: test cronjob digest resolution' +IMAGE=$(kubectl create --dry-run=server -f cronjob.yaml -oyaml | yq e '.spec.jobTemplate.spec.template.spec.containers[0].image' -) + +if [ "$IMAGE" != "$DIGEST" ] ; then + echo Failed to resolve tag to digest! + exit 1 +else + echo Successfully resolved tag to digest. +fi +echo '::endgroup::' + +echo '::group:: test pod success' +# This time it should succeed! +if ! kubectl create -f pod.yaml ; then + echo Failed to create Pod with properly signed image! + exit 1 +else + echo Successfully created Pod from signed image. +fi +echo '::endgroup::' + + +echo '::group:: test job success' +# This time it should succeed! +if ! kubectl create -f job.yaml ; then + echo Failed to create Job with properly signed image! + exit 1 +else + echo Successfully created Job from signed image. +fi +echo '::endgroup::' + +echo '::group:: test cronjob success' +# This time it should succeed! +if ! kubectl create -f cronjob.yaml ; then + echo Failed to create CronJob with properly signed image! + exit 1 +else + echo Successfully created CronJob from signed image. +fi +echo '::endgroup::' diff --git a/test/e2e_test_policy_crd.sh b/test/e2e_test_policy_crd.sh index 247b0696561..0125416b38a 100755 --- a/test/e2e_test_policy_crd.sh +++ b/test/e2e_test_policy_crd.sh @@ -17,9 +17,9 @@ set -ex echo '::group:: Invalid policy tests:' -for i in `ls ./test/testdata/cosigned/invalid/` +for i in `ls ./test/testdata/policy-controller/invalid/` do - if kubectl create -f ./test/testdata/cosigned/invalid/$i ; then + if kubectl create -f ./test/testdata/policy-controller/invalid/$i ; then echo "${i} policy created when it should not have" exit 1 else @@ -29,16 +29,16 @@ done echo '::endgroup:: Invalid policy test:' echo '::group:: Valid policy test:' -for i in `ls ./test/testdata/cosigned/valid/` +for i in `ls ./test/testdata/policy-controller/valid/` do - if kubectl create -f ./test/testdata/cosigned/valid/$i ; then + if kubectl create -f ./test/testdata/policy-controller/valid/$i ; then echo "${i} created as expected" else echo "${i} failed when it should not have" exit 1 fi - kubectl delete -f ./test/testdata/cosigned/valid/$i --ignore-not-found=true + kubectl delete -f ./test/testdata/policy-controller/valid/$i --ignore-not-found=true done echo '::endgroup:: Valid policy test:' diff --git a/test/testdata/cosigned/e2e/cip-key-with-attestations.yaml b/test/testdata/policy-controller/e2e/cip-key-with-attestations.yaml similarity index 93% rename from test/testdata/cosigned/e2e/cip-key-with-attestations.yaml rename to test/testdata/policy-controller/e2e/cip-key-with-attestations.yaml index 089dade05ab..df9ebdc60ff 100644 --- a/test/testdata/cosigned/e2e/cip-key-with-attestations.yaml +++ b/test/testdata/policy-controller/e2e/cip-key-with-attestations.yaml @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-key-with-attestations spec: images: - - glob: registry.local:5000/cosigned/demo* + - glob: registry.local:5000/policy-controller/demo* authorities: - name: verify custom attestation key: diff --git a/test/testdata/cosigned/e2e/cip-key.yaml b/test/testdata/policy-controller/e2e/cip-key.yaml similarity index 90% rename from test/testdata/cosigned/e2e/cip-key.yaml rename to test/testdata/policy-controller/e2e/cip-key.yaml index 7b7784bacdf..b18c6a2f9a5 100644 --- a/test/testdata/cosigned/e2e/cip-key.yaml +++ b/test/testdata/policy-controller/e2e/cip-key.yaml @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-key spec: images: - - glob: registry.local:5000/cosigned/demo* + - glob: registry.local:5000/policy-controller/demo* authorities: - key: data: | diff --git a/test/testdata/cosigned/e2e/cip-keyless-with-attestations.yaml b/test/testdata/policy-controller/e2e/cip-keyless-with-attestations.yaml similarity index 92% rename from test/testdata/cosigned/e2e/cip-keyless-with-attestations.yaml rename to test/testdata/policy-controller/e2e/cip-keyless-with-attestations.yaml index 77999559fdd..df0662318ea 100644 --- a/test/testdata/cosigned/e2e/cip-keyless-with-attestations.yaml +++ b/test/testdata/policy-controller/e2e/cip-keyless-with-attestations.yaml @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-keyless-with-attestations spec: images: - - glob: registry.local:5000/cosigned/demo* + - glob: registry.local:5000/policy-controller/demo* authorities: - name: verify custom attestation keyless: diff --git a/test/testdata/cosigned/e2e/cip-keyless-with-identities-mismatch.yaml b/test/testdata/policy-controller/e2e/cip-keyless-with-identities-mismatch.yaml similarity index 90% rename from test/testdata/cosigned/e2e/cip-keyless-with-identities-mismatch.yaml rename to test/testdata/policy-controller/e2e/cip-keyless-with-identities-mismatch.yaml index 15e21dfad22..5b09009a4a9 100644 --- a/test/testdata/cosigned/e2e/cip-keyless-with-identities-mismatch.yaml +++ b/test/testdata/policy-controller/e2e/cip-keyless-with-identities-mismatch.yaml @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-keyless-with-identities-mismatch spec: images: - - glob: registry.local:5000/cosigned/demo* + - glob: registry.local:5000/policy-controller/demo* authorities: - keyless: url: http://fulcio.fulcio-system.svc diff --git a/test/testdata/cosigned/e2e/cip-keyless-with-identities.yaml b/test/testdata/policy-controller/e2e/cip-keyless-with-identities.yaml similarity index 89% rename from test/testdata/cosigned/e2e/cip-keyless-with-identities.yaml rename to test/testdata/policy-controller/e2e/cip-keyless-with-identities.yaml index 5e67eb42b85..9bbf03862d5 100644 --- a/test/testdata/cosigned/e2e/cip-keyless-with-identities.yaml +++ b/test/testdata/policy-controller/e2e/cip-keyless-with-identities.yaml @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-keyless-with-identities spec: images: - - glob: registry.local:5000/cosigned/demo* + - glob: registry.local:5000/policy-controller/demo* authorities: - keyless: url: http://fulcio.fulcio-system.svc diff --git a/test/testdata/cosigned/e2e/cip-keyless.yaml b/test/testdata/policy-controller/e2e/cip-keyless.yaml similarity index 88% rename from test/testdata/cosigned/e2e/cip-keyless.yaml rename to test/testdata/policy-controller/e2e/cip-keyless.yaml index 5408b8aabcb..db4eaaa9636 100644 --- a/test/testdata/cosigned/e2e/cip-keyless.yaml +++ b/test/testdata/policy-controller/e2e/cip-keyless.yaml @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-keyless spec: images: - - glob: registry.local:5000/cosigned/demo* + - glob: registry.local:5000/policy-controller/demo* authorities: - keyless: url: http://fulcio.fulcio-system.svc diff --git a/test/testdata/cosigned/e2e/cip-requires-two-signatures-and-two-attestations.yaml b/test/testdata/policy-controller/e2e/cip-requires-two-signatures-and-two-attestations.yaml similarity index 97% rename from test/testdata/cosigned/e2e/cip-requires-two-signatures-and-two-attestations.yaml rename to test/testdata/policy-controller/e2e/cip-requires-two-signatures-and-two-attestations.yaml index 6e0d32f8866..e6fc6565ad0 100644 --- a/test/testdata/cosigned/e2e/cip-requires-two-signatures-and-two-attestations.yaml +++ b/test/testdata/policy-controller/e2e/cip-requires-two-signatures-and-two-attestations.yaml @@ -12,13 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-requires-two-signatures-two-attestations spec: images: - - glob: registry.local:5000/cosigned/demo* + - glob: registry.local:5000/policy-controller/demo* authorities: - name: keylessatt keyless: diff --git a/test/testdata/cosigned/invalid/empty-keyless-ref.yaml b/test/testdata/policy-controller/invalid/empty-keyless-ref.yaml similarity index 93% rename from test/testdata/cosigned/invalid/empty-keyless-ref.yaml rename to test/testdata/policy-controller/invalid/empty-keyless-ref.yaml index 98d9658a17a..b6ddf6eb166 100644 --- a/test/testdata/cosigned/invalid/empty-keyless-ref.yaml +++ b/test/testdata/policy-controller/invalid/empty-keyless-ref.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/empty-keyref-and-keylessref.yaml b/test/testdata/policy-controller/invalid/empty-keyref-and-keylessref.yaml similarity index 93% rename from test/testdata/cosigned/invalid/empty-keyref-and-keylessref.yaml rename to test/testdata/policy-controller/invalid/empty-keyref-and-keylessref.yaml index 125f055bf6c..4811f480deb 100644 --- a/test/testdata/cosigned/invalid/empty-keyref-and-keylessref.yaml +++ b/test/testdata/policy-controller/invalid/empty-keyref-and-keylessref.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/empty-keyref.yaml b/test/testdata/policy-controller/invalid/empty-keyref.yaml similarity index 93% rename from test/testdata/cosigned/invalid/empty-keyref.yaml rename to test/testdata/policy-controller/invalid/empty-keyref.yaml index db7d7d75eac..1dc58187427 100644 --- a/test/testdata/cosigned/invalid/empty-keyref.yaml +++ b/test/testdata/policy-controller/invalid/empty-keyref.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/invalid-glob.yaml b/test/testdata/policy-controller/invalid/invalid-glob.yaml similarity index 94% rename from test/testdata/cosigned/invalid/invalid-glob.yaml rename to test/testdata/policy-controller/invalid/invalid-glob.yaml index 1e81ffac4f4..828860e7b75 100644 --- a/test/testdata/cosigned/invalid/invalid-glob.yaml +++ b/test/testdata/policy-controller/invalid/invalid-glob.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/invalid-pubkey.yaml b/test/testdata/policy-controller/invalid/invalid-pubkey.yaml similarity index 93% rename from test/testdata/cosigned/invalid/invalid-pubkey.yaml rename to test/testdata/policy-controller/invalid/invalid-pubkey.yaml index 66128082db0..2f0e1ef042f 100644 --- a/test/testdata/cosigned/invalid/invalid-pubkey.yaml +++ b/test/testdata/policy-controller/invalid/invalid-pubkey.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/keylessref-with-empty-authorities.yaml b/test/testdata/policy-controller/invalid/keylessref-with-empty-authorities.yaml similarity index 93% rename from test/testdata/cosigned/invalid/keylessref-with-empty-authorities.yaml rename to test/testdata/policy-controller/invalid/keylessref-with-empty-authorities.yaml index 07b82a543dc..0eeb04689ce 100644 --- a/test/testdata/cosigned/invalid/keylessref-with-empty-authorities.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-empty-authorities.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/keylessref-with-empty-identities.yaml b/test/testdata/policy-controller/invalid/keylessref-with-empty-identities.yaml similarity index 93% rename from test/testdata/cosigned/invalid/keylessref-with-empty-identities.yaml rename to test/testdata/policy-controller/invalid/keylessref-with-empty-identities.yaml index 02d3f613856..c7ea53edec5 100644 --- a/test/testdata/cosigned/invalid/keylessref-with-empty-identities.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-empty-identities.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/keylessref-with-malformed-issuer.yaml b/test/testdata/policy-controller/invalid/keylessref-with-malformed-issuer.yaml similarity index 93% rename from test/testdata/cosigned/invalid/keylessref-with-malformed-issuer.yaml rename to test/testdata/policy-controller/invalid/keylessref-with-malformed-issuer.yaml index 7b04359ee99..272e93a67be 100644 --- a/test/testdata/cosigned/invalid/keylessref-with-malformed-issuer.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-malformed-issuer.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/keylessref-with-malformed-subject.yaml b/test/testdata/policy-controller/invalid/keylessref-with-malformed-subject.yaml similarity index 93% rename from test/testdata/cosigned/invalid/keylessref-with-malformed-subject.yaml rename to test/testdata/policy-controller/invalid/keylessref-with-malformed-subject.yaml index fbfd5f57288..8c16f48e2f8 100644 --- a/test/testdata/cosigned/invalid/keylessref-with-malformed-subject.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-malformed-subject.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/keylessref-with-multiple-properties.yaml b/test/testdata/policy-controller/invalid/keylessref-with-multiple-properties.yaml similarity index 94% rename from test/testdata/cosigned/invalid/keylessref-with-multiple-properties.yaml rename to test/testdata/policy-controller/invalid/keylessref-with-multiple-properties.yaml index eff58f34b06..63f024d1214 100644 --- a/test/testdata/cosigned/invalid/keylessref-with-multiple-properties.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-multiple-properties.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/keyref-with-multiple-properties.yaml b/test/testdata/policy-controller/invalid/keyref-with-multiple-properties.yaml similarity index 94% rename from test/testdata/cosigned/invalid/keyref-with-multiple-properties.yaml rename to test/testdata/policy-controller/invalid/keyref-with-multiple-properties.yaml index 5fc31bc28ff..89032ab4a09 100644 --- a/test/testdata/cosigned/invalid/keyref-with-multiple-properties.yaml +++ b/test/testdata/policy-controller/invalid/keyref-with-multiple-properties.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/invalid/valid-keyref-and-keylessref.yaml b/test/testdata/policy-controller/invalid/valid-keyref-and-keylessref.yaml similarity index 93% rename from test/testdata/cosigned/invalid/valid-keyref-and-keylessref.yaml rename to test/testdata/policy-controller/invalid/valid-keyref-and-keylessref.yaml index b543ba7613c..e0dd35da9e8 100644 --- a/test/testdata/cosigned/invalid/valid-keyref-and-keylessref.yaml +++ b/test/testdata/policy-controller/invalid/valid-keyref-and-keylessref.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/valid/valid-policy-glob.yaml b/test/testdata/policy-controller/valid/valid-policy-glob.yaml similarity index 96% rename from test/testdata/cosigned/valid/valid-policy-glob.yaml rename to test/testdata/policy-controller/valid/valid-policy-glob.yaml index fe9038ebf49..26d01bbe25a 100644 --- a/test/testdata/cosigned/valid/valid-policy-glob.yaml +++ b/test/testdata/policy-controller/valid/valid-policy-glob.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/cosigned/valid/valid-policy.yaml b/test/testdata/policy-controller/valid/valid-policy.yaml similarity index 98% rename from test/testdata/cosigned/valid/valid-policy.yaml rename to test/testdata/policy-controller/valid/valid-policy.yaml index 124e1ad460f..5cb46ea3d56 100644 --- a/test/testdata/cosigned/valid/valid-policy.yaml +++ b/test/testdata/policy-controller/valid/valid-policy.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: cosigned.sigstore.dev/v1alpha1 +apiVersion: policycontroller.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy From c3e825179c733586fd17a2eede5d52bab1041169 Mon Sep 17 00:00:00 2001 From: hectorj2f Date: Wed, 18 May 2022 14:51:25 +0200 Subject: [PATCH 2/5] chore: rename api groups from cosigned to policy-controller Signed-off-by: hectorj2f --- config/100-namespace.yaml | 2 +- config/200-clusterrole.yaml | 8 ++++---- config/200-role.yaml | 2 +- config/201-clusterrolebinding.yaml | 4 ++-- config/201-rolebinding.yaml | 4 ++-- config/300-clusterimagepolicy.yaml | 4 ++-- config/500-webhook-configuration.yaml | 12 ++++++------ config/policy-webhook.yaml | 2 +- config/webhook.yaml | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/config/100-namespace.yaml b/config/100-namespace.yaml index 96366cdd611..5fc7b3956d7 100644 --- a/config/100-namespace.yaml +++ b/config/100-namespace.yaml @@ -17,4 +17,4 @@ kind: Namespace metadata: name: cosign-system labels: - cosigned.sigstore.dev/include: "false" + policycontroller.sigstore.dev/include: "false" diff --git a/config/200-clusterrole.yaml b/config/200-clusterrole.yaml index 536a8f25a15..7575cfbd5d9 100644 --- a/config/200-clusterrole.yaml +++ b/config/200-clusterrole.yaml @@ -15,7 +15,7 @@ kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: cosigned-rbac + name: policy-controller-rbac rules: - apiGroups: [""] resources: ["events"] @@ -28,7 +28,7 @@ rules: - apiGroups: ["admissionregistration.k8s.io"] resources: ["validatingwebhookconfigurations", "mutatingwebhookconfigurations"] verbs: ["get", "update"] - resourceNames: ["cosigned.sigstore.dev", "validating.clusterimagepolicy.sigstore.dev", "defaulting.clusterimagepolicy.sigstore.dev"] + resourceNames: ["policycontroller.sigstore.dev", "validating.clusterimagepolicy.sigstore.dev", "defaulting.clusterimagepolicy.sigstore.dev"] - apiGroups: [""] resources: ["namespaces"] @@ -45,10 +45,10 @@ rules: - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "update"] - resourceNames: ["clusterimagepolicies.cosigned.sigstore.dev"] + resourceNames: ["clusterimagepolicies.policycontroller.sigstore.dev"] # Allow reconciliation of the ClusterImagePolic CRDs. - - apiGroups: ["cosigned.sigstore.dev"] + - apiGroups: ["policycontroller.sigstore.dev"] resources: ["clusterimagepolicies"] verbs: ["get", "list", "update", "watch", "patch"] diff --git a/config/200-role.yaml b/config/200-role.yaml index 1851ccb444e..20827761278 100644 --- a/config/200-role.yaml +++ b/config/200-role.yaml @@ -15,7 +15,7 @@ kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: cosigned-namespace-rbac + name: policy-controller-namespace-rbac namespace: cosign-system rules: # Needed to watch and load configuration and secret data. diff --git a/config/201-clusterrolebinding.yaml b/config/201-clusterrolebinding.yaml index 073b7d4515c..5059d68d5c4 100644 --- a/config/201-clusterrolebinding.yaml +++ b/config/201-clusterrolebinding.yaml @@ -15,12 +15,12 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: cosigned-webhook + name: policy-controller-webhook subjects: - kind: ServiceAccount name: webhook namespace: cosign-system roleRef: kind: ClusterRole - name: cosigned-rbac + name: policy-controller-rbac apiGroup: rbac.authorization.k8s.io diff --git a/config/201-rolebinding.yaml b/config/201-rolebinding.yaml index 6cd2f8ebc72..0c3a9877180 100644 --- a/config/201-rolebinding.yaml +++ b/config/201-rolebinding.yaml @@ -15,7 +15,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: cosigned-webhook + name: policy-controller-webhook namespace: cosign-system subjects: - kind: ServiceAccount @@ -23,5 +23,5 @@ subjects: namespace: cosign-system roleRef: kind: Role - name: cosigned-namespace-rbac + name: policy-controller-namespace-rbac apiGroup: rbac.authorization.k8s.io diff --git a/config/300-clusterimagepolicy.yaml b/config/300-clusterimagepolicy.yaml index a8bbb17adc1..0a69a147b4d 100644 --- a/config/300-clusterimagepolicy.yaml +++ b/config/300-clusterimagepolicy.yaml @@ -14,9 +14,9 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: clusterimagepolicies.cosigned.sigstore.dev + name: clusterimagepolicies.policycontroller.sigstore.dev spec: - group: cosigned.sigstore.dev + group: policycontroller.sigstore.dev names: kind: ClusterImagePolicy plural: clusterimagepolicies diff --git a/config/500-webhook-configuration.yaml b/config/500-webhook-configuration.yaml index ba067a61e15..34dc2eeb8ca 100644 --- a/config/500-webhook-configuration.yaml +++ b/config/500-webhook-configuration.yaml @@ -15,13 +15,13 @@ apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: - name: cosigned.sigstore.dev + name: policycontroller.sigstore.dev webhooks: -- name: cosigned.sigstore.dev +- name: policycontroller.sigstore.dev namespaceSelector: # The webhook should only apply to things that opt-in matchExpressions: - - key: cosigned.sigstore.dev/include + - key: policycontroller.sigstore.dev/include operator: In values: ["true"] admissionReviewVersions: [v1] @@ -37,13 +37,13 @@ webhooks: apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: - name: cosigned.sigstore.dev + name: policycontroller.sigstore.dev webhooks: -- name: cosigned.sigstore.dev +- name: policycontroller.sigstore.dev namespaceSelector: # The webhook should only apply to things that opt-in matchExpressions: - - key: cosigned.sigstore.dev/include + - key: policycontroller.sigstore.dev/include operator: In values: ["true"] admissionReviewVersions: [v1] diff --git a/config/policy-webhook.yaml b/config/policy-webhook.yaml index 1aa59ca9e9a..063c77a8daf 100644 --- a/config/policy-webhook.yaml +++ b/config/policy-webhook.yaml @@ -60,7 +60,7 @@ spec: - name: CONFIG_LOGGING_NAME value: config-logging - name: METRICS_DOMAIN - value: sigstore.dev/cosigned + value: sigstore.dev/policycontroller - name: WEBHOOK_NAME value: policy-webhook diff --git a/config/webhook.yaml b/config/webhook.yaml index f15504b2de2..a64e53977e6 100644 --- a/config/webhook.yaml +++ b/config/webhook.yaml @@ -60,7 +60,7 @@ spec: - name: CONFIG_LOGGING_NAME value: config-logging - name: METRICS_DOMAIN - value: sigstore.dev/cosigned + value: sigstore.dev/policycontroller - name: WEBHOOK_NAME value: webhook # Since we need to validate against different Rekor clients based on From e44e76cb11aed2ca15a108f75a1a3b5cd97bfdee Mon Sep 17 00:00:00 2001 From: hectorj2f Date: Wed, 18 May 2022 14:52:09 +0200 Subject: [PATCH 3/5] chore: rename webhook name Signed-off-by: hectorj2f --- cmd/cosign/policy_webhook/main.go | 12 ++++++------ cmd/cosign/webhook/main.go | 10 +++++----- cmd/schema/main.go | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmd/cosign/policy_webhook/main.go b/cmd/cosign/policy_webhook/main.go index 72fbbd7924a..a7e088dc6fc 100644 --- a/cmd/cosign/policy_webhook/main.go +++ b/cmd/cosign/policy_webhook/main.go @@ -33,9 +33,9 @@ import ( "knative.dev/pkg/webhook/resourcesemantics/validation" "sigs.k8s.io/release-utils/version" - "github.com/sigstore/cosign/pkg/apis/cosigned" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1" + "github.com/sigstore/cosign/pkg/apis/policycontroller" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" "github.com/sigstore/cosign/pkg/reconciler/clusterimagepolicy" // Register the provider-specific plugins @@ -52,7 +52,7 @@ var ( // with the resource types, namespace selectors, CABindle and service path. // If this changes, you must also change: // ./config/501-policy-webhook-configurations.yaml - // https://github.com/sigstore/helm-charts/blob/main/charts/cosigned/templates/policy-webhook/policy_webhook_configurations.yaml + // https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/policy-webhook/policy_webhook_configurations.yaml mutatingWebhookName = flag.String("mutating-webhook-name", "defaulting.clusterimagepolicy.sigstore.dev", "The name of the mutating webhook configuration as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to policy-webhook.") // validatingWebhookName holds the name of the validating webhook configuration // resource dispatching admission requests to policy-webhook. @@ -60,7 +60,7 @@ var ( // with the resource types, namespace selectors, CABindle and service path. // If this changes, you must also change: // ./config/501-policy-webhook-configurations.yaml - // https://github.com/sigstore/helm-charts/blob/main/charts/cosigned/templates/policy-webhook/policy_webhook_configurations.yaml + // https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/policy-webhook/policy_webhook_configurations.yaml validatingWebhookName = flag.String("validating-webhook-name", "validating.clusterimagepolicy.sigstore.dev", "The name of the validating webhook configuration as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to policy-webhook.") ) @@ -135,7 +135,7 @@ func newConversionController(ctx context.Context, cmw configmap.Watcher) *contro // Specify the types of custom resource definitions that should be converted map[schema.GroupKind]conversion.GroupKindConversion{ v1beta1.Kind("ClusterImagePolicy"): { - DefinitionName: cosigned.ClusterImagePolicyResource.String(), + DefinitionName: policycontroller.ClusterImagePolicyResource.String(), HubVersion: v1alpha1GroupVersion, Zygotes: map[string]conversion.ConvertibleObject{ v1alpha1GroupVersion: &v1alpha1.ClusterImagePolicy{}, diff --git a/cmd/cosign/webhook/main.go b/cmd/cosign/webhook/main.go index e75f8d75de0..a4d43dbefba 100644 --- a/cmd/cosign/webhook/main.go +++ b/cmd/cosign/webhook/main.go @@ -45,14 +45,14 @@ import ( var secretName = flag.String("secret-name", "", "The name of the secret in the webhook's namespace that holds the public key for verification.") // webhookName holds the name of the validating and mutating webhook -// configuration resources dispatching admission requests to cosigned. +// configuration resources dispatching admission requests to policy-controller. // It is also the name of the webhook which is injected by the controller // with the resource types, namespace selectors, CABindle and service path. // If this changes, you must also change: // ./config/500-webhook-configuration.yaml -// https://github.com/sigstore/helm-charts/blob/main/charts/cosigned/templates/webhook/webhook_mutating.yaml -// https://github.com/sigstore/helm-charts/blob/main/charts/cosigned/templates/webhook/webhook_validating.yaml -var webhookName = flag.String("webhook-name", "cosigned.sigstore.dev", "The name of the validating and mutating webhook configurations as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to cosigned.") +// https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/webhook/webhook_mutating.yaml +// https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/webhook/webhook_validating.yaml +var webhookName = flag.String("webhook-name", "policycontroller.sigstore.dev", "The name of the validating and mutating webhook configurations as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to policy-controller.") func main() { opts := webhook.Options{ @@ -69,7 +69,7 @@ func main() { vJSON, _ := v.JSONString() log.Printf("%v", vJSON) // This calls flag.Parse() - sharedmain.MainWithContext(ctx, "cosigned", + sharedmain.MainWithContext(ctx, "policy-controller", certificates.NewController, NewValidatingAdmissionController, NewMutatingAdmissionController, diff --git a/cmd/schema/main.go b/cmd/schema/main.go index 502bac9e9fe..83badbb8f67 100644 --- a/cmd/schema/main.go +++ b/cmd/schema/main.go @@ -20,7 +20,7 @@ import ( "knative.dev/hack/schema/commands" "knative.dev/hack/schema/registry" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" ) // schema is a tool to dump the schema for Eventing resources. From a2edbe33a658628971e91ff64b4294662e74a273 Mon Sep 17 00:00:00 2001 From: hectorj2f Date: Wed, 18 May 2022 14:53:13 +0200 Subject: [PATCH 4/5] chore: rename script references to cosigned Signed-off-by: hectorj2f --- .github/workflows/build.yaml | 4 +- ...luster-image-policy-with-attestations.yaml | 14 +- .../workflows/kind-cluster-image-policy.yaml | 14 +- .github/workflows/kind-e2e-cosigned.yaml | 14 +- .../workflows/kind-verify-attestation.yaml | 2 +- .gitignore | 2 +- .ko.yaml | 2 +- Makefile | 24 +- hack/update-codegen.sh | 4 +- release/ko-sign-release-images.sh | 8 +- release/release.mk | 8 +- test/e2e_test_cosigned.sh | 260 ------------------ 12 files changed, 48 insertions(+), 308 deletions(-) delete mode 100755 test/e2e_test_cosigned.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1441d2d4cee..3985d756d36 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -58,7 +58,7 @@ jobs: run: gcloud auth configure-docker --quiet - name: container run: echo -n "${{secrets.COSIGN_PASSWORD}}" | KO_PREFIX=gcr.io/projectsigstore/cosign/ci make sign-container - - name: cosigned - run: echo -n "${{secrets.COSIGN_PASSWORD}}" | KO_PREFIX=gcr.io/projectsigstore/cosign/ci make sign-cosigned + - name: policy-controller + run: echo -n "${{secrets.COSIGN_PASSWORD}}" | KO_PREFIX=gcr.io/projectsigstore/cosign/ci make sign-policy-controller - name: sget run: echo -n "${{secrets.COSIGN_PASSWORD}}" | KO_PREFIX=gcr.io/projectsigstore/cosign/ci make sign-sget diff --git a/.github/workflows/kind-cluster-image-policy-with-attestations.yaml b/.github/workflows/kind-cluster-image-policy-with-attestations.yaml index 33500bbc17f..4f29a2e3931 100644 --- a/.github/workflows/kind-cluster-image-policy-with-attestations.yaml +++ b/.github/workflows/kind-cluster-image-policy-with-attestations.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Test cosigned with ClusterImagePolicy with attestations +name: Test policy-controller with ClusterImagePolicy with attestations on: pull_request: @@ -40,7 +40,7 @@ jobs: env: KNATIVE_VERSION: "1.1.0" - KO_DOCKER_REPO: "registry.local:5000/cosigned" + KO_DOCKER_REPO: "registry.local:5000/policy-controller" SCAFFOLDING_RELEASE_VERSION: "v0.2.8" GO111MODULE: on GOFLAGS: -ldflags=-s -ldflags=-w @@ -74,17 +74,17 @@ jobs: - name: Install cluster + cosign uses: sigstore/scaffolding/actions/setup@main - - name: Install cosigned + - name: Install policy-controller env: GIT_HASH: ${{ github.sha }} GIT_VERSION: ci LDFLAGS: "" - COSIGNED_YAML: cosigned-e2e.yaml - KO_PREFIX: registry.local:5000/cosigned + COSIGNED_YAML: policy-controller-e2e.yaml + KO_PREFIX: registry.local:5000/cospolicy-controllerigned COSIGNED_ARCHS: linux/amd64 run: | - make ko-cosigned - kubectl apply -f cosigned-e2e.yaml + make ko-policy-controller + kubectl apply -f policy-controller-e2e.yaml # Wait for the webhook to come up and become Ready kubectl rollout status --timeout 5m --namespace cosign-system deployments/webhook diff --git a/.github/workflows/kind-cluster-image-policy.yaml b/.github/workflows/kind-cluster-image-policy.yaml index 497a45dd8e2..5722c114f92 100644 --- a/.github/workflows/kind-cluster-image-policy.yaml +++ b/.github/workflows/kind-cluster-image-policy.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Test cosigned with ClusterImagePolicy +name: Test policy-controller with ClusterImagePolicy on: pull_request: @@ -40,7 +40,7 @@ jobs: env: KNATIVE_VERSION: "1.1.0" - KO_DOCKER_REPO: "registry.local:5000/cosigned" + KO_DOCKER_REPO: "registry.local:5000/policy-controller" SCAFFOLDING_RELEASE_VERSION: "v0.2.2" GO111MODULE: on GOFLAGS: -ldflags=-s -ldflags=-w @@ -74,17 +74,17 @@ jobs: - name: Install cluster + cosign uses: sigstore/scaffolding/actions/setup@main - - name: Install cosigned + - name: Install policy-controller env: GIT_HASH: ${{ github.sha }} GIT_VERSION: ci LDFLAGS: "" - COSIGNED_YAML: cosigned-e2e.yaml - KO_PREFIX: registry.local:5000/cosigned + COSIGNED_YAML: policy-controller-e2e.yaml + KO_PREFIX: registry.local:5000/policy-controller COSIGNED_ARCHS: linux/amd64 run: | - make ko-cosigned - kubectl apply -f cosigned-e2e.yaml + make ko-policy-controller + kubectl apply -f policy-controller-e2e.yaml # Wait for the webhook to come up and become Ready kubectl rollout status --timeout 5m --namespace cosign-system deployments/webhook diff --git a/.github/workflows/kind-e2e-cosigned.yaml b/.github/workflows/kind-e2e-cosigned.yaml index 8ad355056b2..110946c50ad 100644 --- a/.github/workflows/kind-e2e-cosigned.yaml +++ b/.github/workflows/kind-e2e-cosigned.yaml @@ -40,7 +40,7 @@ jobs: REGISTRY_PORT: 5000 INSECURE_REGISTRY_NAME: insecure-registry.notlocal INSECURE_REGISTRY_PORT: 5001 - KO_DOCKER_REPO: registry.local:5000/cosigned + KO_DOCKER_REPO: registry.local:5000/policy-controller steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v2.4.0 @@ -97,17 +97,17 @@ jobs: # local registry, even when pushing $INSECURE_REGISTRY_NAME:$INSECURE_REGISTRY_NAME/some/image sudo echo "127.0.0.1 $INSECURE_REGISTRY_NAME" | sudo tee -a /etc/hosts - - name: Install cosigned + - name: Install policy-controller env: GIT_HASH: ${{ github.sha }} GIT_VERSION: ci LDFLAGS: "" - COSIGNED_YAML: cosigned-e2e.yaml - KO_PREFIX: registry.local:5000/cosigned + COSIGNED_YAML: policy-controller-e2e.yaml + KO_PREFIX: registry.local:5000/policy-controller COSIGNED_ARCHS: linux/amd64 run: | - make ko-cosigned - kubectl apply -f cosigned-e2e.yaml + make ko-policy-controller + kubectl apply -f policy-controller-e2e.yaml # Wait for the webhook to come up and become Ready kubectl rollout status --timeout 5m --namespace cosign-system deployments/webhook @@ -123,7 +123,7 @@ jobs: - name: Run Cosigned Tests run: | - ./test/e2e_test_cosigned.sh + ./test/e2e_test_policy_controller.sh - name: Collect diagnostics if: ${{ failure() }} diff --git a/.github/workflows/kind-verify-attestation.yaml b/.github/workflows/kind-verify-attestation.yaml index d291c1b5763..cf0727bb656 100644 --- a/.github/workflows/kind-verify-attestation.yaml +++ b/.github/workflows/kind-verify-attestation.yaml @@ -40,7 +40,7 @@ jobs: env: KNATIVE_VERSION: "1.1.0" - KO_DOCKER_REPO: "registry.local:5000/cosigned" + KO_DOCKER_REPO: "registry.local:5000/policy-controller" SCAFFOLDING_RELEASE_VERSION: "v0.2.2" GO111MODULE: on GOFLAGS: -ldflags=-s -ldflags=-w diff --git a/.gitignore b/.gitignore index 2c833c92ae7..5ef31f9f5d5 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ bin* dist/ cosignImagerefs -cosignedImagerefs +policyControllerImagerefs sgetImagerefs policyImagerefs diff --git a/.ko.yaml b/.ko.yaml index 6fe5f6c178d..7834fb846d6 100644 --- a/.ko.yaml +++ b/.ko.yaml @@ -32,7 +32,7 @@ builds: - -extldflags "-static" - "{{ .Env.LDFLAGS }}" -- id: cosigned +- id: policy-controller dir: . main: ./cmd/cosign/webhook env: diff --git a/Makefile b/Makefile index 4844bc3e9cd..e7e4fc91e74 100644 --- a/Makefile +++ b/Makefile @@ -91,9 +91,9 @@ cosign: $(SRCS) cosign-pivkey-pkcs11key: $(SRCS) CGO_ENABLED=1 go build -trimpath -tags=pivkey,pkcs11key -ldflags "$(LDFLAGS)" -o cosign ./cmd/cosign -## Build cosigned binary -.PHONY: cosigned -cosigned: policy-webhook +## Build policy-controller binary +.PHONY: policy-controller +policy-controller: policy-webhook CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $@ ./cmd/cosign/webhook .PHONY: policy-webhook @@ -128,7 +128,7 @@ test: clean: rm -rf cosign - rm -rf cosigned + rm -rf policy-controller rm -rf sget rm -rf dist/ @@ -151,7 +151,7 @@ endef # ko build ########## .PHONY: ko -ko: ko-cosign ko-sget ko-cosigned +ko: ko-cosign ko-sget ko-policy-controller .PHONY: ko-cosign ko-cosign: @@ -171,13 +171,13 @@ ko-sget: --image-refs sgetImagerefs \ github.com/sigstore/cosign/cmd/sget -.PHONY: ko-cosigned -ko-cosigned: kustomize-cosigned ko-policy-webhook - # cosigned +.PHONY: ko-policy-controller +ko-policy-controller: kustomize-policy-controller ko-policy-webhook + # policy-controller LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \ - KOCACHE=$(KOCACHE_PATH) KO_DOCKER_REPO=$(KO_PREFIX)/cosigned ko resolve --bare \ + KOCACHE=$(KOCACHE_PATH) KO_DOCKER_REPO=$(KO_PREFIX)/policy-controller ko resolve --bare \ --platform=$(COSIGNED_ARCHS) --tags $(GIT_VERSION) --tags $(GIT_HASH)$(LATEST_TAG) \ - --image-refs cosignedImagerefs --filename config/webhook.yaml >> $(COSIGNED_YAML) + --image-refs policyControllerImagerefs --filename config/webhook.yaml >> $(COSIGNED_YAML) ko-policy-webhook: # policy_webhook @@ -212,8 +212,8 @@ ko-apply: LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) ko apply -Bf config/ -.PHONY: kustomize-cosigned -kustomize-cosigned: +.PHONY: kustomize-policy-controller +kustomize-policy-controller: kustomize build config/ > $(COSIGNED_YAML) ################## diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 323c687c204..c1f7018bfd3 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -45,7 +45,7 @@ group "Kubernetes Codegen" # instead of the $GOPATH directly. For normal projects this can be dropped. ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ github.com/sigstore/cosign/pkg/client github.com/sigstore/cosign/pkg/apis \ - "cosigned:v1alpha1 cosigned:v1beta1" \ + "policycontroller:v1alpha1 policycontroller:v1beta1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt group "Knative Codegen" @@ -53,7 +53,7 @@ group "Knative Codegen" # Knative Injection ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \ github.com/sigstore/cosign/pkg/client github.com/sigstore/cosign/pkg/apis \ - "cosigned:v1alpha1 cosigned:v1beta1" \ + "policycontroller:v1alpha1 policycontroller:v1beta1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt group "Update CRD Schema" diff --git a/release/ko-sign-release-images.sh b/release/ko-sign-release-images.sh index 47a1cea973c..a0fbc0d6b3d 100755 --- a/release/ko-sign-release-images.sh +++ b/release/ko-sign-release-images.sh @@ -37,8 +37,8 @@ if [[ ! -f sgetImagerefs ]]; then exit 1 fi -if [[ ! -f cosignedImagerefs ]]; then - echo "cosignedImagerefs not found" +if [[ ! -f policyControllerImagerefs ]]; then + echo "policyControllerImagerefs not found" exit 1 fi @@ -51,11 +51,11 @@ echo "Signing cosign images with GCP KMS Key..." cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat cosignImagerefs)" cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat sgetImagerefs)" -cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat cosignedImagerefs)" +cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat policyControllerImagerefs)" cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat policyImagerefs)" echo "Signing images with Keyless..." cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat cosignImagerefs)" cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat sgetImagerefs)" -cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat cosignedImagerefs)" +cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat policyControllerImagerefs)" cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat policyImagerefs)" diff --git a/release/release.mk b/release/release.mk index 05f69a043d5..427447c0712 100644 --- a/release/release.mk +++ b/release/release.mk @@ -28,9 +28,9 @@ snapshot: copy-cosign-signed-release-to-ghcr: cosign copy $(KO_PREFIX)/cosign:$(GIT_VERSION) $(GHCR_PREFIX)/cosign:$(GIT_VERSION) -.PHONY: copy-cosigned-signed-release-to-ghcr -copy-cosigned-signed-release-to-ghcr: - cosign copy $(KO_PREFIX)/cosigned:$(GIT_VERSION) $(GHCR_PREFIX)/cosigned:$(GIT_VERSION) +.PHONY: copy-policy-controller-signed-release-to-ghcr +copy-policy-controller-signed-release-to-ghcr: + cosign copy $(KO_PREFIX)/policy-controller:$(GIT_VERSION) $(GHCR_PREFIX)/policy-controller:$(GIT_VERSION) .PHONY: copy-policy-webhook-signed-release-to-ghcr copy-policy-webhook-signed-release-to-ghcr: @@ -41,4 +41,4 @@ copy-sget-signed-release-to-ghcr: cosign copy $(KO_PREFIX)/sget:$(GIT_VERSION) $(GHCR_PREFIX)/sget:$(GIT_VERSION) .PHONY: copy-signed-release-to-ghcr -copy-signed-release-to-ghcr: copy-cosign-signed-release-to-ghcr copy-cosigned-signed-release-to-ghcr copy-sget-signed-release-to-ghcr copy-policy-webhook-signed-release-to-ghcr +copy-signed-release-to-ghcr: copy-cosign-signed-release-to-ghcr copy-policy-controller-signed-release-to-ghcr copy-sget-signed-release-to-ghcr copy-policy-webhook-signed-release-to-ghcr diff --git a/test/e2e_test_cosigned.sh b/test/e2e_test_cosigned.sh deleted file mode 100755 index 7a0b5b5799f..00000000000 --- a/test/e2e_test_cosigned.sh +++ /dev/null @@ -1,260 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2021 The Sigstore Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - - -echo '::group:: publish test image' -DIGEST=$(ko publish -B ./cmd/sample) -cat > pod.yaml < distroless-pod.yaml < job.yaml < cronjob.yaml < manykeys.pem <> manykeys.pem - -# Save the old key -kubectl get secret -n cosign-system verification-key -o=json | jq -r '.data["cosign.key"]' | base64 --decode > cosign.key -kubectl delete secret -n cosign-system verification-key -kubectl create secret generic -n cosign-system verification-key --from-file=cosign.pub=manykeys.pem --from-literal=cosign.password=${COSIGN_PASSWORD} --from-file=cosign.key - -echo '::group:: disable verification' -kubectl label namespace default --overwrite cosigned.sigstore.dev/include=false -echo '::endgroup::' - - -echo '::group:: test pod success (before labeling)' -# This time it should succeed! -if ! kubectl create -f pod.yaml ; then - echo Failed to create Pod in namespace without label! - exit 1 -else - echo Successfully created Pod in namespace without label. -fi -echo '::endgroup::' - - -echo '::group:: test job success' -# This time it should succeed! -if ! kubectl create -f job.yaml ; then - echo Failed to create Job in namespace without label! - exit 1 -else - echo Successfully created Job in namespace without label. -fi -echo '::endgroup::' - -echo '::group:: test cronjob success' -# This time it should succeed! -if ! kubectl create -f cronjob.yaml ; then - echo Failed to create CronJob in namespace without label! - exit 1 -else - echo Successfully created CronJob in namespace without label. -fi -echo '::endgroup::' - -echo '::group:: enable verification' -kubectl label namespace default --overwrite cosigned.sigstore.dev/include=true -echo '::endgroup::' - - -echo '::group:: test pod rejection' -if kubectl create -f pod.yaml ; then - echo Failed to block Pod creation! - exit 1 -else - echo Successfully blocked Pod creation. -fi -echo '::endgroup::' - - -echo '::group:: test job rejection' -if kubectl create -f job.yaml ; then - echo Failed to block Job creation! - exit 1 -else - echo Successfully blocked Job creation. -fi -echo '::endgroup::' - -echo '::group:: test cronjob rejection' -if kubectl create -f cronjob.yaml ; then - echo Failed to block CronJob creation! - exit 1 -else - echo Successfully blocked CronJob creation. -fi -echo '::endgroup::' - -echo '::group:: sign test image' -cosign sign --key k8s://cosign-system/verification-key $DIGEST -echo '::endgroup::' - - - -echo '::group:: test pod digest resolution' -IMAGE=$(kubectl create --dry-run=server -f pod.yaml -oyaml | yq e '.spec.containers[0].image' -) - -if [ "$IMAGE" != "$DIGEST" ] ; then - echo Failed to resolve tag to digest! - exit 1 -else - echo Successfully resolved tag to digest. -fi -echo '::endgroup::' - -echo '::group:: test job digest resolution' -IMAGE=$(kubectl create --dry-run=server -f job.yaml -oyaml | yq e '.spec.template.spec.containers[0].image' -) - -if [ "$IMAGE" != "$DIGEST" ] ; then - echo Failed to resolve tag to digest! - exit 1 -else - echo Successfully resolved tag to digest. -fi -echo '::endgroup::' - -echo '::group:: test cronjob digest resolution' -IMAGE=$(kubectl create --dry-run=server -f cronjob.yaml -oyaml | yq e '.spec.jobTemplate.spec.template.spec.containers[0].image' -) - -if [ "$IMAGE" != "$DIGEST" ] ; then - echo Failed to resolve tag to digest! - exit 1 -else - echo Successfully resolved tag to digest. -fi -echo '::endgroup::' - -echo '::group:: test pod success' -# This time it should succeed! -if ! kubectl create -f pod.yaml ; then - echo Failed to create Pod with properly signed image! - exit 1 -else - echo Successfully created Pod from signed image. -fi -echo '::endgroup::' - - -echo '::group:: test job success' -# This time it should succeed! -if ! kubectl create -f job.yaml ; then - echo Failed to create Job with properly signed image! - exit 1 -else - echo Successfully created Job from signed image. -fi -echo '::endgroup::' - -echo '::group:: test cronjob success' -# This time it should succeed! -if ! kubectl create -f cronjob.yaml ; then - echo Failed to create CronJob with properly signed image! - exit 1 -else - echo Successfully created CronJob from signed image. -fi -echo '::endgroup::' From a98b0b279d819e341c1b1619c36ff9ea0b7ab0e0 Mon Sep 17 00:00:00 2001 From: hectorj2f Date: Wed, 18 May 2022 16:30:17 +0200 Subject: [PATCH 5/5] chore: use policy instead of policycontroller Signed-off-by: hectorj2f --- ...luster-image-policy-with-attestations.yaml | 2 +- .github/workflows/kind-e2e-cosigned.yaml | 4 +- cmd/cosign/policy_webhook/main.go | 8 +- cmd/cosign/webhook/main.go | 2 +- cmd/schema/main.go | 2 +- config/100-namespace.yaml | 2 +- config/200-clusterrole.yaml | 6 +- config/300-clusterimagepolicy.yaml | 4 +- config/500-webhook-configuration.yaml | 12 +-- config/policy-webhook.yaml | 2 +- config/webhook.yaml | 2 +- hack/update-codegen.sh | 4 +- .../testdata/config-image-policies.yaml | 2 +- .../{policycontroller => policy}/register.go | 4 +- .../v1alpha1/clusterimagepolicy_conversion.go | 2 +- .../clusterimagepolicy_conversion_test.go | 2 +- .../v1alpha1/clusterimagepolicy_defaults.go | 0 .../clusterimagepolicy_defaults_test.go | 0 .../v1alpha1/clusterimagepolicy_types.go | 0 .../v1alpha1/clusterimagepolicy_validation.go | 0 .../clusterimagepolicy_validation_test.go | 0 .../v1alpha1/doc.go | 2 +- .../v1alpha1/register.go | 4 +- .../v1alpha1/zz_generated.deepcopy.go | 0 .../v1beta1/clusterimagepolicy_conversion.go | 0 .../clusterimagepolicy_conversion_test.go | 0 .../v1beta1/clusterimagepolicy_defaults.go | 0 .../clusterimagepolicy_defaults_test.go | 0 .../v1beta1/clusterimagepolicy_types.go | 0 .../v1beta1/clusterimagepolicy_validation.go | 0 .../clusterimagepolicy_validation_test.go | 0 .../v1beta1/doc.go | 2 +- .../v1beta1/register.go | 4 +- .../v1beta1/zz_generated.deepcopy.go | 0 pkg/client/clientset/versioned/clientset.go | 32 +++---- .../versioned/fake/clientset_generated.go | 20 ++-- .../clientset/versioned/fake/register.go | 8 +- .../clientset/versioned/scheme/register.go | 8 +- .../v1alpha1/clusterimagepolicy.go | 4 +- .../v1alpha1/doc.go | 0 .../v1alpha1/fake/doc.go | 0 .../v1alpha1/fake/fake_clusterimagepolicy.go | 8 +- .../v1alpha1/fake/fake_policy_client.go} | 8 +- .../v1alpha1/generated_expansion.go | 0 .../v1alpha1/policy_client.go} | 32 +++---- .../v1beta1/clusterimagepolicy.go | 4 +- .../v1beta1/doc.go | 0 .../v1beta1/fake/doc.go | 0 .../v1beta1/fake/fake_clusterimagepolicy.go | 8 +- .../v1beta1/fake/fake_policy_client.go} | 8 +- .../v1beta1/generated_expansion.go | 0 .../v1beta1/policy_client.go} | 32 +++---- .../informers/externalversions/factory.go | 8 +- .../informers/externalversions/generic.go | 12 +-- .../{policycontroller => policy}/interface.go | 6 +- .../v1alpha1/clusterimagepolicy.go | 12 +-- .../v1alpha1/interface.go | 0 .../v1beta1/clusterimagepolicy.go | 12 +-- .../v1beta1/interface.go | 0 pkg/client/injection/client/client.go | 96 +++++++++---------- .../clusterimagepolicy/clusterimagepolicy.go | 24 ++--- .../v1alpha1}/clusterimagepolicy/fake/fake.go | 4 +- .../filtered/clusterimagepolicy.go | 24 ++--- .../clusterimagepolicy/filtered/fake/fake.go | 4 +- .../clusterimagepolicy/clusterimagepolicy.go | 24 ++--- .../v1beta1}/clusterimagepolicy/fake/fake.go | 4 +- .../filtered/clusterimagepolicy.go | 24 ++--- .../clusterimagepolicy/filtered/fake/fake.go | 4 +- .../clusterimagepolicy/controller.go | 6 +- .../v1alpha1/clusterimagepolicy/reconciler.go | 10 +- .../v1alpha1/clusterimagepolicy/state.go | 2 +- .../v1beta1}/clusterimagepolicy/controller.go | 6 +- .../v1beta1/clusterimagepolicy/reconciler.go | 10 +- .../v1beta1/clusterimagepolicy/state.go | 2 +- .../v1alpha1/clusterimagepolicy.go | 2 +- .../v1alpha1/expansion_generated.go | 0 .../v1beta1/clusterimagepolicy.go | 2 +- .../v1beta1/expansion_generated.go | 0 .../clusterimagepolicy_types.go | 2 +- pkg/cosign/kubernetes/webhook/validation.go | 2 +- .../kubernetes/webhook/validator_test.go | 2 +- .../clusterimagepolicy/clusterimagepolicy.go | 4 +- .../clusterimagepolicy_test.go | 4 +- .../clusterimagepolicy/controller.go | 6 +- .../clusterimagepolicy/controller_test.go | 2 +- .../testing/v1alpha1/clusterimagepolicy.go | 4 +- pkg/reconciler/testing/v1alpha1/listers.go | 4 +- test/e2e_test_cluster_image_policy.sh | 6 +- ..._cluster_image_policy_with_attestations.sh | 2 +- test/e2e_test_policy_controller.sh | 6 +- .../e2e/cip-key-with-attestations.yaml | 2 +- .../policy-controller/e2e/cip-key.yaml | 2 +- .../e2e/cip-keyless-with-attestations.yaml | 2 +- .../cip-keyless-with-identities-mismatch.yaml | 2 +- .../e2e/cip-keyless-with-identities.yaml | 2 +- .../policy-controller/e2e/cip-keyless.yaml | 2 +- ...s-two-signatures-and-two-attestations.yaml | 2 +- .../invalid/empty-keyless-ref.yaml | 2 +- .../invalid/empty-keyref-and-keylessref.yaml | 2 +- .../invalid/empty-keyref.yaml | 2 +- .../invalid/invalid-glob.yaml | 2 +- .../invalid/invalid-pubkey.yaml | 2 +- .../keylessref-with-empty-authorities.yaml | 2 +- .../keylessref-with-empty-identities.yaml | 2 +- .../keylessref-with-malformed-issuer.yaml | 2 +- .../keylessref-with-malformed-subject.yaml | 2 +- .../keylessref-with-multiple-properties.yaml | 2 +- .../keyref-with-multiple-properties.yaml | 2 +- .../invalid/valid-keyref-and-keylessref.yaml | 2 +- .../valid/valid-policy-glob.yaml | 2 +- .../policy-controller/valid/valid-policy.yaml | 2 +- 111 files changed, 314 insertions(+), 314 deletions(-) rename pkg/apis/{policycontroller => policy}/register.go (92%) rename pkg/apis/{policycontroller => policy}/v1alpha1/clusterimagepolicy_conversion.go (98%) rename pkg/apis/{policycontroller => policy}/v1alpha1/clusterimagepolicy_conversion_test.go (98%) rename pkg/apis/{policycontroller => policy}/v1alpha1/clusterimagepolicy_defaults.go (100%) rename pkg/apis/{policycontroller => policy}/v1alpha1/clusterimagepolicy_defaults_test.go (100%) rename pkg/apis/{policycontroller => policy}/v1alpha1/clusterimagepolicy_types.go (100%) rename pkg/apis/{policycontroller => policy}/v1alpha1/clusterimagepolicy_validation.go (100%) rename pkg/apis/{policycontroller => policy}/v1alpha1/clusterimagepolicy_validation_test.go (100%) rename pkg/apis/{policycontroller => policy}/v1alpha1/doc.go (93%) rename pkg/apis/{policycontroller => policy}/v1alpha1/register.go (90%) rename pkg/apis/{policycontroller => policy}/v1alpha1/zz_generated.deepcopy.go (100%) rename pkg/apis/{policycontroller => policy}/v1beta1/clusterimagepolicy_conversion.go (100%) rename pkg/apis/{policycontroller => policy}/v1beta1/clusterimagepolicy_conversion_test.go (100%) rename pkg/apis/{policycontroller => policy}/v1beta1/clusterimagepolicy_defaults.go (100%) rename pkg/apis/{policycontroller => policy}/v1beta1/clusterimagepolicy_defaults_test.go (100%) rename pkg/apis/{policycontroller => policy}/v1beta1/clusterimagepolicy_types.go (100%) rename pkg/apis/{policycontroller => policy}/v1beta1/clusterimagepolicy_validation.go (100%) rename pkg/apis/{policycontroller => policy}/v1beta1/clusterimagepolicy_validation_test.go (100%) rename pkg/apis/{policycontroller => policy}/v1beta1/doc.go (93%) rename pkg/apis/{policycontroller => policy}/v1beta1/register.go (90%) rename pkg/apis/{policycontroller => policy}/v1beta1/zz_generated.deepcopy.go (100%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1alpha1/clusterimagepolicy.go (97%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1alpha1/doc.go (100%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1alpha1/fake/doc.go (100%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1alpha1/fake/fake_clusterimagepolicy.go (94%) rename pkg/client/clientset/versioned/typed/{policycontroller/v1alpha1/fake/fake_policycontroller_client.go => policy/v1alpha1/fake/fake_policy_client.go} (80%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1alpha1/generated_expansion.go (100%) rename pkg/client/clientset/versioned/typed/{policycontroller/v1alpha1/policycontroller_client.go => policy/v1alpha1/policy_client.go} (65%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1beta1/clusterimagepolicy.go (97%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1beta1/doc.go (100%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1beta1/fake/doc.go (100%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1beta1/fake/fake_clusterimagepolicy.go (94%) rename pkg/client/clientset/versioned/typed/{policycontroller/v1beta1/fake/fake_policycontroller_client.go => policy/v1beta1/fake/fake_policy_client.go} (80%) rename pkg/client/clientset/versioned/typed/{policycontroller => policy}/v1beta1/generated_expansion.go (100%) rename pkg/client/clientset/versioned/typed/{policycontroller/v1beta1/policycontroller_client.go => policy/v1beta1/policy_client.go} (66%) rename pkg/client/informers/externalversions/{policycontroller => policy}/interface.go (95%) rename pkg/client/informers/externalversions/{policycontroller => policy}/v1alpha1/clusterimagepolicy.go (86%) rename pkg/client/informers/externalversions/{policycontroller => policy}/v1alpha1/interface.go (100%) rename pkg/client/informers/externalversions/{policycontroller => policy}/v1beta1/clusterimagepolicy.go (86%) rename pkg/client/informers/externalversions/{policycontroller => policy}/v1beta1/interface.go (100%) rename pkg/client/injection/informers/{policycontroller => policy}/v1alpha1/clusterimagepolicy/clusterimagepolicy.go (75%) rename pkg/client/injection/informers/{policycontroller/v1beta1 => policy/v1alpha1}/clusterimagepolicy/fake/fake.go (90%) rename pkg/client/injection/informers/{policycontroller => policy}/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go (77%) rename pkg/client/injection/informers/{policycontroller/v1beta1 => policy/v1alpha1}/clusterimagepolicy/filtered/fake/fake.go (92%) rename pkg/client/injection/informers/{policycontroller => policy}/v1beta1/clusterimagepolicy/clusterimagepolicy.go (75%) rename pkg/client/injection/informers/{policycontroller/v1alpha1 => policy/v1beta1}/clusterimagepolicy/fake/fake.go (90%) rename pkg/client/injection/informers/{policycontroller => policy}/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go (77%) rename pkg/client/injection/informers/{policycontroller/v1alpha1 => policy/v1beta1}/clusterimagepolicy/filtered/fake/fake.go (92%) rename pkg/client/injection/reconciler/{policycontroller/v1beta1 => policy/v1alpha1}/clusterimagepolicy/controller.go (95%) rename pkg/client/injection/reconciler/{policycontroller => policy}/v1alpha1/clusterimagepolicy/reconciler.go (96%) rename pkg/client/injection/reconciler/{policycontroller => policy}/v1alpha1/clusterimagepolicy/state.go (97%) rename pkg/client/injection/reconciler/{policycontroller/v1alpha1 => policy/v1beta1}/clusterimagepolicy/controller.go (95%) rename pkg/client/injection/reconciler/{policycontroller => policy}/v1beta1/clusterimagepolicy/reconciler.go (96%) rename pkg/client/injection/reconciler/{policycontroller => policy}/v1beta1/clusterimagepolicy/state.go (97%) rename pkg/client/listers/{policycontroller => policy}/v1alpha1/clusterimagepolicy.go (97%) rename pkg/client/listers/{policycontroller => policy}/v1alpha1/expansion_generated.go (100%) rename pkg/client/listers/{policycontroller => policy}/v1beta1/clusterimagepolicy.go (97%) rename pkg/client/listers/{policycontroller => policy}/v1beta1/expansion_generated.go (100%) diff --git a/.github/workflows/kind-cluster-image-policy-with-attestations.yaml b/.github/workflows/kind-cluster-image-policy-with-attestations.yaml index 4f29a2e3931..ac848748561 100644 --- a/.github/workflows/kind-cluster-image-policy-with-attestations.yaml +++ b/.github/workflows/kind-cluster-image-policy-with-attestations.yaml @@ -80,7 +80,7 @@ jobs: GIT_VERSION: ci LDFLAGS: "" COSIGNED_YAML: policy-controller-e2e.yaml - KO_PREFIX: registry.local:5000/cospolicy-controllerigned + KO_PREFIX: registry.local:5000/policy-controller COSIGNED_ARCHS: linux/amd64 run: | make ko-policy-controller diff --git a/.github/workflows/kind-e2e-cosigned.yaml b/.github/workflows/kind-e2e-cosigned.yaml index 110946c50ad..b33c72dac58 100644 --- a/.github/workflows/kind-e2e-cosigned.yaml +++ b/.github/workflows/kind-e2e-cosigned.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Cosigned KinD E2E +name: Policy Controller KinD E2E on: pull_request: @@ -121,7 +121,7 @@ jobs: run: | ./test/e2e_test_policy_crd.sh - - name: Run Cosigned Tests + - name: Run Policy Controller Tests run: | ./test/e2e_test_policy_controller.sh diff --git a/cmd/cosign/policy_webhook/main.go b/cmd/cosign/policy_webhook/main.go index a7e088dc6fc..82f54c4fb10 100644 --- a/cmd/cosign/policy_webhook/main.go +++ b/cmd/cosign/policy_webhook/main.go @@ -33,9 +33,9 @@ import ( "knative.dev/pkg/webhook/resourcesemantics/validation" "sigs.k8s.io/release-utils/version" - "github.com/sigstore/cosign/pkg/apis/policycontroller" - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + "github.com/sigstore/cosign/pkg/apis/policy" + "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" "github.com/sigstore/cosign/pkg/reconciler/clusterimagepolicy" // Register the provider-specific plugins @@ -135,7 +135,7 @@ func newConversionController(ctx context.Context, cmw configmap.Watcher) *contro // Specify the types of custom resource definitions that should be converted map[schema.GroupKind]conversion.GroupKindConversion{ v1beta1.Kind("ClusterImagePolicy"): { - DefinitionName: policycontroller.ClusterImagePolicyResource.String(), + DefinitionName: policy.ClusterImagePolicyResource.String(), HubVersion: v1alpha1GroupVersion, Zygotes: map[string]conversion.ConvertibleObject{ v1alpha1GroupVersion: &v1alpha1.ClusterImagePolicy{}, diff --git a/cmd/cosign/webhook/main.go b/cmd/cosign/webhook/main.go index a4d43dbefba..6de012148a6 100644 --- a/cmd/cosign/webhook/main.go +++ b/cmd/cosign/webhook/main.go @@ -52,7 +52,7 @@ var secretName = flag.String("secret-name", "", "The name of the secret in the w // ./config/500-webhook-configuration.yaml // https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/webhook/webhook_mutating.yaml // https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/webhook/webhook_validating.yaml -var webhookName = flag.String("webhook-name", "policycontroller.sigstore.dev", "The name of the validating and mutating webhook configurations as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to policy-controller.") +var webhookName = flag.String("webhook-name", "policy.sigstore.dev", "The name of the validating and mutating webhook configurations as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to policy-controller.") func main() { opts := webhook.Options{ diff --git a/cmd/schema/main.go b/cmd/schema/main.go index 83badbb8f67..62bcaf88d38 100644 --- a/cmd/schema/main.go +++ b/cmd/schema/main.go @@ -20,7 +20,7 @@ import ( "knative.dev/hack/schema/commands" "knative.dev/hack/schema/registry" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" ) // schema is a tool to dump the schema for Eventing resources. diff --git a/config/100-namespace.yaml b/config/100-namespace.yaml index 5fc7b3956d7..8fcf2831b6f 100644 --- a/config/100-namespace.yaml +++ b/config/100-namespace.yaml @@ -17,4 +17,4 @@ kind: Namespace metadata: name: cosign-system labels: - policycontroller.sigstore.dev/include: "false" + policy.sigstore.dev/include: "false" diff --git a/config/200-clusterrole.yaml b/config/200-clusterrole.yaml index 7575cfbd5d9..8be91935de4 100644 --- a/config/200-clusterrole.yaml +++ b/config/200-clusterrole.yaml @@ -28,7 +28,7 @@ rules: - apiGroups: ["admissionregistration.k8s.io"] resources: ["validatingwebhookconfigurations", "mutatingwebhookconfigurations"] verbs: ["get", "update"] - resourceNames: ["policycontroller.sigstore.dev", "validating.clusterimagepolicy.sigstore.dev", "defaulting.clusterimagepolicy.sigstore.dev"] + resourceNames: ["policy.sigstore.dev", "validating.clusterimagepolicy.sigstore.dev", "defaulting.clusterimagepolicy.sigstore.dev"] - apiGroups: [""] resources: ["namespaces"] @@ -45,10 +45,10 @@ rules: - apiGroups: ["apiextensions.k8s.io"] resources: ["customresourcedefinitions"] verbs: ["get", "update"] - resourceNames: ["clusterimagepolicies.policycontroller.sigstore.dev"] + resourceNames: ["clusterimagepolicies.policy.sigstore.dev"] # Allow reconciliation of the ClusterImagePolic CRDs. - - apiGroups: ["policycontroller.sigstore.dev"] + - apiGroups: ["policy.sigstore.dev"] resources: ["clusterimagepolicies"] verbs: ["get", "list", "update", "watch", "patch"] diff --git a/config/300-clusterimagepolicy.yaml b/config/300-clusterimagepolicy.yaml index 0a69a147b4d..e8d5d8ce4a3 100644 --- a/config/300-clusterimagepolicy.yaml +++ b/config/300-clusterimagepolicy.yaml @@ -14,9 +14,9 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: clusterimagepolicies.policycontroller.sigstore.dev + name: clusterimagepolicies.policy.sigstore.dev spec: - group: policycontroller.sigstore.dev + group: policy.sigstore.dev names: kind: ClusterImagePolicy plural: clusterimagepolicies diff --git a/config/500-webhook-configuration.yaml b/config/500-webhook-configuration.yaml index 34dc2eeb8ca..8a966077106 100644 --- a/config/500-webhook-configuration.yaml +++ b/config/500-webhook-configuration.yaml @@ -15,13 +15,13 @@ apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: - name: policycontroller.sigstore.dev + name: policy.sigstore.dev webhooks: -- name: policycontroller.sigstore.dev +- name: policy.sigstore.dev namespaceSelector: # The webhook should only apply to things that opt-in matchExpressions: - - key: policycontroller.sigstore.dev/include + - key: policy.sigstore.dev/include operator: In values: ["true"] admissionReviewVersions: [v1] @@ -37,13 +37,13 @@ webhooks: apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: - name: policycontroller.sigstore.dev + name: policy.sigstore.dev webhooks: -- name: policycontroller.sigstore.dev +- name: policy.sigstore.dev namespaceSelector: # The webhook should only apply to things that opt-in matchExpressions: - - key: policycontroller.sigstore.dev/include + - key: policy.sigstore.dev/include operator: In values: ["true"] admissionReviewVersions: [v1] diff --git a/config/policy-webhook.yaml b/config/policy-webhook.yaml index 063c77a8daf..d66607c50f9 100644 --- a/config/policy-webhook.yaml +++ b/config/policy-webhook.yaml @@ -60,7 +60,7 @@ spec: - name: CONFIG_LOGGING_NAME value: config-logging - name: METRICS_DOMAIN - value: sigstore.dev/policycontroller + value: sigstore.dev/policy - name: WEBHOOK_NAME value: policy-webhook diff --git a/config/webhook.yaml b/config/webhook.yaml index a64e53977e6..884ff58655c 100644 --- a/config/webhook.yaml +++ b/config/webhook.yaml @@ -60,7 +60,7 @@ spec: - name: CONFIG_LOGGING_NAME value: config-logging - name: METRICS_DOMAIN - value: sigstore.dev/policycontroller + value: sigstore.dev/policy - name: WEBHOOK_NAME value: webhook # Since we need to validate against different Rekor clients based on diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index c1f7018bfd3..d84243ffb95 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -45,7 +45,7 @@ group "Kubernetes Codegen" # instead of the $GOPATH directly. For normal projects this can be dropped. ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ github.com/sigstore/cosign/pkg/client github.com/sigstore/cosign/pkg/apis \ - "policycontroller:v1alpha1 policycontroller:v1beta1" \ + "policy:v1alpha1 policy:v1beta1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt group "Knative Codegen" @@ -53,7 +53,7 @@ group "Knative Codegen" # Knative Injection ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \ github.com/sigstore/cosign/pkg/client github.com/sigstore/cosign/pkg/apis \ - "policycontroller:v1alpha1 policycontroller:v1beta1" \ + "policy:v1alpha1 policy:v1beta1" \ --go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt group "Update CRD Schema" diff --git a/pkg/apis/config/testdata/config-image-policies.yaml b/pkg/apis/config/testdata/config-image-policies.yaml index bb4ad4e7fae..71f72940628 100644 --- a/pkg/apis/config/testdata/config-image-policies.yaml +++ b/pkg/apis/config/testdata/config-image-policies.yaml @@ -18,7 +18,7 @@ metadata: name: config-image-policies namespace: cosign-system labels: - policycontroller.sigstore.dev/release: devel + policy.sigstore.dev/release: devel data: _example: | diff --git a/pkg/apis/policycontroller/register.go b/pkg/apis/policy/register.go similarity index 92% rename from pkg/apis/policycontroller/register.go rename to pkg/apis/policy/register.go index f8960442625..17b92b201a6 100644 --- a/pkg/apis/policycontroller/register.go +++ b/pkg/apis/policy/register.go @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -package policycontroller +package policy import "k8s.io/apimachinery/pkg/runtime/schema" const ( // GroupName is the name of the API group. - GroupName = "policycontroller.sigstore.dev" + GroupName = "policy.sigstore.dev" ) var ( diff --git a/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion.go similarity index 98% rename from pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion.go index 9e067750f59..f390066772d 100644 --- a/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion.go +++ b/pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" v1 "k8s.io/api/core/v1" "knative.dev/pkg/apis" ) diff --git a/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion_test.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion_test.go similarity index 98% rename from pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion_test.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion_test.go index fd2c0d870e2..80f950dfc10 100644 --- a/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_conversion_test.go +++ b/pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion_test.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" ) // Test v1alpha1 -> v1beta1 -> v1alpha1 diff --git a/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_defaults.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_defaults.go similarity index 100% rename from pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_defaults.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_defaults.go diff --git a/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_defaults_test.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_defaults_test.go similarity index 100% rename from pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_defaults_test.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_defaults_test.go diff --git a/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_types.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_types.go similarity index 100% rename from pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_types.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_types.go diff --git a/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_validation.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_validation.go similarity index 100% rename from pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_validation.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_validation.go diff --git a/pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_validation_test.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_validation_test.go similarity index 100% rename from pkg/apis/policycontroller/v1alpha1/clusterimagepolicy_validation_test.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_validation_test.go diff --git a/pkg/apis/policycontroller/v1alpha1/doc.go b/pkg/apis/policy/v1alpha1/doc.go similarity index 93% rename from pkg/apis/policycontroller/v1alpha1/doc.go rename to pkg/apis/policy/v1alpha1/doc.go index 5619e7dc1b4..253e048cc81 100644 --- a/pkg/apis/policycontroller/v1alpha1/doc.go +++ b/pkg/apis/policy/v1alpha1/doc.go @@ -13,5 +13,5 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +groupName=policycontroller.sigstore.dev +// +groupName=policy.sigstore.dev package v1alpha1 diff --git a/pkg/apis/policycontroller/v1alpha1/register.go b/pkg/apis/policy/v1alpha1/register.go similarity index 90% rename from pkg/apis/policycontroller/v1alpha1/register.go rename to pkg/apis/policy/v1alpha1/register.go index d30bdefe963..fa2d638a098 100644 --- a/pkg/apis/policycontroller/v1alpha1/register.go +++ b/pkg/apis/policy/v1alpha1/register.go @@ -15,7 +15,7 @@ package v1alpha1 import ( - policycontroller "github.com/sigstore/cosign/pkg/apis/policycontroller" + policy "github.com/sigstore/cosign/pkg/apis/policy" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -23,7 +23,7 @@ import ( ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: policycontroller.GroupName, Version: "v1alpha1"} +var SchemeGroupVersion = schema.GroupVersion{Group: policy.GroupName, Version: "v1alpha1"} // Kind takes an unqualified kind and returns back a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/pkg/apis/policycontroller/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/policycontroller/v1alpha1/zz_generated.deepcopy.go rename to pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go diff --git a/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_conversion.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_conversion.go similarity index 100% rename from pkg/apis/policycontroller/v1beta1/clusterimagepolicy_conversion.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_conversion.go diff --git a/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_conversion_test.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_conversion_test.go similarity index 100% rename from pkg/apis/policycontroller/v1beta1/clusterimagepolicy_conversion_test.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_conversion_test.go diff --git a/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_defaults.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_defaults.go similarity index 100% rename from pkg/apis/policycontroller/v1beta1/clusterimagepolicy_defaults.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_defaults.go diff --git a/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_defaults_test.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_defaults_test.go similarity index 100% rename from pkg/apis/policycontroller/v1beta1/clusterimagepolicy_defaults_test.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_defaults_test.go diff --git a/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_types.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_types.go similarity index 100% rename from pkg/apis/policycontroller/v1beta1/clusterimagepolicy_types.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_types.go diff --git a/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_validation.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_validation.go similarity index 100% rename from pkg/apis/policycontroller/v1beta1/clusterimagepolicy_validation.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_validation.go diff --git a/pkg/apis/policycontroller/v1beta1/clusterimagepolicy_validation_test.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_validation_test.go similarity index 100% rename from pkg/apis/policycontroller/v1beta1/clusterimagepolicy_validation_test.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_validation_test.go diff --git a/pkg/apis/policycontroller/v1beta1/doc.go b/pkg/apis/policy/v1beta1/doc.go similarity index 93% rename from pkg/apis/policycontroller/v1beta1/doc.go rename to pkg/apis/policy/v1beta1/doc.go index d760ba90fa5..929ce54bba2 100644 --- a/pkg/apis/policycontroller/v1beta1/doc.go +++ b/pkg/apis/policy/v1beta1/doc.go @@ -13,5 +13,5 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +groupName=policycontroller.sigstore.dev +// +groupName=policy.sigstore.dev package v1beta1 diff --git a/pkg/apis/policycontroller/v1beta1/register.go b/pkg/apis/policy/v1beta1/register.go similarity index 90% rename from pkg/apis/policycontroller/v1beta1/register.go rename to pkg/apis/policy/v1beta1/register.go index b18174acc18..e356f8826c7 100644 --- a/pkg/apis/policycontroller/v1beta1/register.go +++ b/pkg/apis/policy/v1beta1/register.go @@ -15,7 +15,7 @@ package v1beta1 import ( - policycontroller "github.com/sigstore/cosign/pkg/apis/policycontroller" + policy "github.com/sigstore/cosign/pkg/apis/policy" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -23,7 +23,7 @@ import ( ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: policycontroller.GroupName, Version: "v1beta1"} +var SchemeGroupVersion = schema.GroupVersion{Group: policy.GroupName, Version: "v1beta1"} // Kind takes an unqualified kind and returns back a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/pkg/apis/policycontroller/v1beta1/zz_generated.deepcopy.go b/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/policycontroller/v1beta1/zz_generated.deepcopy.go rename to pkg/apis/policy/v1beta1/zz_generated.deepcopy.go diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index b49256a0879..7742a57c450 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -20,8 +20,8 @@ import ( "fmt" "net/http" - policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1" - policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1" + policyv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1alpha1" + policyv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1beta1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -29,26 +29,26 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - PolicycontrollerV1alpha1() policycontrollerv1alpha1.PolicycontrollerV1alpha1Interface - PolicycontrollerV1beta1() policycontrollerv1beta1.PolicycontrollerV1beta1Interface + PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface + PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - policycontrollerV1alpha1 *policycontrollerv1alpha1.PolicycontrollerV1alpha1Client - policycontrollerV1beta1 *policycontrollerv1beta1.PolicycontrollerV1beta1Client + policyV1alpha1 *policyv1alpha1.PolicyV1alpha1Client + policyV1beta1 *policyv1beta1.PolicyV1beta1Client } -// PolicycontrollerV1alpha1 retrieves the PolicycontrollerV1alpha1Client -func (c *Clientset) PolicycontrollerV1alpha1() policycontrollerv1alpha1.PolicycontrollerV1alpha1Interface { - return c.policycontrollerV1alpha1 +// PolicyV1alpha1 retrieves the PolicyV1alpha1Client +func (c *Clientset) PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface { + return c.policyV1alpha1 } -// PolicycontrollerV1beta1 retrieves the PolicycontrollerV1beta1Client -func (c *Clientset) PolicycontrollerV1beta1() policycontrollerv1beta1.PolicycontrollerV1beta1Interface { - return c.policycontrollerV1beta1 +// PolicyV1beta1 retrieves the PolicyV1beta1Client +func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface { + return c.policyV1beta1 } // Discovery retrieves the DiscoveryClient @@ -95,11 +95,11 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, var cs Clientset var err error - cs.policycontrollerV1alpha1, err = policycontrollerv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.policyV1alpha1, err = policyv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } - cs.policycontrollerV1beta1, err = policycontrollerv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.policyV1beta1, err = policyv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -124,8 +124,8 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.policycontrollerV1alpha1 = policycontrollerv1alpha1.New(c) - cs.policycontrollerV1beta1 = policycontrollerv1beta1.New(c) + cs.policyV1alpha1 = policyv1alpha1.New(c) + cs.policyV1beta1 = policyv1beta1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index bd6b5828a20..f7801b5fd5f 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -18,10 +18,10 @@ package fake import ( clientset "github.com/sigstore/cosign/pkg/client/clientset/versioned" - policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1" - fakepolicycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake" - policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1" - fakepolicycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake" + policyv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1alpha1" + fakepolicyv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake" + policyv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1beta1" + fakepolicyv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1beta1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -79,12 +79,12 @@ var ( _ testing.FakeClient = &Clientset{} ) -// PolicycontrollerV1alpha1 retrieves the PolicycontrollerV1alpha1Client -func (c *Clientset) PolicycontrollerV1alpha1() policycontrollerv1alpha1.PolicycontrollerV1alpha1Interface { - return &fakepolicycontrollerv1alpha1.FakePolicycontrollerV1alpha1{Fake: &c.Fake} +// PolicyV1alpha1 retrieves the PolicyV1alpha1Client +func (c *Clientset) PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface { + return &fakepolicyv1alpha1.FakePolicyV1alpha1{Fake: &c.Fake} } -// PolicycontrollerV1beta1 retrieves the PolicycontrollerV1beta1Client -func (c *Clientset) PolicycontrollerV1beta1() policycontrollerv1beta1.PolicycontrollerV1beta1Interface { - return &fakepolicycontrollerv1beta1.FakePolicycontrollerV1beta1{Fake: &c.Fake} +// PolicyV1beta1 retrieves the PolicyV1beta1Client +func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface { + return &fakepolicyv1beta1.FakePolicyV1beta1{Fake: &c.Fake} } diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 4d459f361c4..93148e26697 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -17,8 +17,8 @@ package fake import ( - policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" - policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + policyv1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" + policyv1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,8 +30,8 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - policycontrollerv1alpha1.AddToScheme, - policycontrollerv1beta1.AddToScheme, + policyv1alpha1.AddToScheme, + policyv1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 82a9c5709cd..70cd652d898 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -17,8 +17,8 @@ package scheme import ( - policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" - policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + policyv1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" + policyv1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,8 +30,8 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - policycontrollerv1alpha1.AddToScheme, - policycontrollerv1beta1.AddToScheme, + policyv1alpha1.AddToScheme, + policyv1beta1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/clusterimagepolicy.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/clusterimagepolicy.go similarity index 97% rename from pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/clusterimagepolicy.go index c364c6fa1b3..bf5f6b52d44 100644 --- a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/clusterimagepolicy.go +++ b/pkg/client/clientset/versioned/typed/policy/v1alpha1/clusterimagepolicy.go @@ -20,7 +20,7 @@ import ( "context" "time" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" scheme "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -53,7 +53,7 @@ type clusterImagePolicies struct { } // newClusterImagePolicies returns a ClusterImagePolicies -func newClusterImagePolicies(c *PolicycontrollerV1alpha1Client) *clusterImagePolicies { +func newClusterImagePolicies(c *PolicyV1alpha1Client) *clusterImagePolicies { return &clusterImagePolicies{ client: c.RESTClient(), } diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/doc.go diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_clusterimagepolicy.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_clusterimagepolicy.go similarity index 94% rename from pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_clusterimagepolicy.go index 3d880567e76..92be94398b3 100644 --- a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_clusterimagepolicy.go +++ b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_clusterimagepolicy.go @@ -19,7 +19,7 @@ package fake import ( "context" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,12 +30,12 @@ import ( // FakeClusterImagePolicies implements ClusterImagePolicyInterface type FakeClusterImagePolicies struct { - Fake *FakePolicycontrollerV1alpha1 + Fake *FakePolicyV1alpha1 } -var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "policycontroller.sigstore.dev", Version: "v1alpha1", Resource: "clusterimagepolicies"} +var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "policy.sigstore.dev", Version: "v1alpha1", Resource: "clusterimagepolicies"} -var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "policycontroller.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy"} +var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "policy.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy"} // Get takes name of the clusterImagePolicy, and returns the corresponding clusterImagePolicy object, and an error if there is any. func (c *FakeClusterImagePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterImagePolicy, err error) { diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_policycontroller_client.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go similarity index 80% rename from pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_policycontroller_client.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go index 92562e91bdf..a9f0c553bbe 100644 --- a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/fake/fake_policycontroller_client.go +++ b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go @@ -17,22 +17,22 @@ package fake import ( - v1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakePolicycontrollerV1alpha1 struct { +type FakePolicyV1alpha1 struct { *testing.Fake } -func (c *FakePolicycontrollerV1alpha1) ClusterImagePolicies() v1alpha1.ClusterImagePolicyInterface { +func (c *FakePolicyV1alpha1) ClusterImagePolicies() v1alpha1.ClusterImagePolicyInterface { return &FakeClusterImagePolicies{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakePolicycontrollerV1alpha1) RESTClient() rest.Interface { +func (c *FakePolicyV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/generated_expansion.go similarity index 100% rename from pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/generated_expansion.go diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/policycontroller_client.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/policy_client.go similarity index 65% rename from pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/policycontroller_client.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/policy_client.go index 94fe33033a8..198ccf26273 100644 --- a/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1/policycontroller_client.go +++ b/pkg/client/clientset/versioned/typed/policy/v1alpha1/policy_client.go @@ -19,29 +19,29 @@ package v1alpha1 import ( "net/http" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type PolicycontrollerV1alpha1Interface interface { +type PolicyV1alpha1Interface interface { RESTClient() rest.Interface ClusterImagePoliciesGetter } -// PolicycontrollerV1alpha1Client is used to interact with features provided by the policycontroller.sigstore.dev group. -type PolicycontrollerV1alpha1Client struct { +// PolicyV1alpha1Client is used to interact with features provided by the policy.sigstore.dev group. +type PolicyV1alpha1Client struct { restClient rest.Interface } -func (c *PolicycontrollerV1alpha1Client) ClusterImagePolicies() ClusterImagePolicyInterface { +func (c *PolicyV1alpha1Client) ClusterImagePolicies() ClusterImagePolicyInterface { return newClusterImagePolicies(c) } -// NewForConfig creates a new PolicycontrollerV1alpha1Client for the given config. +// NewForConfig creates a new PolicyV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*PolicycontrollerV1alpha1Client, error) { +func NewForConfig(c *rest.Config) (*PolicyV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -53,9 +53,9 @@ func NewForConfig(c *rest.Config) (*PolicycontrollerV1alpha1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new PolicycontrollerV1alpha1Client for the given config and http client. +// NewForConfigAndClient creates a new PolicyV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicycontrollerV1alpha1Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicyV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -64,12 +64,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicycontrollerV1a if err != nil { return nil, err } - return &PolicycontrollerV1alpha1Client{client}, nil + return &PolicyV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new PolicycontrollerV1alpha1Client for the given config and +// NewForConfigOrDie creates a new PolicyV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *PolicycontrollerV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *PolicyV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -77,9 +77,9 @@ func NewForConfigOrDie(c *rest.Config) *PolicycontrollerV1alpha1Client { return client } -// New creates a new PolicycontrollerV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *PolicycontrollerV1alpha1Client { - return &PolicycontrollerV1alpha1Client{c} +// New creates a new PolicyV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *PolicyV1alpha1Client { + return &PolicyV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -97,7 +97,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *PolicycontrollerV1alpha1Client) RESTClient() rest.Interface { +func (c *PolicyV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/clusterimagepolicy.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/clusterimagepolicy.go similarity index 97% rename from pkg/client/clientset/versioned/typed/policycontroller/v1beta1/clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/clusterimagepolicy.go index 4b1e670bf24..195c55b8989 100644 --- a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/clusterimagepolicy.go +++ b/pkg/client/clientset/versioned/typed/policy/v1beta1/clusterimagepolicy.go @@ -20,7 +20,7 @@ import ( "context" "time" - v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" scheme "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -53,7 +53,7 @@ type clusterImagePolicies struct { } // newClusterImagePolicies returns a ClusterImagePolicies -func newClusterImagePolicies(c *PolicycontrollerV1beta1Client) *clusterImagePolicies { +func newClusterImagePolicies(c *PolicyV1beta1Client) *clusterImagePolicies { return &clusterImagePolicies{ client: c.RESTClient(), } diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/doc.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/policycontroller/v1beta1/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/doc.go diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/doc.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_clusterimagepolicy.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/fake/fake_clusterimagepolicy.go similarity index 94% rename from pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/fake/fake_clusterimagepolicy.go index b6592a8e3b4..74a35bde229 100644 --- a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_clusterimagepolicy.go +++ b/pkg/client/clientset/versioned/typed/policy/v1beta1/fake/fake_clusterimagepolicy.go @@ -19,7 +19,7 @@ package fake import ( "context" - v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,12 +30,12 @@ import ( // FakeClusterImagePolicies implements ClusterImagePolicyInterface type FakeClusterImagePolicies struct { - Fake *FakePolicycontrollerV1beta1 + Fake *FakePolicyV1beta1 } -var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "policycontroller.sigstore.dev", Version: "v1beta1", Resource: "clusterimagepolicies"} +var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "policy.sigstore.dev", Version: "v1beta1", Resource: "clusterimagepolicies"} -var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "policycontroller.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy"} +var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "policy.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy"} // Get takes name of the clusterImagePolicy, and returns the corresponding clusterImagePolicy object, and an error if there is any. func (c *FakeClusterImagePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterImagePolicy, err error) { diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_policycontroller_client.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/fake/fake_policy_client.go similarity index 80% rename from pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_policycontroller_client.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/fake/fake_policy_client.go index f86282c33c4..b5f52e2d7c3 100644 --- a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/fake/fake_policycontroller_client.go +++ b/pkg/client/clientset/versioned/typed/policy/v1beta1/fake/fake_policy_client.go @@ -17,22 +17,22 @@ package fake import ( - v1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakePolicycontrollerV1beta1 struct { +type FakePolicyV1beta1 struct { *testing.Fake } -func (c *FakePolicycontrollerV1beta1) ClusterImagePolicies() v1beta1.ClusterImagePolicyInterface { +func (c *FakePolicyV1beta1) ClusterImagePolicies() v1beta1.ClusterImagePolicyInterface { return &FakeClusterImagePolicies{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakePolicycontrollerV1beta1) RESTClient() rest.Interface { +func (c *FakePolicyV1beta1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/generated_expansion.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/generated_expansion.go similarity index 100% rename from pkg/client/clientset/versioned/typed/policycontroller/v1beta1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/generated_expansion.go diff --git a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/policycontroller_client.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/policy_client.go similarity index 66% rename from pkg/client/clientset/versioned/typed/policycontroller/v1beta1/policycontroller_client.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/policy_client.go index fad29722bf0..5146b989aff 100644 --- a/pkg/client/clientset/versioned/typed/policycontroller/v1beta1/policycontroller_client.go +++ b/pkg/client/clientset/versioned/typed/policy/v1beta1/policy_client.go @@ -19,29 +19,29 @@ package v1beta1 import ( "net/http" - v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type PolicycontrollerV1beta1Interface interface { +type PolicyV1beta1Interface interface { RESTClient() rest.Interface ClusterImagePoliciesGetter } -// PolicycontrollerV1beta1Client is used to interact with features provided by the policycontroller.sigstore.dev group. -type PolicycontrollerV1beta1Client struct { +// PolicyV1beta1Client is used to interact with features provided by the policy.sigstore.dev group. +type PolicyV1beta1Client struct { restClient rest.Interface } -func (c *PolicycontrollerV1beta1Client) ClusterImagePolicies() ClusterImagePolicyInterface { +func (c *PolicyV1beta1Client) ClusterImagePolicies() ClusterImagePolicyInterface { return newClusterImagePolicies(c) } -// NewForConfig creates a new PolicycontrollerV1beta1Client for the given config. +// NewForConfig creates a new PolicyV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*PolicycontrollerV1beta1Client, error) { +func NewForConfig(c *rest.Config) (*PolicyV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -53,9 +53,9 @@ func NewForConfig(c *rest.Config) (*PolicycontrollerV1beta1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new PolicycontrollerV1beta1Client for the given config and http client. +// NewForConfigAndClient creates a new PolicyV1beta1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicycontrollerV1beta1Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicyV1beta1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -64,12 +64,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicycontrollerV1b if err != nil { return nil, err } - return &PolicycontrollerV1beta1Client{client}, nil + return &PolicyV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new PolicycontrollerV1beta1Client for the given config and +// NewForConfigOrDie creates a new PolicyV1beta1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *PolicycontrollerV1beta1Client { +func NewForConfigOrDie(c *rest.Config) *PolicyV1beta1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -77,9 +77,9 @@ func NewForConfigOrDie(c *rest.Config) *PolicycontrollerV1beta1Client { return client } -// New creates a new PolicycontrollerV1beta1Client for the given RESTClient. -func New(c rest.Interface) *PolicycontrollerV1beta1Client { - return &PolicycontrollerV1beta1Client{c} +// New creates a new PolicyV1beta1Client for the given RESTClient. +func New(c rest.Interface) *PolicyV1beta1Client { + return &PolicyV1beta1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -97,7 +97,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *PolicycontrollerV1beta1Client) RESTClient() rest.Interface { +func (c *PolicyV1beta1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index b5d2716e3f4..097c2aecbcb 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -23,7 +23,7 @@ import ( versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" internalinterfaces "github.com/sigstore/cosign/pkg/client/informers/externalversions/internalinterfaces" - policycontroller "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller" + policy "github.com/sigstore/cosign/pkg/client/informers/externalversions/policy" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -170,9 +170,9 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - Policycontroller() policycontroller.Interface + Policy() policy.Interface } -func (f *sharedInformerFactory) Policycontroller() policycontroller.Interface { - return policycontroller.New(f, f.namespace, f.tweakListOptions) +func (f *sharedInformerFactory) Policy() policy.Interface { + return policy.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index e6ebf78bdbd..3c6ef7753c4 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -19,8 +19,8 @@ package externalversions import ( "fmt" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" - v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -51,13 +51,13 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=policycontroller.sigstore.dev, Version=v1alpha1 + // Group=policy.sigstore.dev, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithResource("clusterimagepolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Policycontroller().V1alpha1().ClusterImagePolicies().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1alpha1().ClusterImagePolicies().Informer()}, nil - // Group=policycontroller.sigstore.dev, Version=v1beta1 + // Group=policy.sigstore.dev, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithResource("clusterimagepolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Policycontroller().V1beta1().ClusterImagePolicies().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().ClusterImagePolicies().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/policycontroller/interface.go b/pkg/client/informers/externalversions/policy/interface.go similarity index 95% rename from pkg/client/informers/externalversions/policycontroller/interface.go rename to pkg/client/informers/externalversions/policy/interface.go index 20eb005c11f..c997ffc4f6a 100644 --- a/pkg/client/informers/externalversions/policycontroller/interface.go +++ b/pkg/client/informers/externalversions/policy/interface.go @@ -14,12 +14,12 @@ // Code generated by informer-gen. DO NOT EDIT. -package policycontroller +package policy import ( internalinterfaces "github.com/sigstore/cosign/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1" - v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1" + v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1alpha1" + v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1beta1" ) // Interface provides access to each of this group's versions. diff --git a/pkg/client/informers/externalversions/policycontroller/v1alpha1/clusterimagepolicy.go b/pkg/client/informers/externalversions/policy/v1alpha1/clusterimagepolicy.go similarity index 86% rename from pkg/client/informers/externalversions/policycontroller/v1alpha1/clusterimagepolicy.go rename to pkg/client/informers/externalversions/policy/v1alpha1/clusterimagepolicy.go index 50b3b076ce2..26bd1d1b373 100644 --- a/pkg/client/informers/externalversions/policycontroller/v1alpha1/clusterimagepolicy.go +++ b/pkg/client/informers/externalversions/policy/v1alpha1/clusterimagepolicy.go @@ -20,10 +20,10 @@ import ( "context" time "time" - policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + policyv1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" internalinterfaces "github.com/sigstore/cosign/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policy/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -59,16 +59,16 @@ func NewFilteredClusterImagePolicyInformer(client versioned.Interface, resyncPer if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicycontrollerV1alpha1().ClusterImagePolicies().List(context.TODO(), options) + return client.PolicyV1alpha1().ClusterImagePolicies().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicycontrollerV1alpha1().ClusterImagePolicies().Watch(context.TODO(), options) + return client.PolicyV1alpha1().ClusterImagePolicies().Watch(context.TODO(), options) }, }, - &policycontrollerv1alpha1.ClusterImagePolicy{}, + &policyv1alpha1.ClusterImagePolicy{}, resyncPeriod, indexers, ) @@ -79,7 +79,7 @@ func (f *clusterImagePolicyInformer) defaultInformer(client versioned.Interface, } func (f *clusterImagePolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&policycontrollerv1alpha1.ClusterImagePolicy{}, f.defaultInformer) + return f.factory.InformerFor(&policyv1alpha1.ClusterImagePolicy{}, f.defaultInformer) } func (f *clusterImagePolicyInformer) Lister() v1alpha1.ClusterImagePolicyLister { diff --git a/pkg/client/informers/externalversions/policycontroller/v1alpha1/interface.go b/pkg/client/informers/externalversions/policy/v1alpha1/interface.go similarity index 100% rename from pkg/client/informers/externalversions/policycontroller/v1alpha1/interface.go rename to pkg/client/informers/externalversions/policy/v1alpha1/interface.go diff --git a/pkg/client/informers/externalversions/policycontroller/v1beta1/clusterimagepolicy.go b/pkg/client/informers/externalversions/policy/v1beta1/clusterimagepolicy.go similarity index 86% rename from pkg/client/informers/externalversions/policycontroller/v1beta1/clusterimagepolicy.go rename to pkg/client/informers/externalversions/policy/v1beta1/clusterimagepolicy.go index a2e22a381ea..5e365c0acca 100644 --- a/pkg/client/informers/externalversions/policycontroller/v1beta1/clusterimagepolicy.go +++ b/pkg/client/informers/externalversions/policy/v1beta1/clusterimagepolicy.go @@ -20,10 +20,10 @@ import ( "context" time "time" - policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + policyv1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" internalinterfaces "github.com/sigstore/cosign/pkg/client/informers/externalversions/internalinterfaces" - v1beta1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/client/listers/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -59,16 +59,16 @@ func NewFilteredClusterImagePolicyInformer(client versioned.Interface, resyncPer if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicycontrollerV1beta1().ClusterImagePolicies().List(context.TODO(), options) + return client.PolicyV1beta1().ClusterImagePolicies().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicycontrollerV1beta1().ClusterImagePolicies().Watch(context.TODO(), options) + return client.PolicyV1beta1().ClusterImagePolicies().Watch(context.TODO(), options) }, }, - &policycontrollerv1beta1.ClusterImagePolicy{}, + &policyv1beta1.ClusterImagePolicy{}, resyncPeriod, indexers, ) @@ -79,7 +79,7 @@ func (f *clusterImagePolicyInformer) defaultInformer(client versioned.Interface, } func (f *clusterImagePolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&policycontrollerv1beta1.ClusterImagePolicy{}, f.defaultInformer) + return f.factory.InformerFor(&policyv1beta1.ClusterImagePolicy{}, f.defaultInformer) } func (f *clusterImagePolicyInformer) Lister() v1beta1.ClusterImagePolicyLister { diff --git a/pkg/client/informers/externalversions/policycontroller/v1beta1/interface.go b/pkg/client/informers/externalversions/policy/v1beta1/interface.go similarity index 100% rename from pkg/client/informers/externalversions/policycontroller/v1beta1/interface.go rename to pkg/client/informers/externalversions/policy/v1beta1/interface.go diff --git a/pkg/client/injection/client/client.go b/pkg/client/injection/client/client.go index bb465b97b50..a45933165d2 100644 --- a/pkg/client/injection/client/client.go +++ b/pkg/client/injection/client/client.go @@ -22,11 +22,11 @@ import ( errors "errors" fmt "fmt" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" - v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - typedpolicycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1alpha1" - typedpolicycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policycontroller/v1beta1" + typedpolicyv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1alpha1" + typedpolicyv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" @@ -96,40 +96,40 @@ func convert(from interface{}, to runtime.Object) error { return nil } -// PolicycontrollerV1alpha1 retrieves the PolicycontrollerV1alpha1Client -func (w *wrapClient) PolicycontrollerV1alpha1() typedpolicycontrollerv1alpha1.PolicycontrollerV1alpha1Interface { - return &wrapPolicycontrollerV1alpha1{ +// PolicyV1alpha1 retrieves the PolicyV1alpha1Client +func (w *wrapClient) PolicyV1alpha1() typedpolicyv1alpha1.PolicyV1alpha1Interface { + return &wrapPolicyV1alpha1{ dyn: w.dyn, } } -type wrapPolicycontrollerV1alpha1 struct { +type wrapPolicyV1alpha1 struct { dyn dynamic.Interface } -func (w *wrapPolicycontrollerV1alpha1) RESTClient() rest.Interface { +func (w *wrapPolicyV1alpha1) RESTClient() rest.Interface { panic("RESTClient called on dynamic client!") } -func (w *wrapPolicycontrollerV1alpha1) ClusterImagePolicies() typedpolicycontrollerv1alpha1.ClusterImagePolicyInterface { - return &wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl{ +func (w *wrapPolicyV1alpha1) ClusterImagePolicies() typedpolicyv1alpha1.ClusterImagePolicyInterface { + return &wrapPolicyV1alpha1ClusterImagePolicyImpl{ dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "policycontroller.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1alpha1", Resource: "clusterimagepolicies", }), } } -type wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl struct { +type wrapPolicyV1alpha1ClusterImagePolicyImpl struct { dyn dynamic.NamespaceableResourceInterface } -var _ typedpolicycontrollerv1alpha1.ClusterImagePolicyInterface = (*wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl)(nil) +var _ typedpolicyv1alpha1.ClusterImagePolicyInterface = (*wrapPolicyV1alpha1ClusterImagePolicyImpl)(nil) -func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Create(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.CreateOptions) (*v1alpha1.ClusterImagePolicy, error) { +func (w *wrapPolicyV1alpha1ClusterImagePolicyImpl) Create(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.CreateOptions) (*v1alpha1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "policycontroller.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy", }) @@ -148,15 +148,15 @@ func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Create(ctx context. return out, nil } -func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (w *wrapPolicyV1alpha1ClusterImagePolicyImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return w.dyn.Delete(ctx, name, opts) } -func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (w *wrapPolicyV1alpha1ClusterImagePolicyImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { return w.dyn.DeleteCollection(ctx, opts, listOpts) } -func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterImagePolicy, error) { +func (w *wrapPolicyV1alpha1ClusterImagePolicyImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterImagePolicy, error) { uo, err := w.dyn.Get(ctx, name, opts) if err != nil { return nil, err @@ -168,7 +168,7 @@ func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Get(ctx context.Con return out, nil } -func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterImagePolicyList, error) { +func (w *wrapPolicyV1alpha1ClusterImagePolicyImpl) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterImagePolicyList, error) { uo, err := w.dyn.List(ctx, opts) if err != nil { return nil, err @@ -180,7 +180,7 @@ func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) List(ctx context.Co return out, nil } -func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterImagePolicy, err error) { +func (w *wrapPolicyV1alpha1ClusterImagePolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterImagePolicy, err error) { uo, err := w.dyn.Patch(ctx, name, pt, data, opts) if err != nil { return nil, err @@ -192,9 +192,9 @@ func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Patch(ctx context.C return out, nil } -func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { +func (w *wrapPolicyV1alpha1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "policycontroller.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy", }) @@ -213,9 +213,9 @@ func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Update(ctx context. return out, nil } -func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { +func (w *wrapPolicyV1alpha1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "policycontroller.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1alpha1", Kind: "ClusterImagePolicy", }) @@ -234,44 +234,44 @@ func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) UpdateStatus(ctx co return out, nil } -func (w *wrapPolicycontrollerV1alpha1ClusterImagePolicyImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (w *wrapPolicyV1alpha1ClusterImagePolicyImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return nil, errors.New("NYI: Watch") } -// PolicycontrollerV1beta1 retrieves the PolicycontrollerV1beta1Client -func (w *wrapClient) PolicycontrollerV1beta1() typedpolicycontrollerv1beta1.PolicycontrollerV1beta1Interface { - return &wrapPolicycontrollerV1beta1{ +// PolicyV1beta1 retrieves the PolicyV1beta1Client +func (w *wrapClient) PolicyV1beta1() typedpolicyv1beta1.PolicyV1beta1Interface { + return &wrapPolicyV1beta1{ dyn: w.dyn, } } -type wrapPolicycontrollerV1beta1 struct { +type wrapPolicyV1beta1 struct { dyn dynamic.Interface } -func (w *wrapPolicycontrollerV1beta1) RESTClient() rest.Interface { +func (w *wrapPolicyV1beta1) RESTClient() rest.Interface { panic("RESTClient called on dynamic client!") } -func (w *wrapPolicycontrollerV1beta1) ClusterImagePolicies() typedpolicycontrollerv1beta1.ClusterImagePolicyInterface { - return &wrapPolicycontrollerV1beta1ClusterImagePolicyImpl{ +func (w *wrapPolicyV1beta1) ClusterImagePolicies() typedpolicyv1beta1.ClusterImagePolicyInterface { + return &wrapPolicyV1beta1ClusterImagePolicyImpl{ dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "policycontroller.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1beta1", Resource: "clusterimagepolicies", }), } } -type wrapPolicycontrollerV1beta1ClusterImagePolicyImpl struct { +type wrapPolicyV1beta1ClusterImagePolicyImpl struct { dyn dynamic.NamespaceableResourceInterface } -var _ typedpolicycontrollerv1beta1.ClusterImagePolicyInterface = (*wrapPolicycontrollerV1beta1ClusterImagePolicyImpl)(nil) +var _ typedpolicyv1beta1.ClusterImagePolicyInterface = (*wrapPolicyV1beta1ClusterImagePolicyImpl)(nil) -func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Create(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.CreateOptions) (*v1beta1.ClusterImagePolicy, error) { +func (w *wrapPolicyV1beta1ClusterImagePolicyImpl) Create(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.CreateOptions) (*v1beta1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "policycontroller.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy", }) @@ -290,15 +290,15 @@ func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Create(ctx context.C return out, nil } -func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { +func (w *wrapPolicyV1beta1ClusterImagePolicyImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return w.dyn.Delete(ctx, name, opts) } -func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { +func (w *wrapPolicyV1beta1ClusterImagePolicyImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { return w.dyn.DeleteCollection(ctx, opts, listOpts) } -func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterImagePolicy, error) { +func (w *wrapPolicyV1beta1ClusterImagePolicyImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterImagePolicy, error) { uo, err := w.dyn.Get(ctx, name, opts) if err != nil { return nil, err @@ -310,7 +310,7 @@ func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Get(ctx context.Cont return out, nil } -func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterImagePolicyList, error) { +func (w *wrapPolicyV1beta1ClusterImagePolicyImpl) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterImagePolicyList, error) { uo, err := w.dyn.List(ctx, opts) if err != nil { return nil, err @@ -322,7 +322,7 @@ func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) List(ctx context.Con return out, nil } -func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterImagePolicy, err error) { +func (w *wrapPolicyV1beta1ClusterImagePolicyImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterImagePolicy, err error) { uo, err := w.dyn.Patch(ctx, name, pt, data, opts) if err != nil { return nil, err @@ -334,9 +334,9 @@ func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Patch(ctx context.Co return out, nil } -func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { +func (w *wrapPolicyV1beta1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "policycontroller.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy", }) @@ -355,9 +355,9 @@ func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Update(ctx context.C return out, nil } -func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { +func (w *wrapPolicyV1beta1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "policycontroller.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1beta1", Kind: "ClusterImagePolicy", }) @@ -376,6 +376,6 @@ func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) UpdateStatus(ctx con return out, nil } -func (w *wrapPolicycontrollerV1beta1ClusterImagePolicyImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { +func (w *wrapPolicyV1beta1ClusterImagePolicyImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return nil, errors.New("NYI: Watch") } diff --git a/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/clusterimagepolicy.go b/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/clusterimagepolicy.go similarity index 75% rename from pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/clusterimagepolicy.go rename to pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/clusterimagepolicy.go index e50f2c4f268..53173e52476 100644 --- a/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/clusterimagepolicy.go @@ -19,12 +19,12 @@ package clusterimagepolicy import ( context "context" - apispolicycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + apispolicyv1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1alpha1" client "github.com/sigstore/cosign/pkg/client/injection/client" factory "github.com/sigstore/cosign/pkg/client/injection/informers/factory" - policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" + policyv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policy/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" cache "k8s.io/client-go/tools/cache" @@ -43,7 +43,7 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Policycontroller().V1alpha1().ClusterImagePolicies() + inf := f.Policy().V1alpha1().ClusterImagePolicies() return context.WithValue(ctx, Key{}, inf), inf.Informer() } @@ -57,7 +57,7 @@ func Get(ctx context.Context) v1alpha1.ClusterImagePolicyInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1.ClusterImagePolicyInformer from context.") + "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1alpha1.ClusterImagePolicyInformer from context.") } return untyped.(v1alpha1.ClusterImagePolicyInformer) } @@ -69,13 +69,13 @@ type wrapper struct { } var _ v1alpha1.ClusterImagePolicyInformer = (*wrapper)(nil) -var _ policycontrollerv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policyv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispolicycontrollerv1alpha1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicyv1alpha1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() policycontrollerv1alpha1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policyv1alpha1.ClusterImagePolicyLister { return w } @@ -87,8 +87,8 @@ func (w *wrapper) SetResourceVersion(resourceVersion string) { w.resourceVersion = resourceVersion } -func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1alpha1.ClusterImagePolicy, err error) { - lo, err := w.client.PolicycontrollerV1alpha1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ +func (w *wrapper) List(selector labels.Selector) (ret []*apispolicyv1alpha1.ClusterImagePolicy, err error) { + lo, err := w.client.PolicyV1alpha1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ LabelSelector: selector.String(), ResourceVersion: w.resourceVersion, }) @@ -101,8 +101,8 @@ func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1a return ret, nil } -func (w *wrapper) Get(name string) (*apispolicycontrollerv1alpha1.ClusterImagePolicy, error) { - return w.client.PolicycontrollerV1alpha1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ +func (w *wrapper) Get(name string) (*apispolicyv1alpha1.ClusterImagePolicy, error) { + return w.client.PolicyV1alpha1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ ResourceVersion: w.resourceVersion, }) } diff --git a/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/fake/fake.go b/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/fake/fake.go similarity index 90% rename from pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/fake/fake.go rename to pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/fake/fake.go index 5d17892c965..242ed864d42 100644 --- a/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/fake/fake.go +++ b/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/fake/fake.go @@ -20,7 +20,7 @@ import ( context "context" fake "github.com/sigstore/cosign/pkg/client/injection/informers/factory/fake" - clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy" + clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -33,6 +33,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Policycontroller().V1beta1().ClusterImagePolicies() + inf := f.Policy().V1alpha1().ClusterImagePolicies() return context.WithValue(ctx, clusterimagepolicy.Key{}, inf), inf.Informer() } diff --git a/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go b/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go similarity index 77% rename from pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go rename to pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go index b224b3166d6..b352b6f07a8 100644 --- a/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go @@ -19,12 +19,12 @@ package filtered import ( context "context" - apispolicycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + apispolicyv1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1alpha1" client "github.com/sigstore/cosign/pkg/client/injection/client" filtered "github.com/sigstore/cosign/pkg/client/injection/informers/factory/filtered" - policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" + policyv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policy/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" cache "k8s.io/client-go/tools/cache" @@ -53,7 +53,7 @@ func withInformer(ctx context.Context) (context.Context, []controller.Informer) infs := []controller.Informer{} for _, selector := range labelSelectors { f := filtered.Get(ctx, selector) - inf := f.Policycontroller().V1alpha1().ClusterImagePolicies() + inf := f.Policy().V1alpha1().ClusterImagePolicies() ctx = context.WithValue(ctx, Key{Selector: selector}, inf) infs = append(infs, inf.Informer()) } @@ -79,7 +79,7 @@ func Get(ctx context.Context, selector string) v1alpha1.ClusterImagePolicyInform untyped := ctx.Value(Key{Selector: selector}) if untyped == nil { logging.FromContext(ctx).Panicf( - "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1alpha1.ClusterImagePolicyInformer with selector %s from context.", selector) + "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1alpha1.ClusterImagePolicyInformer with selector %s from context.", selector) } return untyped.(v1alpha1.ClusterImagePolicyInformer) } @@ -91,23 +91,23 @@ type wrapper struct { } var _ v1alpha1.ClusterImagePolicyInformer = (*wrapper)(nil) -var _ policycontrollerv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policyv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispolicycontrollerv1alpha1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicyv1alpha1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() policycontrollerv1alpha1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policyv1alpha1.ClusterImagePolicyLister { return w } -func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1alpha1.ClusterImagePolicy, err error) { +func (w *wrapper) List(selector labels.Selector) (ret []*apispolicyv1alpha1.ClusterImagePolicy, err error) { reqs, err := labels.ParseToRequirements(w.selector) if err != nil { return nil, err } selector = selector.Add(reqs...) - lo, err := w.client.PolicycontrollerV1alpha1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ + lo, err := w.client.PolicyV1alpha1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ LabelSelector: selector.String(), // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. }) @@ -120,9 +120,9 @@ func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1a return ret, nil } -func (w *wrapper) Get(name string) (*apispolicycontrollerv1alpha1.ClusterImagePolicy, error) { +func (w *wrapper) Get(name string) (*apispolicyv1alpha1.ClusterImagePolicy, error) { // TODO(mattmoor): Check that the fetched object matches the selector. - return w.client.PolicycontrollerV1alpha1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ + return w.client.PolicyV1alpha1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. }) } diff --git a/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/fake/fake.go b/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/filtered/fake/fake.go similarity index 92% rename from pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/fake/fake.go rename to pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/filtered/fake/fake.go index 631a62e80e8..501a7f46087 100644 --- a/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/fake/fake.go +++ b/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/filtered/fake/fake.go @@ -20,7 +20,7 @@ import ( context "context" factoryfiltered "github.com/sigstore/cosign/pkg/client/injection/informers/factory/filtered" - filtered "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered" + filtered "github.com/sigstore/cosign/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/filtered" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -42,7 +42,7 @@ func withInformer(ctx context.Context) (context.Context, []controller.Informer) infs := []controller.Informer{} for _, selector := range labelSelectors { f := factoryfiltered.Get(ctx, selector) - inf := f.Policycontroller().V1beta1().ClusterImagePolicies() + inf := f.Policy().V1alpha1().ClusterImagePolicies() ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) infs = append(infs, inf.Informer()) } diff --git a/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/clusterimagepolicy.go b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/clusterimagepolicy.go similarity index 75% rename from pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/clusterimagepolicy.go rename to pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/clusterimagepolicy.go index 418700dc7dc..abccbbbaaff 100644 --- a/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/clusterimagepolicy.go @@ -19,12 +19,12 @@ package clusterimagepolicy import ( context "context" - apispolicycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + apispolicyv1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1beta1" client "github.com/sigstore/cosign/pkg/client/injection/client" factory "github.com/sigstore/cosign/pkg/client/injection/informers/factory" - policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1beta1" + policyv1beta1 "github.com/sigstore/cosign/pkg/client/listers/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" cache "k8s.io/client-go/tools/cache" @@ -43,7 +43,7 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Policycontroller().V1beta1().ClusterImagePolicies() + inf := f.Policy().V1beta1().ClusterImagePolicies() return context.WithValue(ctx, Key{}, inf), inf.Informer() } @@ -57,7 +57,7 @@ func Get(ctx context.Context) v1beta1.ClusterImagePolicyInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1.ClusterImagePolicyInformer from context.") + "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1beta1.ClusterImagePolicyInformer from context.") } return untyped.(v1beta1.ClusterImagePolicyInformer) } @@ -69,13 +69,13 @@ type wrapper struct { } var _ v1beta1.ClusterImagePolicyInformer = (*wrapper)(nil) -var _ policycontrollerv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policyv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispolicycontrollerv1beta1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicyv1beta1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() policycontrollerv1beta1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policyv1beta1.ClusterImagePolicyLister { return w } @@ -87,8 +87,8 @@ func (w *wrapper) SetResourceVersion(resourceVersion string) { w.resourceVersion = resourceVersion } -func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1beta1.ClusterImagePolicy, err error) { - lo, err := w.client.PolicycontrollerV1beta1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ +func (w *wrapper) List(selector labels.Selector) (ret []*apispolicyv1beta1.ClusterImagePolicy, err error) { + lo, err := w.client.PolicyV1beta1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ LabelSelector: selector.String(), ResourceVersion: w.resourceVersion, }) @@ -101,8 +101,8 @@ func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1b return ret, nil } -func (w *wrapper) Get(name string) (*apispolicycontrollerv1beta1.ClusterImagePolicy, error) { - return w.client.PolicycontrollerV1beta1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ +func (w *wrapper) Get(name string) (*apispolicyv1beta1.ClusterImagePolicy, error) { + return w.client.PolicyV1beta1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ ResourceVersion: w.resourceVersion, }) } diff --git a/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/fake/fake.go b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/fake/fake.go similarity index 90% rename from pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/fake/fake.go rename to pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/fake/fake.go index 1f31e71ef44..34d20f5917e 100644 --- a/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/fake/fake.go +++ b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/fake/fake.go @@ -20,7 +20,7 @@ import ( context "context" fake "github.com/sigstore/cosign/pkg/client/injection/informers/factory/fake" - clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy" + clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -33,6 +33,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Policycontroller().V1alpha1().ClusterImagePolicies() + inf := f.Policy().V1beta1().ClusterImagePolicies() return context.WithValue(ctx, clusterimagepolicy.Key{}, inf), inf.Informer() } diff --git a/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go similarity index 77% rename from pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go rename to pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go index 2c177e71c9a..a620e1d5c41 100644 --- a/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go @@ -19,12 +19,12 @@ package filtered import ( context "context" - apispolicycontrollerv1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + apispolicyv1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1beta1" client "github.com/sigstore/cosign/pkg/client/injection/client" filtered "github.com/sigstore/cosign/pkg/client/injection/informers/factory/filtered" - policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1beta1" + policyv1beta1 "github.com/sigstore/cosign/pkg/client/listers/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" cache "k8s.io/client-go/tools/cache" @@ -53,7 +53,7 @@ func withInformer(ctx context.Context) (context.Context, []controller.Informer) infs := []controller.Informer{} for _, selector := range labelSelectors { f := filtered.Get(ctx, selector) - inf := f.Policycontroller().V1beta1().ClusterImagePolicies() + inf := f.Policy().V1beta1().ClusterImagePolicies() ctx = context.WithValue(ctx, Key{Selector: selector}, inf) infs = append(infs, inf.Informer()) } @@ -79,7 +79,7 @@ func Get(ctx context.Context, selector string) v1beta1.ClusterImagePolicyInforme untyped := ctx.Value(Key{Selector: selector}) if untyped == nil { logging.FromContext(ctx).Panicf( - "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policycontroller/v1beta1.ClusterImagePolicyInformer with selector %s from context.", selector) + "Unable to fetch github.com/sigstore/cosign/pkg/client/informers/externalversions/policy/v1beta1.ClusterImagePolicyInformer with selector %s from context.", selector) } return untyped.(v1beta1.ClusterImagePolicyInformer) } @@ -91,23 +91,23 @@ type wrapper struct { } var _ v1beta1.ClusterImagePolicyInformer = (*wrapper)(nil) -var _ policycontrollerv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policyv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apispolicycontrollerv1beta1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicyv1beta1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() policycontrollerv1beta1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policyv1beta1.ClusterImagePolicyLister { return w } -func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1beta1.ClusterImagePolicy, err error) { +func (w *wrapper) List(selector labels.Selector) (ret []*apispolicyv1beta1.ClusterImagePolicy, err error) { reqs, err := labels.ParseToRequirements(w.selector) if err != nil { return nil, err } selector = selector.Add(reqs...) - lo, err := w.client.PolicycontrollerV1beta1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ + lo, err := w.client.PolicyV1beta1().ClusterImagePolicies().List(context.TODO(), v1.ListOptions{ LabelSelector: selector.String(), // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. }) @@ -120,9 +120,9 @@ func (w *wrapper) List(selector labels.Selector) (ret []*apispolicycontrollerv1b return ret, nil } -func (w *wrapper) Get(name string) (*apispolicycontrollerv1beta1.ClusterImagePolicy, error) { +func (w *wrapper) Get(name string) (*apispolicyv1beta1.ClusterImagePolicy, error) { // TODO(mattmoor): Check that the fetched object matches the selector. - return w.client.PolicycontrollerV1beta1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ + return w.client.PolicyV1beta1().ClusterImagePolicies().Get(context.TODO(), name, v1.GetOptions{ // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria. }) } diff --git a/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/fake/fake.go b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/filtered/fake/fake.go similarity index 92% rename from pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/fake/fake.go rename to pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/filtered/fake/fake.go index 18467dd5a8f..45d4c791f5a 100644 --- a/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered/fake/fake.go +++ b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/filtered/fake/fake.go @@ -20,7 +20,7 @@ import ( context "context" factoryfiltered "github.com/sigstore/cosign/pkg/client/injection/informers/factory/filtered" - filtered "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/filtered" + filtered "github.com/sigstore/cosign/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/filtered" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" logging "knative.dev/pkg/logging" @@ -42,7 +42,7 @@ func withInformer(ctx context.Context) (context.Context, []controller.Informer) infs := []controller.Informer{} for _, selector := range labelSelectors { f := factoryfiltered.Get(ctx, selector) - inf := f.Policycontroller().V1alpha1().ClusterImagePolicies() + inf := f.Policy().V1beta1().ClusterImagePolicies() ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf) infs = append(infs, inf.Informer()) } diff --git a/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/controller.go b/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/controller.go similarity index 95% rename from pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/controller.go rename to pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/controller.go index 8a61f951722..1a0cb911281 100644 --- a/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/controller.go +++ b/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/controller.go @@ -24,7 +24,7 @@ import ( versionedscheme "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" client "github.com/sigstore/cosign/pkg/client/injection/client" - clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1beta1/clusterimagepolicy" + clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy" zap "go.uber.org/zap" corev1 "k8s.io/api/core/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -42,7 +42,7 @@ import ( const ( defaultControllerAgentName = "clusterimagepolicy-controller" - defaultFinalizerName = "clusterimagepolicies.policycontroller.sigstore.dev" + defaultFinalizerName = "clusterimagepolicies.policy.sigstore.dev" ) // NewImpl returns a controller.Impl that handles queuing and feeding work from @@ -96,7 +96,7 @@ func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsF logger = logger.With( zap.String(logkey.ControllerType, ctrTypeName), - zap.String(logkey.Kind, "policycontroller.sigstore.dev.ClusterImagePolicy"), + zap.String(logkey.Kind, "policy.sigstore.dev.ClusterImagePolicy"), ) impl := controller.NewContext(ctx, rec, controller.ControllerOptions{WorkQueueName: ctrTypeName, Logger: logger}) diff --git a/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/reconciler.go b/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/reconciler.go similarity index 96% rename from pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/reconciler.go rename to pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/reconciler.go index 8972125277e..f79846ab738 100644 --- a/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/reconciler.go +++ b/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/reconciler.go @@ -21,9 +21,9 @@ import ( json "encoding/json" fmt "fmt" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - policycontrollerv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" + policyv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/policy/v1alpha1" zap "go.uber.org/zap" v1 "k8s.io/api/core/v1" errors "k8s.io/apimachinery/pkg/api/errors" @@ -80,7 +80,7 @@ type reconcilerImpl struct { Client versioned.Interface // Listers index properties about resources. - Lister policycontrollerv1alpha1.ClusterImagePolicyLister + Lister policyv1alpha1.ClusterImagePolicyLister // Recorder is an event recorder for recording Event resources to the // Kubernetes API. @@ -103,7 +103,7 @@ var _ controller.Reconciler = (*reconcilerImpl)(nil) // Check that our generated Reconciler is always LeaderAware. var _ reconciler.LeaderAware = (*reconcilerImpl)(nil) -func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister policycontrollerv1alpha1.ClusterImagePolicyLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler { +func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister policyv1alpha1.ClusterImagePolicyLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler { // Check the options function input. It should be 0 or 1. if len(options) > 1 { logger.Fatal("Up to one options struct is supported, found: ", len(options)) @@ -316,7 +316,7 @@ func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource return resource, err } - patcher := r.Client.PolicycontrollerV1alpha1().ClusterImagePolicies() + patcher := r.Client.PolicyV1alpha1().ClusterImagePolicies() resourceName := resource.Name updated, err := patcher.Patch(ctx, resourceName, types.MergePatchType, patch, metav1.PatchOptions{}) diff --git a/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/state.go b/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/state.go similarity index 97% rename from pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/state.go rename to pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/state.go index d1eeb4479c8..d55dc2a2f6a 100644 --- a/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/state.go +++ b/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/state.go @@ -19,7 +19,7 @@ package clusterimagepolicy import ( fmt "fmt" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" types "k8s.io/apimachinery/pkg/types" cache "k8s.io/client-go/tools/cache" reconciler "knative.dev/pkg/reconciler" diff --git a/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/controller.go b/pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/controller.go similarity index 95% rename from pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/controller.go rename to pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/controller.go index b169ac26c05..127446ba9f8 100644 --- a/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy/controller.go +++ b/pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/controller.go @@ -24,7 +24,7 @@ import ( versionedscheme "github.com/sigstore/cosign/pkg/client/clientset/versioned/scheme" client "github.com/sigstore/cosign/pkg/client/injection/client" - clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy" + clusterimagepolicy "github.com/sigstore/cosign/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy" zap "go.uber.org/zap" corev1 "k8s.io/api/core/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -42,7 +42,7 @@ import ( const ( defaultControllerAgentName = "clusterimagepolicy-controller" - defaultFinalizerName = "clusterimagepolicies.policycontroller.sigstore.dev" + defaultFinalizerName = "clusterimagepolicies.policy.sigstore.dev" ) // NewImpl returns a controller.Impl that handles queuing and feeding work from @@ -96,7 +96,7 @@ func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsF logger = logger.With( zap.String(logkey.ControllerType, ctrTypeName), - zap.String(logkey.Kind, "policycontroller.sigstore.dev.ClusterImagePolicy"), + zap.String(logkey.Kind, "policy.sigstore.dev.ClusterImagePolicy"), ) impl := controller.NewContext(ctx, rec, controller.ControllerOptions{WorkQueueName: ctrTypeName, Logger: logger}) diff --git a/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/reconciler.go b/pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/reconciler.go similarity index 96% rename from pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/reconciler.go rename to pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/reconciler.go index 50192a870f5..38a5f020a0c 100644 --- a/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/reconciler.go +++ b/pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/reconciler.go @@ -21,9 +21,9 @@ import ( json "encoding/json" fmt "fmt" - v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - policycontrollerv1beta1 "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1beta1" + policyv1beta1 "github.com/sigstore/cosign/pkg/client/listers/policy/v1beta1" zap "go.uber.org/zap" v1 "k8s.io/api/core/v1" errors "k8s.io/apimachinery/pkg/api/errors" @@ -80,7 +80,7 @@ type reconcilerImpl struct { Client versioned.Interface // Listers index properties about resources. - Lister policycontrollerv1beta1.ClusterImagePolicyLister + Lister policyv1beta1.ClusterImagePolicyLister // Recorder is an event recorder for recording Event resources to the // Kubernetes API. @@ -103,7 +103,7 @@ var _ controller.Reconciler = (*reconcilerImpl)(nil) // Check that our generated Reconciler is always LeaderAware. var _ reconciler.LeaderAware = (*reconcilerImpl)(nil) -func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister policycontrollerv1beta1.ClusterImagePolicyLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler { +func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister policyv1beta1.ClusterImagePolicyLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler { // Check the options function input. It should be 0 or 1. if len(options) > 1 { logger.Fatal("Up to one options struct is supported, found: ", len(options)) @@ -316,7 +316,7 @@ func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource return resource, err } - patcher := r.Client.PolicycontrollerV1beta1().ClusterImagePolicies() + patcher := r.Client.PolicyV1beta1().ClusterImagePolicies() resourceName := resource.Name updated, err := patcher.Patch(ctx, resourceName, types.MergePatchType, patch, metav1.PatchOptions{}) diff --git a/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/state.go b/pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/state.go similarity index 97% rename from pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/state.go rename to pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/state.go index f616c8432de..730c9309a15 100644 --- a/pkg/client/injection/reconciler/policycontroller/v1beta1/clusterimagepolicy/state.go +++ b/pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/state.go @@ -19,7 +19,7 @@ package clusterimagepolicy import ( fmt "fmt" - v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" types "k8s.io/apimachinery/pkg/types" cache "k8s.io/client-go/tools/cache" reconciler "knative.dev/pkg/reconciler" diff --git a/pkg/client/listers/policycontroller/v1alpha1/clusterimagepolicy.go b/pkg/client/listers/policy/v1alpha1/clusterimagepolicy.go similarity index 97% rename from pkg/client/listers/policycontroller/v1alpha1/clusterimagepolicy.go rename to pkg/client/listers/policy/v1alpha1/clusterimagepolicy.go index 5eb7e9a0ec5..6323417d5be 100644 --- a/pkg/client/listers/policycontroller/v1alpha1/clusterimagepolicy.go +++ b/pkg/client/listers/policy/v1alpha1/clusterimagepolicy.go @@ -17,7 +17,7 @@ package v1alpha1 import ( - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/policycontroller/v1alpha1/expansion_generated.go b/pkg/client/listers/policy/v1alpha1/expansion_generated.go similarity index 100% rename from pkg/client/listers/policycontroller/v1alpha1/expansion_generated.go rename to pkg/client/listers/policy/v1alpha1/expansion_generated.go diff --git a/pkg/client/listers/policycontroller/v1beta1/clusterimagepolicy.go b/pkg/client/listers/policy/v1beta1/clusterimagepolicy.go similarity index 97% rename from pkg/client/listers/policycontroller/v1beta1/clusterimagepolicy.go rename to pkg/client/listers/policy/v1beta1/clusterimagepolicy.go index a44ce329efb..5fc7517a635 100644 --- a/pkg/client/listers/policycontroller/v1beta1/clusterimagepolicy.go +++ b/pkg/client/listers/policy/v1beta1/clusterimagepolicy.go @@ -17,7 +17,7 @@ package v1beta1 import ( - v1beta1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/policycontroller/v1beta1/expansion_generated.go b/pkg/client/listers/policy/v1beta1/expansion_generated.go similarity index 100% rename from pkg/client/listers/policycontroller/v1beta1/expansion_generated.go rename to pkg/client/listers/policy/v1beta1/expansion_generated.go diff --git a/pkg/cosign/kubernetes/webhook/clusterimagepolicy/clusterimagepolicy_types.go b/pkg/cosign/kubernetes/webhook/clusterimagepolicy/clusterimagepolicy_types.go index c5c41bace7c..dfe2b092fa7 100644 --- a/pkg/cosign/kubernetes/webhook/clusterimagepolicy/clusterimagepolicy_types.go +++ b/pkg/cosign/kubernetes/webhook/clusterimagepolicy/clusterimagepolicy_types.go @@ -25,7 +25,7 @@ import ( "github.com/google/go-containerregistry/pkg/authn/k8schain" "github.com/google/go-containerregistry/pkg/name" "github.com/google/go-containerregistry/pkg/v1/remote" - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" ociremote "github.com/sigstore/cosign/pkg/oci/remote" "knative.dev/pkg/apis" kubeclient "knative.dev/pkg/client/injection/kube/client" diff --git a/pkg/cosign/kubernetes/webhook/validation.go b/pkg/cosign/kubernetes/webhook/validation.go index 0e3b42de637..15dbb9f9fa2 100644 --- a/pkg/cosign/kubernetes/webhook/validation.go +++ b/pkg/cosign/kubernetes/webhook/validation.go @@ -28,7 +28,7 @@ import ( "knative.dev/pkg/logging" "github.com/sigstore/cosign/cmd/cosign/cli/fulcio/fulcioroots" - v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" "github.com/sigstore/cosign/pkg/cosign" "github.com/sigstore/cosign/pkg/oci" ociremote "github.com/sigstore/cosign/pkg/oci/remote" diff --git a/pkg/cosign/kubernetes/webhook/validator_test.go b/pkg/cosign/kubernetes/webhook/validator_test.go index 8f73fc783d2..76ebbecdaa5 100644 --- a/pkg/cosign/kubernetes/webhook/validator_test.go +++ b/pkg/cosign/kubernetes/webhook/validator_test.go @@ -35,7 +35,7 @@ import ( "github.com/google/go-containerregistry/pkg/authn/k8schain" "github.com/google/go-containerregistry/pkg/name" "github.com/sigstore/cosign/pkg/apis/config" - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" "github.com/sigstore/cosign/pkg/cosign" webhookcip "github.com/sigstore/cosign/pkg/cosign/kubernetes/webhook/clusterimagepolicy" "github.com/sigstore/cosign/pkg/oci" diff --git a/pkg/reconciler/clusterimagepolicy/clusterimagepolicy.go b/pkg/reconciler/clusterimagepolicy/clusterimagepolicy.go index a26c24927e5..72b501c90fe 100644 --- a/pkg/reconciler/clusterimagepolicy/clusterimagepolicy.go +++ b/pkg/reconciler/clusterimagepolicy/clusterimagepolicy.go @@ -21,9 +21,9 @@ import ( "strings" "github.com/sigstore/cosign/pkg/apis/config" - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" "github.com/sigstore/cosign/pkg/apis/utils" - clusterimagepolicyreconciler "github.com/sigstore/cosign/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy" + clusterimagepolicyreconciler "github.com/sigstore/cosign/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy" webhookcip "github.com/sigstore/cosign/pkg/cosign/kubernetes/webhook/clusterimagepolicy" "github.com/sigstore/cosign/pkg/reconciler/clusterimagepolicy/resources" diff --git a/pkg/reconciler/clusterimagepolicy/clusterimagepolicy_test.go b/pkg/reconciler/clusterimagepolicy/clusterimagepolicy_test.go index d95be2da9b8..b5f9c168b45 100644 --- a/pkg/reconciler/clusterimagepolicy/clusterimagepolicy_test.go +++ b/pkg/reconciler/clusterimagepolicy/clusterimagepolicy_test.go @@ -25,9 +25,9 @@ import ( logtesting "knative.dev/pkg/logging/testing" "github.com/sigstore/cosign/pkg/apis/config" - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" fakecosignclient "github.com/sigstore/cosign/pkg/client/injection/client/fake" - "github.com/sigstore/cosign/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy" + "github.com/sigstore/cosign/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/reconciler/clusterimagepolicy/controller.go b/pkg/reconciler/clusterimagepolicy/controller.go index 672300fcf92..57ae94f9958 100644 --- a/pkg/reconciler/clusterimagepolicy/controller.go +++ b/pkg/reconciler/clusterimagepolicy/controller.go @@ -32,15 +32,15 @@ import ( "knative.dev/pkg/system" "github.com/sigstore/cosign/pkg/apis/config" - clusterimagepolicyinformer "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy" - clusterimagepolicyreconciler "github.com/sigstore/cosign/pkg/client/injection/reconciler/policycontroller/v1alpha1/clusterimagepolicy" + clusterimagepolicyinformer "github.com/sigstore/cosign/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy" + clusterimagepolicyreconciler "github.com/sigstore/cosign/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy" cminformer "knative.dev/pkg/injection/clients/namespacedkube/informers/core/v1/configmap" secretinformer "knative.dev/pkg/injection/clients/namespacedkube/informers/core/v1/secret" ) // This is what the default finalizer name is, but make it explicit so we can // use it in tests as well. -const finalizerName = "clusterimagepolicies.policycontroller.sigstore.dev" +const finalizerName = "clusterimagepolicies.policy.sigstore.dev" // NewController creates a Reconciler and returns the result of NewImpl. func NewController( diff --git a/pkg/reconciler/clusterimagepolicy/controller_test.go b/pkg/reconciler/clusterimagepolicy/controller_test.go index 1d08ac77f4b..e4a4c2038c5 100644 --- a/pkg/reconciler/clusterimagepolicy/controller_test.go +++ b/pkg/reconciler/clusterimagepolicy/controller_test.go @@ -21,7 +21,7 @@ import ( rtesting "knative.dev/pkg/reconciler/testing" // Fake injection informers - _ "github.com/sigstore/cosign/pkg/client/injection/informers/policycontroller/v1alpha1/clusterimagepolicy/fake" + _ "github.com/sigstore/cosign/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/fake" _ "knative.dev/pkg/client/injection/kube/informers/core/v1/configmap/fake" _ "knative.dev/pkg/injection/clients/namespacedkube/informers/core/v1/configmap/fake" _ "knative.dev/pkg/injection/clients/namespacedkube/informers/core/v1/secret/fake" diff --git a/pkg/reconciler/testing/v1alpha1/clusterimagepolicy.go b/pkg/reconciler/testing/v1alpha1/clusterimagepolicy.go index b30ee409179..e2cd2242c5c 100644 --- a/pkg/reconciler/testing/v1alpha1/clusterimagepolicy.go +++ b/pkg/reconciler/testing/v1alpha1/clusterimagepolicy.go @@ -18,11 +18,11 @@ import ( "context" "time" - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -const finalizerName = "clusterimagepolicies.policycontroller.sigstore.dev" +const finalizerName = "clusterimagepolicies.policy.sigstore.dev" // ClusterImagePolicyOption enables further configuration of a ClusterImagePolicy. type ClusterImagePolicyOption func(*v1alpha1.ClusterImagePolicy) diff --git a/pkg/reconciler/testing/v1alpha1/listers.go b/pkg/reconciler/testing/v1alpha1/listers.go index 9d2a67c0d01..d08dece61a5 100644 --- a/pkg/reconciler/testing/v1alpha1/listers.go +++ b/pkg/reconciler/testing/v1alpha1/listers.go @@ -15,9 +15,9 @@ package testing import ( - "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" fakecosignclientset "github.com/sigstore/cosign/pkg/client/clientset/versioned/fake" - cosignlisters "github.com/sigstore/cosign/pkg/client/listers/policycontroller/v1alpha1" + cosignlisters "github.com/sigstore/cosign/pkg/client/listers/policy/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" fakekubeclientset "k8s.io/client-go/kubernetes/fake" diff --git a/test/e2e_test_cluster_image_policy.sh b/test/e2e_test_cluster_image_policy.sh index 9ed2f2c6671..a26925dbba1 100755 --- a/test/e2e_test_cluster_image_policy.sh +++ b/test/e2e_test_cluster_image_policy.sh @@ -126,7 +126,7 @@ echo '::endgroup::' echo '::group:: Create test namespace and label for verification' kubectl create namespace demo-keyless-signing -kubectl label namespace demo-keyless-signing policycontroller.sigstore.dev/include=true +kubectl label namespace demo-keyless-signing policy.sigstore.dev/include=true export NS=demo-keyless-signing echo '::endgroup::' @@ -196,7 +196,7 @@ echo '::endgroup::' echo '::group:: Create and label new namespace for verification' kubectl create namespace demo-key-signing -kubectl label namespace demo-key-signing policycontroller.sigstore.dev/include=true +kubectl label namespace demo-key-signing policy.sigstore.dev/include=true echo '::group:: Verify blocks unsigned with the key' if kubectl create -n demo-key-signing job demo --image=${demoimage}; then @@ -264,7 +264,7 @@ echo '::endgroup::' echo '::group:: Create test namespace and label for remote key verification' kubectl create namespace demo-key-remote -kubectl label namespace demo-key-remote policycontroller.sigstore.dev/include=true +kubectl label namespace demo-key-remote policy.sigstore.dev/include=true echo '::endgroup::' echo '::group:: Verify with three CIP, one without correct Source set' diff --git a/test/e2e_test_cluster_image_policy_with_attestations.sh b/test/e2e_test_cluster_image_policy_with_attestations.sh index d963c9b1e8f..c68d3413f03 100755 --- a/test/e2e_test_cluster_image_policy_with_attestations.sh +++ b/test/e2e_test_cluster_image_policy_with_attestations.sh @@ -97,7 +97,7 @@ echo '::endgroup::' echo '::group:: Create and label new namespace for verification' kubectl create namespace demo-attestations -kubectl label namespace demo-attestations policycontroller.sigstore.dev/include=true +kubectl label namespace demo-attestations policy.sigstore.dev/include=true export NS=demo-attestations echo '::endgroup::' diff --git a/test/e2e_test_policy_controller.sh b/test/e2e_test_policy_controller.sh index 8081a315b38..66a9f2c0bf2 100755 --- a/test/e2e_test_policy_controller.sh +++ b/test/e2e_test_policy_controller.sh @@ -92,7 +92,7 @@ echo '::endgroup::' echo '::group:: enable verification' -kubectl label namespace default --overwrite policycontroller.sigstore.dev/include=true +kubectl label namespace default --overwrite policy.sigstore.dev/include=true echo '::endgroup::' @@ -121,7 +121,7 @@ kubectl delete secret -n cosign-system verification-key kubectl create secret generic -n cosign-system verification-key --from-file=cosign.pub=manykeys.pem --from-literal=cosign.password=${COSIGN_PASSWORD} --from-file=cosign.key echo '::group:: disable verification' -kubectl label namespace default --overwrite policycontroller.sigstore.dev/include=false +kubectl label namespace default --overwrite policy.sigstore.dev/include=false echo '::endgroup::' @@ -157,7 +157,7 @@ fi echo '::endgroup::' echo '::group:: enable verification' -kubectl label namespace default --overwrite policycontroller.sigstore.dev/include=true +kubectl label namespace default --overwrite policy.sigstore.dev/include=true echo '::endgroup::' diff --git a/test/testdata/policy-controller/e2e/cip-key-with-attestations.yaml b/test/testdata/policy-controller/e2e/cip-key-with-attestations.yaml index df9ebdc60ff..5062b8d8505 100644 --- a/test/testdata/policy-controller/e2e/cip-key-with-attestations.yaml +++ b/test/testdata/policy-controller/e2e/cip-key-with-attestations.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-key-with-attestations diff --git a/test/testdata/policy-controller/e2e/cip-key.yaml b/test/testdata/policy-controller/e2e/cip-key.yaml index b18c6a2f9a5..b249970847c 100644 --- a/test/testdata/policy-controller/e2e/cip-key.yaml +++ b/test/testdata/policy-controller/e2e/cip-key.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-key diff --git a/test/testdata/policy-controller/e2e/cip-keyless-with-attestations.yaml b/test/testdata/policy-controller/e2e/cip-keyless-with-attestations.yaml index df0662318ea..1f47c0818b8 100644 --- a/test/testdata/policy-controller/e2e/cip-keyless-with-attestations.yaml +++ b/test/testdata/policy-controller/e2e/cip-keyless-with-attestations.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-keyless-with-attestations diff --git a/test/testdata/policy-controller/e2e/cip-keyless-with-identities-mismatch.yaml b/test/testdata/policy-controller/e2e/cip-keyless-with-identities-mismatch.yaml index 5b09009a4a9..ad4e978ea43 100644 --- a/test/testdata/policy-controller/e2e/cip-keyless-with-identities-mismatch.yaml +++ b/test/testdata/policy-controller/e2e/cip-keyless-with-identities-mismatch.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-keyless-with-identities-mismatch diff --git a/test/testdata/policy-controller/e2e/cip-keyless-with-identities.yaml b/test/testdata/policy-controller/e2e/cip-keyless-with-identities.yaml index 9bbf03862d5..f09c33ab9d5 100644 --- a/test/testdata/policy-controller/e2e/cip-keyless-with-identities.yaml +++ b/test/testdata/policy-controller/e2e/cip-keyless-with-identities.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-keyless-with-identities diff --git a/test/testdata/policy-controller/e2e/cip-keyless.yaml b/test/testdata/policy-controller/e2e/cip-keyless.yaml index db4eaaa9636..a6da330fb8f 100644 --- a/test/testdata/policy-controller/e2e/cip-keyless.yaml +++ b/test/testdata/policy-controller/e2e/cip-keyless.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-keyless diff --git a/test/testdata/policy-controller/e2e/cip-requires-two-signatures-and-two-attestations.yaml b/test/testdata/policy-controller/e2e/cip-requires-two-signatures-and-two-attestations.yaml index e6fc6565ad0..092c9a3c7ad 100644 --- a/test/testdata/policy-controller/e2e/cip-requires-two-signatures-and-two-attestations.yaml +++ b/test/testdata/policy-controller/e2e/cip-requires-two-signatures-and-two-attestations.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy-requires-two-signatures-two-attestations diff --git a/test/testdata/policy-controller/invalid/empty-keyless-ref.yaml b/test/testdata/policy-controller/invalid/empty-keyless-ref.yaml index b6ddf6eb166..1eaaed0820c 100644 --- a/test/testdata/policy-controller/invalid/empty-keyless-ref.yaml +++ b/test/testdata/policy-controller/invalid/empty-keyless-ref.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/empty-keyref-and-keylessref.yaml b/test/testdata/policy-controller/invalid/empty-keyref-and-keylessref.yaml index 4811f480deb..f73286c9efb 100644 --- a/test/testdata/policy-controller/invalid/empty-keyref-and-keylessref.yaml +++ b/test/testdata/policy-controller/invalid/empty-keyref-and-keylessref.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/empty-keyref.yaml b/test/testdata/policy-controller/invalid/empty-keyref.yaml index 1dc58187427..7e8f3639dff 100644 --- a/test/testdata/policy-controller/invalid/empty-keyref.yaml +++ b/test/testdata/policy-controller/invalid/empty-keyref.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/invalid-glob.yaml b/test/testdata/policy-controller/invalid/invalid-glob.yaml index 828860e7b75..2caf5a6513e 100644 --- a/test/testdata/policy-controller/invalid/invalid-glob.yaml +++ b/test/testdata/policy-controller/invalid/invalid-glob.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/invalid-pubkey.yaml b/test/testdata/policy-controller/invalid/invalid-pubkey.yaml index 2f0e1ef042f..cabf6aeb321 100644 --- a/test/testdata/policy-controller/invalid/invalid-pubkey.yaml +++ b/test/testdata/policy-controller/invalid/invalid-pubkey.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/keylessref-with-empty-authorities.yaml b/test/testdata/policy-controller/invalid/keylessref-with-empty-authorities.yaml index 0eeb04689ce..9c79ad1bdfb 100644 --- a/test/testdata/policy-controller/invalid/keylessref-with-empty-authorities.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-empty-authorities.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/keylessref-with-empty-identities.yaml b/test/testdata/policy-controller/invalid/keylessref-with-empty-identities.yaml index c7ea53edec5..9942662479e 100644 --- a/test/testdata/policy-controller/invalid/keylessref-with-empty-identities.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-empty-identities.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/keylessref-with-malformed-issuer.yaml b/test/testdata/policy-controller/invalid/keylessref-with-malformed-issuer.yaml index 272e93a67be..574bea63e06 100644 --- a/test/testdata/policy-controller/invalid/keylessref-with-malformed-issuer.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-malformed-issuer.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/keylessref-with-malformed-subject.yaml b/test/testdata/policy-controller/invalid/keylessref-with-malformed-subject.yaml index 8c16f48e2f8..d0f0862d452 100644 --- a/test/testdata/policy-controller/invalid/keylessref-with-malformed-subject.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-malformed-subject.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/keylessref-with-multiple-properties.yaml b/test/testdata/policy-controller/invalid/keylessref-with-multiple-properties.yaml index 63f024d1214..030f5b7912a 100644 --- a/test/testdata/policy-controller/invalid/keylessref-with-multiple-properties.yaml +++ b/test/testdata/policy-controller/invalid/keylessref-with-multiple-properties.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/keyref-with-multiple-properties.yaml b/test/testdata/policy-controller/invalid/keyref-with-multiple-properties.yaml index 89032ab4a09..45b4c2c1509 100644 --- a/test/testdata/policy-controller/invalid/keyref-with-multiple-properties.yaml +++ b/test/testdata/policy-controller/invalid/keyref-with-multiple-properties.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/invalid/valid-keyref-and-keylessref.yaml b/test/testdata/policy-controller/invalid/valid-keyref-and-keylessref.yaml index e0dd35da9e8..eb51b7708a2 100644 --- a/test/testdata/policy-controller/invalid/valid-keyref-and-keylessref.yaml +++ b/test/testdata/policy-controller/invalid/valid-keyref-and-keylessref.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/valid/valid-policy-glob.yaml b/test/testdata/policy-controller/valid/valid-policy-glob.yaml index 26d01bbe25a..798e7f8af80 100644 --- a/test/testdata/policy-controller/valid/valid-policy-glob.yaml +++ b/test/testdata/policy-controller/valid/valid-policy-glob.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy diff --git a/test/testdata/policy-controller/valid/valid-policy.yaml b/test/testdata/policy-controller/valid/valid-policy.yaml index 5cb46ea3d56..ab1a74e657d 100644 --- a/test/testdata/policy-controller/valid/valid-policy.yaml +++ b/test/testdata/policy-controller/valid/valid-policy.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -apiVersion: policycontroller.sigstore.dev/v1alpha1 +apiVersion: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy