Skip to content

NO-ISSUE: config/v1alpha1: Drop (Cluster)ImagePolicy since the hard cut to v1#2760

Open
wking wants to merge 1 commit intoopenshift:masterfrom
wking:delete-v1alpha1-image-policy-dead-code
Open

NO-ISSUE: config/v1alpha1: Drop (Cluster)ImagePolicy since the hard cut to v1#2760
wking wants to merge 1 commit intoopenshift:masterfrom
wking:delete-v1alpha1-image-policy-dead-code

Conversation

@wking
Copy link
Member

@wking wking commented Mar 11, 2026

d1ee051 (#2384) hard cut from v1alpha1 to v1 back when the API was still TechPreviewNoUpgrade. This v1alpha1 Go has been dead code since then. Delete it, to avoid confusing folks who might see it and think it still matters somewhere (as set of people that included me up until a few hours ago ;).

d1ee051 (Add clusterimgepolicy/imagepolicy to payload, 2025-07-23, openshift#2384)
hard cut from v1alpha1 to v1 back when the API was still
TechPreviewNoUpgrade.  This v1alpha1 Go has been dead code since then.
Delete it, to avoid confusing folks who might see it and think it
still matters somewhere (as set of people that included me up until a
few hours ago ;).
@openshift-ci-robot
Copy link

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 11, 2026
@openshift-ci-robot
Copy link

@wking: This pull request explicitly references no jira issue.

Details

In response to this:

d1ee051 (#2384) hard cut from v1alpha1 to v1 back when the API was still TechPreviewNoUpgrade. This v1alpha1 Go has been dead code since then. Delete it, to avoid confusing folks who might see it and think it still matters somewhere (as set of people that included me up until a few hours ago ;).

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 11, 2026

Hello @wking! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@qodo-code-review
Copy link

ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan

Review Summary by Qodo

Remove v1alpha1 ImagePolicy and ClusterImagePolicy dead code

📦 Other

Grey Divider

Walkthroughs

Description
• Remove dead v1alpha1 ImagePolicy and ClusterImagePolicy types
• Clean up obsolete API definitions from hard cut to v1
• Eliminate confusion from unused API code references
Diagram
flowchart LR
  A["v1alpha1 API Types"] -->|Delete| B["ImagePolicy removed"]
  A -->|Delete| C["ClusterImagePolicy removed"]
  B --> D["Clean codebase"]
  C --> D
Loading

Grey Divider

File Changes

1. config/v1alpha1/types_cluster_image_policy.go Miscellaneous +0/-80

Delete ClusterImagePolicy v1alpha1 type definitions

• Deleted entire file containing ClusterImagePolicy struct definition
• Removed ClusterImagePolicySpec with scopes and policy configuration
• Removed ClusterImagePolicyStatus and ClusterImagePolicyList types
• Eliminated 80 lines of dead code from v1alpha1 API version

config/v1alpha1/types_cluster_image_policy.go


2. config/v1alpha1/types_image_policy.go Miscellaneous +0/-289

Delete ImagePolicy v1alpha1 type definitions

• Deleted entire file containing ImagePolicy struct definition
• Removed ImagePolicySpec, ImagePolicyStatus, and ImagePolicyList types
• Removed all supporting types including ImageScope, ImageSigstoreVerificationPolicy,
 PolicyRootOfTrust, and related validation structures
• Eliminated 289 lines of dead code from v1alpha1 API version

config/v1alpha1/types_image_policy.go


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 11, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 7601dc25-f09b-4e0d-b337-8185a2de5fc4

📥 Commits

Reviewing files that changed from the base of the PR and between f6ee4c0 and 2c75ec7.

📒 Files selected for processing (2)
  • config/v1alpha1/types_cluster_image_policy.go
  • config/v1alpha1/types_image_policy.go
💤 Files with no reviewable changes (2)
  • config/v1alpha1/types_cluster_image_policy.go
  • config/v1alpha1/types_image_policy.go

📝 Walkthrough

Walkthrough

This pull request removes two v1alpha1 API type definition files: types_cluster_image_policy.go and types_image_policy.go from the config directory. The removal eliminates all associated Kubernetes Custom Resource Definition types, including ClusterImagePolicy, ClusterImagePolicySpec, ClusterImagePolicyStatus, ClusterImagePolicyList, ImagePolicy, ImagePolicySpec, and numerous related policy, identity, and root-of-trust types. Additionally, all related constants, validation markers, and documentation comments are deleted. The net change is 369 lines removed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing v1alpha1 (Cluster)ImagePolicy types that became dead code after the hard cut to v1.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for removing the v1alpha1 ImagePolicy dead code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed The pull request exclusively removes dead code type definitions that were left over after a hard cut from v1alpha1 to v1, with no test code modifications.
Test Structure And Quality ✅ Passed PR removes dead code (v1alpha1 type definitions) with no Ginkgo test files involved.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 11, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 11, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 11, 2026

@wking: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/verify-client-go 2c75ec7 link true /test verify-client-go
ci/prow/unit 2c75ec7 link true /test unit
ci/prow/verify 2c75ec7 link true /test verify
ci/prow/lint 2c75ec7 link true /test lint

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@JoelSpeed
Copy link
Contributor

Will need to clean up things like deepcopy that are generated for this, and any testing that's specific to this API type

PROTO_OPTIONAL=1 make update

This should get you started there at least

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants