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..ac848748561 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/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-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..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: @@ -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 @@ -121,9 +121,9 @@ jobs: run: | ./test/e2e_test_policy_crd.sh - - name: Run Cosigned Tests + - name: Run Policy Controller 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/cmd/cosign/policy_webhook/main.go b/cmd/cosign/policy_webhook/main.go index 72fbbd7924a..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/cosigned" - "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" - "github.com/sigstore/cosign/pkg/apis/cosigned/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 @@ -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: 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 e75f8d75de0..6de012148a6 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", "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{ @@ -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..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/cosigned/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 96366cdd611..8fcf2831b6f 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" + policy.sigstore.dev/include: "false" diff --git a/config/200-clusterrole.yaml b/config/200-clusterrole.yaml index 536a8f25a15..8be91935de4 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: ["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.cosigned.sigstore.dev"] + resourceNames: ["clusterimagepolicies.policy.sigstore.dev"] # Allow reconciliation of the ClusterImagePolic CRDs. - - apiGroups: ["cosigned.sigstore.dev"] + - apiGroups: ["policy.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..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.cosigned.sigstore.dev + name: clusterimagepolicies.policy.sigstore.dev spec: - group: cosigned.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 ba067a61e15..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: cosigned.sigstore.dev + name: policy.sigstore.dev webhooks: -- name: cosigned.sigstore.dev +- name: policy.sigstore.dev namespaceSelector: # The webhook should only apply to things that opt-in matchExpressions: - - key: cosigned.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: cosigned.sigstore.dev + name: policy.sigstore.dev webhooks: -- name: cosigned.sigstore.dev +- name: policy.sigstore.dev namespaceSelector: # The webhook should only apply to things that opt-in matchExpressions: - - key: cosigned.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 1aa59ca9e9a..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/cosigned + value: sigstore.dev/policy - name: WEBHOOK_NAME value: policy-webhook diff --git a/config/webhook.yaml b/config/webhook.yaml index f15504b2de2..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/cosigned + 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 323c687c204..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 \ - "cosigned:v1alpha1 cosigned: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 \ - "cosigned:v1alpha1 cosigned: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 3fa056e86b8..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: - cosigned.sigstore.dev/release: devel + policy.sigstore.dev/release: devel data: _example: | diff --git a/pkg/apis/cosigned/register.go b/pkg/apis/policy/register.go similarity index 94% rename from pkg/apis/cosigned/register.go rename to pkg/apis/policy/register.go index c4f2dcf5567..17b92b201a6 100644 --- a/pkg/apis/cosigned/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 cosigned +package policy import "k8s.io/apimachinery/pkg/runtime/schema" const ( // GroupName is the name of the API group. - GroupName = "cosigned.sigstore.dev" + GroupName = "policy.sigstore.dev" ) var ( diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_conversion.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion.go similarity index 99% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_conversion.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion.go index 18ff95216eb..f390066772d 100644 --- a/pkg/apis/cosigned/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/cosigned/v1beta1" + "github.com/sigstore/cosign/pkg/apis/policy/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/policy/v1alpha1/clusterimagepolicy_conversion_test.go similarity index 98% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_conversion_test.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion_test.go index 775730d2dcb..80f950dfc10 100644 --- a/pkg/apis/cosigned/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/cosigned/v1beta1" + "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" ) // Test v1alpha1 -> v1beta1 -> v1alpha1 diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_defaults.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_defaults.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_defaults.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_defaults.go diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_defaults_test.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_defaults_test.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_defaults_test.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_defaults_test.go diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_types.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_types.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_types.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_types.go diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_validation.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_validation.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_validation.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_validation.go diff --git a/pkg/apis/cosigned/v1alpha1/clusterimagepolicy_validation_test.go b/pkg/apis/policy/v1alpha1/clusterimagepolicy_validation_test.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/clusterimagepolicy_validation_test.go rename to pkg/apis/policy/v1alpha1/clusterimagepolicy_validation_test.go diff --git a/pkg/apis/cosigned/v1alpha1/doc.go b/pkg/apis/policy/v1alpha1/doc.go similarity index 94% rename from pkg/apis/cosigned/v1alpha1/doc.go rename to pkg/apis/policy/v1alpha1/doc.go index db76518485c..253e048cc81 100644 --- a/pkg/apis/cosigned/v1alpha1/doc.go +++ b/pkg/apis/policy/v1alpha1/doc.go @@ -13,5 +13,5 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +groupName=cosigned.sigstore.dev +// +groupName=policy.sigstore.dev package v1alpha1 diff --git a/pkg/apis/cosigned/v1alpha1/register.go b/pkg/apis/policy/v1alpha1/register.go similarity index 92% rename from pkg/apis/cosigned/v1alpha1/register.go rename to pkg/apis/policy/v1alpha1/register.go index baa765853b0..fa2d638a098 100644 --- a/pkg/apis/cosigned/v1alpha1/register.go +++ b/pkg/apis/policy/v1alpha1/register.go @@ -15,7 +15,7 @@ package v1alpha1 import ( - "github.com/sigstore/cosign/pkg/apis/cosigned" + 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: cosigned.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/cosigned/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/cosigned/v1alpha1/zz_generated.deepcopy.go rename to pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_conversion.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_conversion.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_conversion.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_conversion.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_conversion_test.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_conversion_test.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_conversion_test.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_conversion_test.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_defaults.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_defaults.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_defaults.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_defaults.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_defaults_test.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_defaults_test.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_defaults_test.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_defaults_test.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_types.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_types.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_types.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_types.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_validation.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_validation.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_validation.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_validation.go diff --git a/pkg/apis/cosigned/v1beta1/clusterimagepolicy_validation_test.go b/pkg/apis/policy/v1beta1/clusterimagepolicy_validation_test.go similarity index 100% rename from pkg/apis/cosigned/v1beta1/clusterimagepolicy_validation_test.go rename to pkg/apis/policy/v1beta1/clusterimagepolicy_validation_test.go diff --git a/pkg/apis/cosigned/v1beta1/doc.go b/pkg/apis/policy/v1beta1/doc.go similarity index 94% rename from pkg/apis/cosigned/v1beta1/doc.go rename to pkg/apis/policy/v1beta1/doc.go index 56d342553c7..929ce54bba2 100644 --- a/pkg/apis/cosigned/v1beta1/doc.go +++ b/pkg/apis/policy/v1beta1/doc.go @@ -13,5 +13,5 @@ // limitations under the License. // +k8s:deepcopy-gen=package -// +groupName=cosigned.sigstore.dev +// +groupName=policy.sigstore.dev package v1beta1 diff --git a/pkg/apis/cosigned/v1beta1/register.go b/pkg/apis/policy/v1beta1/register.go similarity index 92% rename from pkg/apis/cosigned/v1beta1/register.go rename to pkg/apis/policy/v1beta1/register.go index 8dfb06ec6d1..e356f8826c7 100644 --- a/pkg/apis/cosigned/v1beta1/register.go +++ b/pkg/apis/policy/v1beta1/register.go @@ -15,7 +15,7 @@ package v1beta1 import ( - "github.com/sigstore/cosign/pkg/apis/cosigned" + 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: cosigned.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/cosigned/v1beta1/zz_generated.deepcopy.go b/pkg/apis/policy/v1beta1/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/cosigned/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 e023fa11ed2..7742a57c450 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" + 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 - CosignedV1alpha1() cosignedv1alpha1.CosignedV1alpha1Interface - CosignedV1beta1() cosignedv1beta1.CosignedV1beta1Interface + 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 - cosignedV1alpha1 *cosignedv1alpha1.CosignedV1alpha1Client - cosignedV1beta1 *cosignedv1beta1.CosignedV1beta1Client + policyV1alpha1 *policyv1alpha1.PolicyV1alpha1Client + policyV1beta1 *policyv1beta1.PolicyV1beta1Client } -// CosignedV1alpha1 retrieves the CosignedV1alpha1Client -func (c *Clientset) CosignedV1alpha1() cosignedv1alpha1.CosignedV1alpha1Interface { - return c.cosignedV1alpha1 +// PolicyV1alpha1 retrieves the PolicyV1alpha1Client +func (c *Clientset) PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface { + return c.policyV1alpha1 } -// CosignedV1beta1 retrieves the CosignedV1beta1Client -func (c *Clientset) CosignedV1beta1() cosignedv1beta1.CosignedV1beta1Interface { - return c.cosignedV1beta1 +// 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.cosignedV1alpha1, err = cosignedv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.policyV1alpha1, err = policyv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } - cs.cosignedV1beta1, err = cosignedv1beta1.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.cosignedV1alpha1 = cosignedv1alpha1.New(c) - cs.cosignedV1beta1 = cosignedv1beta1.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 19f931ae9b6..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" - 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" + 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{} ) -// CosignedV1alpha1 retrieves the CosignedV1alpha1Client -func (c *Clientset) CosignedV1alpha1() cosignedv1alpha1.CosignedV1alpha1Interface { - return &fakecosignedv1alpha1.FakeCosignedV1alpha1{Fake: &c.Fake} +// PolicyV1alpha1 retrieves the PolicyV1alpha1Client +func (c *Clientset) PolicyV1alpha1() policyv1alpha1.PolicyV1alpha1Interface { + return &fakepolicyv1alpha1.FakePolicyV1alpha1{Fake: &c.Fake} } -// CosignedV1beta1 retrieves the CosignedV1beta1Client -func (c *Clientset) CosignedV1beta1() cosignedv1beta1.CosignedV1beta1Interface { - return &fakecosignedv1beta1.FakeCosignedV1beta1{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 cd26fda450b..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 ( - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/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{ - cosignedv1alpha1.AddToScheme, - cosignedv1beta1.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 cfe12d5ee5f..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 ( - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/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{ - cosignedv1alpha1.AddToScheme, - cosignedv1beta1.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/cosigned/v1alpha1/clusterimagepolicy.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/clusterimagepolicy.go similarity index 97% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/clusterimagepolicy.go index ae8e6c7d8b0..bf5f6b52d44 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/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/cosigned/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 *CosignedV1alpha1Client) *clusterImagePolicies { +func newClusterImagePolicies(c *PolicyV1alpha1Client) *clusterImagePolicies { return &clusterImagePolicies{ client: c.RESTClient(), } diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/doc.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/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/cosigned/v1alpha1/fake/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/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/cosigned/v1alpha1/fake/fake_clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_clusterimagepolicy.go index 43f370cbdb4..92be94398b3 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/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/cosigned/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 *FakeCosignedV1alpha1 + Fake *FakePolicyV1alpha1 } -var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "cosigned.sigstore.dev", Version: "v1alpha1", Resource: "clusterimagepolicies"} +var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "policy.sigstore.dev", Version: "v1alpha1", Resource: "clusterimagepolicies"} -var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "cosigned.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/cosigned/v1alpha1/fake/fake_cosigned_client.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go similarity index 82% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/fake_cosigned_client.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go index 77a953449a8..a9f0c553bbe 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/fake/fake_cosigned_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/cosigned/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 FakeCosignedV1alpha1 struct { +type FakePolicyV1alpha1 struct { *testing.Fake } -func (c *FakeCosignedV1alpha1) 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 *FakeCosignedV1alpha1) RESTClient() rest.Interface { +func (c *FakePolicyV1alpha1) 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/policy/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/policy/v1alpha1/generated_expansion.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/cosigned_client.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/policy_client.go similarity index 66% rename from pkg/client/clientset/versioned/typed/cosigned/v1alpha1/cosigned_client.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/policy_client.go index bf26d015cc2..198ccf26273 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1alpha1/cosigned_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/cosigned/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 CosignedV1alpha1Interface interface { +type PolicyV1alpha1Interface interface { RESTClient() rest.Interface ClusterImagePoliciesGetter } -// CosignedV1alpha1Client is used to interact with features provided by the cosigned.sigstore.dev group. -type CosignedV1alpha1Client struct { +// PolicyV1alpha1Client is used to interact with features provided by the policy.sigstore.dev group. +type PolicyV1alpha1Client struct { restClient rest.Interface } -func (c *CosignedV1alpha1Client) ClusterImagePolicies() ClusterImagePolicyInterface { +func (c *PolicyV1alpha1Client) ClusterImagePolicies() ClusterImagePolicyInterface { return newClusterImagePolicies(c) } -// NewForConfig creates a new CosignedV1alpha1Client 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) (*CosignedV1alpha1Client, 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) (*CosignedV1alpha1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new CosignedV1alpha1Client 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) (*CosignedV1alpha1Client, 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) (*CosignedV1alpha1Cli if err != nil { return nil, err } - return &CosignedV1alpha1Client{client}, nil + return &PolicyV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new CosignedV1alpha1Client 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) *CosignedV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *PolicyV1alpha1Client { 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 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 *CosignedV1alpha1Client) RESTClient() rest.Interface { +func (c *PolicyV1alpha1Client) 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/policy/v1beta1/clusterimagepolicy.go similarity index 97% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/clusterimagepolicy.go index 82e50d66f2e..195c55b8989 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/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/cosigned/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 *CosignedV1beta1Client) *clusterImagePolicies { +func newClusterImagePolicies(c *PolicyV1beta1Client) *clusterImagePolicies { return &clusterImagePolicies{ client: c.RESTClient(), } diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/doc.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/doc.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/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/cosigned/v1beta1/fake/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/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/cosigned/v1beta1/fake/fake_clusterimagepolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/fake/fake_clusterimagepolicy.go index 9120290357a..74a35bde229 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/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/cosigned/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 *FakeCosignedV1beta1 + Fake *FakePolicyV1beta1 } -var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "cosigned.sigstore.dev", Version: "v1beta1", Resource: "clusterimagepolicies"} +var clusterimagepoliciesResource = schema.GroupVersionResource{Group: "policy.sigstore.dev", Version: "v1beta1", Resource: "clusterimagepolicies"} -var clusterimagepoliciesKind = schema.GroupVersionKind{Group: "cosigned.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/cosigned/v1beta1/fake/fake_cosigned_client.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/fake/fake_policy_client.go similarity index 82% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/fake_cosigned_client.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/fake/fake_policy_client.go index eca513ac70e..b5f52e2d7c3 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/fake/fake_cosigned_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/cosigned/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 FakeCosignedV1beta1 struct { +type FakePolicyV1beta1 struct { *testing.Fake } -func (c *FakeCosignedV1beta1) 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 *FakeCosignedV1beta1) RESTClient() rest.Interface { +func (c *FakePolicyV1beta1) 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/policy/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/policy/v1beta1/generated_expansion.go diff --git a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/cosigned_client.go b/pkg/client/clientset/versioned/typed/policy/v1beta1/policy_client.go similarity index 66% rename from pkg/client/clientset/versioned/typed/cosigned/v1beta1/cosigned_client.go rename to pkg/client/clientset/versioned/typed/policy/v1beta1/policy_client.go index 90bbd4d7097..5146b989aff 100644 --- a/pkg/client/clientset/versioned/typed/cosigned/v1beta1/cosigned_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/cosigned/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 CosignedV1beta1Interface interface { +type PolicyV1beta1Interface interface { RESTClient() rest.Interface ClusterImagePoliciesGetter } -// CosignedV1beta1Client is used to interact with features provided by the cosigned.sigstore.dev group. -type CosignedV1beta1Client struct { +// PolicyV1beta1Client is used to interact with features provided by the policy.sigstore.dev group. +type PolicyV1beta1Client struct { restClient rest.Interface } -func (c *CosignedV1beta1Client) ClusterImagePolicies() ClusterImagePolicyInterface { +func (c *PolicyV1beta1Client) ClusterImagePolicies() ClusterImagePolicyInterface { return newClusterImagePolicies(c) } -// NewForConfig creates a new CosignedV1beta1Client 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) (*CosignedV1beta1Client, 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) (*CosignedV1beta1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new CosignedV1beta1Client 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) (*CosignedV1beta1Client, 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) (*CosignedV1beta1Clie if err != nil { return nil, err } - return &CosignedV1beta1Client{client}, nil + return &PolicyV1beta1Client{client}, nil } -// NewForConfigOrDie creates a new CosignedV1beta1Client 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) *CosignedV1beta1Client { +func NewForConfigOrDie(c *rest.Config) *PolicyV1beta1Client { 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 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 *CosignedV1beta1Client) 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 dd335c60f74..097c2aecbcb 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" + 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 - Cosigned() cosigned.Interface + Policy() policy.Interface } -func (f *sharedInformerFactory) Cosigned() cosigned.Interface { - return cosigned.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 3875bd4e9fc..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/cosigned/v1alpha1" - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/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=cosigned.sigstore.dev, Version=v1alpha1 + // Group=policy.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.Policy().V1alpha1().ClusterImagePolicies().Informer()}, nil - // Group=cosigned.sigstore.dev, Version=v1beta1 + // Group=policy.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.Policy().V1beta1().ClusterImagePolicies().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/cosigned/interface.go b/pkg/client/informers/externalversions/policy/interface.go similarity index 96% rename from pkg/client/informers/externalversions/cosigned/interface.go rename to pkg/client/informers/externalversions/policy/interface.go index 96625713d1f..c997ffc4f6a 100644 --- a/pkg/client/informers/externalversions/cosigned/interface.go +++ b/pkg/client/informers/externalversions/policy/interface.go @@ -14,12 +14,12 @@ // Code generated by informer-gen. DO NOT EDIT. -package cosigned +package policy 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/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/cosigned/v1alpha1/clusterimagepolicy.go b/pkg/client/informers/externalversions/policy/v1alpha1/clusterimagepolicy.go similarity index 88% rename from pkg/client/informers/externalversions/cosigned/v1alpha1/clusterimagepolicy.go rename to pkg/client/informers/externalversions/policy/v1alpha1/clusterimagepolicy.go index 6403e4fdc68..26bd1d1b373 100644 --- a/pkg/client/informers/externalversions/cosigned/v1alpha1/clusterimagepolicy.go +++ b/pkg/client/informers/externalversions/policy/v1alpha1/clusterimagepolicy.go @@ -20,10 +20,10 @@ import ( "context" time "time" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/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/cosigned/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.CosignedV1alpha1().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.CosignedV1alpha1().ClusterImagePolicies().Watch(context.TODO(), options) + return client.PolicyV1alpha1().ClusterImagePolicies().Watch(context.TODO(), options) }, }, - &cosignedv1alpha1.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(&cosignedv1alpha1.ClusterImagePolicy{}, f.defaultInformer) + return f.factory.InformerFor(&policyv1alpha1.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/policy/v1alpha1/interface.go similarity index 100% rename from pkg/client/informers/externalversions/cosigned/v1alpha1/interface.go rename to pkg/client/informers/externalversions/policy/v1alpha1/interface.go diff --git a/pkg/client/informers/externalversions/cosigned/v1beta1/clusterimagepolicy.go b/pkg/client/informers/externalversions/policy/v1beta1/clusterimagepolicy.go similarity index 88% rename from pkg/client/informers/externalversions/cosigned/v1beta1/clusterimagepolicy.go rename to pkg/client/informers/externalversions/policy/v1beta1/clusterimagepolicy.go index e952111966d..5e365c0acca 100644 --- a/pkg/client/informers/externalversions/cosigned/v1beta1/clusterimagepolicy.go +++ b/pkg/client/informers/externalversions/policy/v1beta1/clusterimagepolicy.go @@ -20,10 +20,10 @@ import ( "context" time "time" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/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/cosigned/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.CosignedV1beta1().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.CosignedV1beta1().ClusterImagePolicies().Watch(context.TODO(), options) + return client.PolicyV1beta1().ClusterImagePolicies().Watch(context.TODO(), options) }, }, - &cosignedv1beta1.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(&cosignedv1beta1.ClusterImagePolicy{}, f.defaultInformer) + return f.factory.InformerFor(&policyv1beta1.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/policy/v1beta1/interface.go similarity index 100% rename from pkg/client/informers/externalversions/cosigned/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 2a4e5914d85..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/cosigned/v1alpha1" - v1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/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" - typedcosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/v1alpha1" - typedcosignedv1beta1 "github.com/sigstore/cosign/pkg/client/clientset/versioned/typed/cosigned/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 } -// CosignedV1alpha1 retrieves the CosignedV1alpha1Client -func (w *wrapClient) CosignedV1alpha1() typedcosignedv1alpha1.CosignedV1alpha1Interface { - return &wrapCosignedV1alpha1{ +// PolicyV1alpha1 retrieves the PolicyV1alpha1Client +func (w *wrapClient) PolicyV1alpha1() typedpolicyv1alpha1.PolicyV1alpha1Interface { + return &wrapPolicyV1alpha1{ dyn: w.dyn, } } -type wrapCosignedV1alpha1 struct { +type wrapPolicyV1alpha1 struct { dyn dynamic.Interface } -func (w *wrapCosignedV1alpha1) RESTClient() rest.Interface { +func (w *wrapPolicyV1alpha1) RESTClient() rest.Interface { panic("RESTClient called on dynamic client!") } -func (w *wrapCosignedV1alpha1) ClusterImagePolicies() typedcosignedv1alpha1.ClusterImagePolicyInterface { - return &wrapCosignedV1alpha1ClusterImagePolicyImpl{ +func (w *wrapPolicyV1alpha1) ClusterImagePolicies() typedpolicyv1alpha1.ClusterImagePolicyInterface { + return &wrapPolicyV1alpha1ClusterImagePolicyImpl{ dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "cosigned.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1alpha1", Resource: "clusterimagepolicies", }), } } -type wrapCosignedV1alpha1ClusterImagePolicyImpl struct { +type wrapPolicyV1alpha1ClusterImagePolicyImpl struct { dyn dynamic.NamespaceableResourceInterface } -var _ typedcosignedv1alpha1.ClusterImagePolicyInterface = (*wrapCosignedV1alpha1ClusterImagePolicyImpl)(nil) +var _ typedpolicyv1alpha1.ClusterImagePolicyInterface = (*wrapPolicyV1alpha1ClusterImagePolicyImpl)(nil) -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) 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: "cosigned.sigstore.dev", + Group: "policy.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 *wrapPolicyV1alpha1ClusterImagePolicyImpl) 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 *wrapPolicyV1alpha1ClusterImagePolicyImpl) 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 *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 *wrapCosignedV1alpha1ClusterImagePolicyImpl) Get(ctx context.Context, na return out, nil } -func (w *wrapCosignedV1alpha1ClusterImagePolicyImpl) 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 *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 *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 *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 *wrapPolicyV1alpha1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policy.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 *wrapPolicyV1alpha1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1alpha1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1alpha1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policy.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 *wrapPolicyV1alpha1ClusterImagePolicyImpl) 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{ +// PolicyV1beta1 retrieves the PolicyV1beta1Client +func (w *wrapClient) PolicyV1beta1() typedpolicyv1beta1.PolicyV1beta1Interface { + return &wrapPolicyV1beta1{ dyn: w.dyn, } } -type wrapCosignedV1beta1 struct { +type wrapPolicyV1beta1 struct { dyn dynamic.Interface } -func (w *wrapCosignedV1beta1) RESTClient() rest.Interface { +func (w *wrapPolicyV1beta1) RESTClient() rest.Interface { panic("RESTClient called on dynamic client!") } -func (w *wrapCosignedV1beta1) ClusterImagePolicies() typedcosignedv1beta1.ClusterImagePolicyInterface { - return &wrapCosignedV1beta1ClusterImagePolicyImpl{ +func (w *wrapPolicyV1beta1) ClusterImagePolicies() typedpolicyv1beta1.ClusterImagePolicyInterface { + return &wrapPolicyV1beta1ClusterImagePolicyImpl{ dyn: w.dyn.Resource(schema.GroupVersionResource{ - Group: "cosigned.sigstore.dev", + Group: "policy.sigstore.dev", Version: "v1beta1", Resource: "clusterimagepolicies", }), } } -type wrapCosignedV1beta1ClusterImagePolicyImpl struct { +type wrapPolicyV1beta1ClusterImagePolicyImpl struct { dyn dynamic.NamespaceableResourceInterface } -var _ typedcosignedv1beta1.ClusterImagePolicyInterface = (*wrapCosignedV1beta1ClusterImagePolicyImpl)(nil) +var _ typedpolicyv1beta1.ClusterImagePolicyInterface = (*wrapPolicyV1beta1ClusterImagePolicyImpl)(nil) -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) 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: "cosigned.sigstore.dev", + Group: "policy.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 *wrapPolicyV1beta1ClusterImagePolicyImpl) 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 *wrapPolicyV1beta1ClusterImagePolicyImpl) 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 *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 *wrapCosignedV1beta1ClusterImagePolicyImpl) Get(ctx context.Context, nam return out, nil } -func (w *wrapCosignedV1beta1ClusterImagePolicyImpl) 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 *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 *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 *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 *wrapPolicyV1beta1ClusterImagePolicyImpl) Update(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policy.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 *wrapPolicyV1beta1ClusterImagePolicyImpl) UpdateStatus(ctx context.Context, in *v1beta1.ClusterImagePolicy, opts v1.UpdateOptions) (*v1beta1.ClusterImagePolicy, error) { in.SetGroupVersionKind(schema.GroupVersionKind{ - Group: "cosigned.sigstore.dev", + Group: "policy.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 *wrapPolicyV1beta1ClusterImagePolicyImpl) 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/policy/v1alpha1/clusterimagepolicy/clusterimagepolicy.go similarity index 75% rename from pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/clusterimagepolicy.go rename to pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/clusterimagepolicy.go index 2ff92059607..53173e52476 100644 --- a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/clusterimagepolicy.go @@ -19,12 +19,12 @@ package clusterimagepolicy import ( context "context" - apiscosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/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/cosigned/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" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/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.Cosigned().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/cosigned/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 _ cosignedv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policyv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apiscosignedv1alpha1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicyv1alpha1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() cosignedv1alpha1.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 []*apiscosignedv1alpha1.ClusterImagePolicy, err error) { - lo, err := w.client.CosignedV1alpha1().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 []*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) (*apispolicyv1alpha1.ClusterImagePolicy, error) { + return w.client.PolicyV1alpha1().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/policy/v1alpha1/clusterimagepolicy/fake/fake.go similarity index 91% rename from pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/fake/fake.go rename to pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/fake/fake.go index 195133defd0..242ed864d42 100644 --- a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/fake/fake.go +++ b/pkg/client/injection/informers/policy/v1alpha1/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/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.Cosigned().V1beta1().ClusterImagePolicies() + inf := f.Policy().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/policy/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go similarity index 78% rename from pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go rename to pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/filtered/clusterimagepolicy.go index 9bf353eec2e..b352b6f07a8 100644 --- a/pkg/client/injection/informers/cosigned/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" - apiscosignedv1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/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/cosigned/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" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/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.Cosigned().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/cosigned/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 _ cosignedv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policyv1alpha1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apiscosignedv1alpha1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicyv1alpha1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() cosignedv1alpha1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policyv1alpha1.ClusterImagePolicyLister { return w } -func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1alpha1.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.CosignedV1alpha1().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 []*apiscosignedv1alpha1.Cl return ret, nil } -func (w *wrapper) Get(name string) (*apiscosignedv1alpha1.ClusterImagePolicy, error) { +func (w *wrapper) Get(name string) (*apispolicyv1alpha1.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.PolicyV1alpha1().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/policy/v1alpha1/clusterimagepolicy/filtered/fake/fake.go similarity index 93% rename from pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered/fake/fake.go rename to pkg/client/injection/informers/policy/v1alpha1/clusterimagepolicy/filtered/fake/fake.go index 9ae1b0a8f2b..501a7f46087 100644 --- a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered/fake/fake.go +++ b/pkg/client/injection/informers/policy/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/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.Cosigned().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/cosigned/v1beta1/clusterimagepolicy/clusterimagepolicy.go b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/clusterimagepolicy.go similarity index 76% rename from pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/clusterimagepolicy.go rename to pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/clusterimagepolicy.go index 93ad5da2422..abccbbbaaff 100644 --- a/pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/clusterimagepolicy.go +++ b/pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/clusterimagepolicy.go @@ -19,12 +19,12 @@ package clusterimagepolicy import ( context "context" - apiscosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/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/cosigned/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" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/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.Cosigned().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/cosigned/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 _ cosignedv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policyv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apiscosignedv1beta1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicyv1beta1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() cosignedv1beta1.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 []*apiscosignedv1beta1.ClusterImagePolicy, err error) { - lo, err := w.client.CosignedV1beta1().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 []*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) (*apispolicyv1beta1.ClusterImagePolicy, error) { + return w.client.PolicyV1beta1().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/policy/v1beta1/clusterimagepolicy/fake/fake.go similarity index 91% rename from pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/fake/fake.go rename to pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/fake/fake.go index eb8a3f43e2f..34d20f5917e 100644 --- a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/fake/fake.go +++ b/pkg/client/injection/informers/policy/v1beta1/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/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.Cosigned().V1alpha1().ClusterImagePolicies() + inf := f.Policy().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/policy/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go similarity index 78% rename from pkg/client/injection/informers/cosigned/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go rename to pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/filtered/clusterimagepolicy.go index 642dc133dc5..a620e1d5c41 100644 --- a/pkg/client/injection/informers/cosigned/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" - apiscosignedv1beta1 "github.com/sigstore/cosign/pkg/apis/cosigned/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/cosigned/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" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/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.Cosigned().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/cosigned/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 _ cosignedv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) +var _ policyv1beta1.ClusterImagePolicyLister = (*wrapper)(nil) func (w *wrapper) Informer() cache.SharedIndexInformer { - return cache.NewSharedIndexInformer(nil, &apiscosignedv1beta1.ClusterImagePolicy{}, 0, nil) + return cache.NewSharedIndexInformer(nil, &apispolicyv1beta1.ClusterImagePolicy{}, 0, nil) } -func (w *wrapper) Lister() cosignedv1beta1.ClusterImagePolicyLister { +func (w *wrapper) Lister() policyv1beta1.ClusterImagePolicyLister { return w } -func (w *wrapper) List(selector labels.Selector) (ret []*apiscosignedv1beta1.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.CosignedV1beta1().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 []*apiscosignedv1beta1.Clu return ret, nil } -func (w *wrapper) Get(name string) (*apiscosignedv1beta1.ClusterImagePolicy, error) { +func (w *wrapper) Get(name string) (*apispolicyv1beta1.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.PolicyV1beta1().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/policy/v1beta1/clusterimagepolicy/filtered/fake/fake.go similarity index 93% rename from pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered/fake/fake.go rename to pkg/client/injection/informers/policy/v1beta1/clusterimagepolicy/filtered/fake/fake.go index 09735da0edb..45d4c791f5a 100644 --- a/pkg/client/injection/informers/cosigned/v1alpha1/clusterimagepolicy/filtered/fake/fake.go +++ b/pkg/client/injection/informers/policy/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/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.Cosigned().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/cosigned/v1beta1/clusterimagepolicy/controller.go b/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/controller.go similarity index 96% rename from pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/controller.go rename to pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/controller.go index 1dd6081ee4f..1a0cb911281 100644 --- a/pkg/client/injection/reconciler/cosigned/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/cosigned/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.cosigned.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, "cosigned.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/cosigned/v1alpha1/clusterimagepolicy/reconciler.go b/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/reconciler.go similarity index 96% rename from pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/reconciler.go rename to pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/reconciler.go index 861103f2bbd..f79846ab738 100644 --- a/pkg/client/injection/reconciler/cosigned/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/cosigned/v1alpha1" + v1alpha1 "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - cosignedv1alpha1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/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 cosignedv1alpha1.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 cosignedv1alpha1.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.CosignedV1alpha1().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/cosigned/v1alpha1/clusterimagepolicy/state.go b/pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/state.go similarity index 97% rename from pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/state.go rename to pkg/client/injection/reconciler/policy/v1alpha1/clusterimagepolicy/state.go index 284dd1d4ff4..d55dc2a2f6a 100644 --- a/pkg/client/injection/reconciler/cosigned/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/cosigned/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/cosigned/v1alpha1/clusterimagepolicy/controller.go b/pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/controller.go similarity index 96% rename from pkg/client/injection/reconciler/cosigned/v1alpha1/clusterimagepolicy/controller.go rename to pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/controller.go index 8bb13274a3e..127446ba9f8 100644 --- a/pkg/client/injection/reconciler/cosigned/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/cosigned/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.cosigned.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, "cosigned.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/cosigned/v1beta1/clusterimagepolicy/reconciler.go b/pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/reconciler.go similarity index 96% rename from pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/reconciler.go rename to pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/reconciler.go index 88fa7a3fe26..38a5f020a0c 100644 --- a/pkg/client/injection/reconciler/cosigned/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/cosigned/v1beta1" + v1beta1 "github.com/sigstore/cosign/pkg/apis/policy/v1beta1" versioned "github.com/sigstore/cosign/pkg/client/clientset/versioned" - cosignedv1beta1 "github.com/sigstore/cosign/pkg/client/listers/cosigned/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 cosignedv1beta1.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 cosignedv1beta1.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.CosignedV1beta1().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/cosigned/v1beta1/clusterimagepolicy/state.go b/pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/state.go similarity index 97% rename from pkg/client/injection/reconciler/cosigned/v1beta1/clusterimagepolicy/state.go rename to pkg/client/injection/reconciler/policy/v1beta1/clusterimagepolicy/state.go index 7bb1188e615..730c9309a15 100644 --- a/pkg/client/injection/reconciler/cosigned/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/cosigned/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/cosigned/v1alpha1/clusterimagepolicy.go b/pkg/client/listers/policy/v1alpha1/clusterimagepolicy.go similarity index 97% rename from pkg/client/listers/cosigned/v1alpha1/clusterimagepolicy.go rename to pkg/client/listers/policy/v1alpha1/clusterimagepolicy.go index dcb0d873d31..6323417d5be 100644 --- a/pkg/client/listers/cosigned/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/cosigned/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/cosigned/v1alpha1/expansion_generated.go b/pkg/client/listers/policy/v1alpha1/expansion_generated.go similarity index 100% rename from pkg/client/listers/cosigned/v1alpha1/expansion_generated.go rename to pkg/client/listers/policy/v1alpha1/expansion_generated.go diff --git a/pkg/client/listers/cosigned/v1beta1/clusterimagepolicy.go b/pkg/client/listers/policy/v1beta1/clusterimagepolicy.go similarity index 97% rename from pkg/client/listers/cosigned/v1beta1/clusterimagepolicy.go rename to pkg/client/listers/policy/v1beta1/clusterimagepolicy.go index 81332814b0f..5fc7517a635 100644 --- a/pkg/client/listers/cosigned/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/cosigned/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/cosigned/v1beta1/expansion_generated.go b/pkg/client/listers/policy/v1beta1/expansion_generated.go similarity index 100% rename from pkg/client/listers/cosigned/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 2a6ccf576aa..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/cosigned/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 278cc5439fc..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/cosigned/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 54db376a1e1..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/cosigned/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/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..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/cosigned/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/cosigned/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 2c25232a2a5..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/cosigned/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/cosigned/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 3c77fc8c2ce..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/cosigned/v1alpha1/clusterimagepolicy" - clusterimagepolicyreconciler "github.com/sigstore/cosign/pkg/client/injection/reconciler/cosigned/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.cosigned.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 6c2a8672471..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/cosigned/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 6087260f959..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/cosigned/v1alpha1" + "github.com/sigstore/cosign/pkg/apis/policy/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -const finalizerName = "clusterimagepolicies.cosigned.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 1c04d40845d..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/cosigned/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/cosigned/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/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/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..a26925dbba1 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 policy.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 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 @@ -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 policy.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..c68d3413f03 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 policy.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_cosigned.sh b/test/e2e_test_policy_controller.sh similarity index 96% rename from test/e2e_test_cosigned.sh rename to test/e2e_test_policy_controller.sh index 7a0b5b5799f..66a9f2c0bf2 100755 --- a/test/e2e_test_cosigned.sh +++ b/test/e2e_test_policy_controller.sh @@ -92,7 +92,7 @@ echo '::endgroup::' echo '::group:: enable verification' -kubectl label namespace default --overwrite cosigned.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 cosigned.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 cosigned.sigstore.dev/include=true +kubectl label namespace default --overwrite policy.sigstore.dev/include=true 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 94% 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..5062b8d8505 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: policy.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 91% rename from test/testdata/cosigned/e2e/cip-key.yaml rename to test/testdata/policy-controller/e2e/cip-key.yaml index 7b7784bacdf..b249970847c 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: policy.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..1f47c0818b8 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: policy.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 91% 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..ad4e978ea43 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: policy.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 90% 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..f09c33ab9d5 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: policy.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 89% rename from test/testdata/cosigned/e2e/cip-keyless.yaml rename to test/testdata/policy-controller/e2e/cip-keyless.yaml index 5408b8aabcb..a6da330fb8f 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: policy.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..092c9a3c7ad 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: policy.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 94% rename from test/testdata/cosigned/invalid/empty-keyless-ref.yaml rename to test/testdata/policy-controller/invalid/empty-keyless-ref.yaml index 98d9658a17a..1eaaed0820c 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: policy.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 94% 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..f73286c9efb 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: policy.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 94% rename from test/testdata/cosigned/invalid/empty-keyref.yaml rename to test/testdata/policy-controller/invalid/empty-keyref.yaml index db7d7d75eac..7e8f3639dff 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: policy.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 95% rename from test/testdata/cosigned/invalid/invalid-glob.yaml rename to test/testdata/policy-controller/invalid/invalid-glob.yaml index 1e81ffac4f4..2caf5a6513e 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: policy.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 94% rename from test/testdata/cosigned/invalid/invalid-pubkey.yaml rename to test/testdata/policy-controller/invalid/invalid-pubkey.yaml index 66128082db0..cabf6aeb321 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: policy.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 94% 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..9c79ad1bdfb 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: policy.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 94% 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..9942662479e 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: policy.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 94% 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..574bea63e06 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: policy.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 94% 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..d0f0862d452 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: policy.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 95% 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..030f5b7912a 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: policy.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 95% 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..45b4c2c1509 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: policy.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 94% 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..eb51b7708a2 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: policy.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..798e7f8af80 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: policy.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..ab1a74e657d 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: policy.sigstore.dev/v1alpha1 kind: ClusterImagePolicy metadata: name: image-policy