Skip to content

Conversation

@2uasimojo
Copy link
Member

We spent some time in #511 and again in #542 trying to reconcile CRDs. The problem is that we want to generate the CredentialsRequest CRD from code in this repo, but use (copy) the CloudCredential CRD from openshift/api, which we vendor. But we invoke controller-gen through build-machinery-go, and it does unexpected things to the latter, which breaks validation.

With this commit, we move the CredentialsRequest CRD to a generated subdirectory and the CloudCredential CRD to an imported subdirectory. This lets us go back to the simpler invocation of bmg's tooling while keeping everything in the shape we expect.

One more quirk: Because build-machinery-go starts defining dependency chains for targets like update, we need to start defining that dependency chain before we import the bmg libs to ensure that we copy/generate CRDs before we include them in bindata.

We spent some time in openshift#511 and again in openshift#542 trying to reconcile CRDs.
The problem is that we want to *generate* the CredentialsRequest CRD
from code in this repo, but *use* (copy) the CloudCredential CRD from
openshift/api, which we vendor. But we invoke controller-gen through
build-machinery-go, and it does unexpected things to the latter, which
breaks validation.

With this commit, we move the CredentialsRequest CRD to a `generated`
subdirectory and the CloudCredential CRD to an `imported` subdirectory.
This lets us go back to the simpler invocation of bmg's tooling while
keeping everything in the shape we expect.

One more quirk: Because build-machinery-go starts defining dependency
chains for targets like `update`, we need to start defining that
dependency chain *before* we import the bmg libs to ensure that we
copy/generate CRDs *before* we include them in bindata.
@openshift-ci openshift-ci bot requested review from dlom and jstuever June 27, 2023 22:20
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 2uasimojo

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

The pull request process is described 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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 27, 2023
@2uasimojo
Copy link
Member Author

/assign @abutcher

@codecov
Copy link

codecov bot commented Jun 28, 2023

Codecov Report

Merging #555 (1361f4f) into master (ee67cc6) will not change coverage.
Report is 127 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #555   +/-   ##
=======================================
  Coverage   48.06%   48.06%           
=======================================
  Files          93       93           
  Lines       11305    11305           
=======================================
  Hits         5434     5434           
  Misses       5251     5251           
  Partials      620      620           
Files Changed Coverage Δ
pkg/cmd/render/render.go 47.24% <ø> (ø)
pkg/assets/bootstrap/bindata.go 23.85% <100.00%> (ø)

@2uasimojo
Copy link
Member Author

/retest

@stevekuznetsov
Copy link
Contributor

More context:

  • controller-gen@0.2.5 (current version used here, very old) causes a diff on the copied manifests from openshift/api, which is the source of failures in make validate
  • controller-gen@0.9.2 (currently latest available from the OpenShift fork) does not create the diff, but barfs on non-CRD manifests in the directory
  • controller-gen@master (from upstream) neither causes the errant diff nor fails to run on the heterogeneous directory

If we can just get that upstream code downstreamed & released, we can simply remove all hackery around this entirely.

@stevekuznetsov
Copy link
Contributor

Spoke with David and I'm going to take a stab at getting the OpenShift controller-tools fork updated so we can just bump the version we use to latest and not have to do any of this.

@2uasimojo
Copy link
Member Author

Sounds good @stevekuznetsov. We'll want to:

  • Wait until controller-gen@master gets a release
  • Submit a PR to build-machinery-go to bump the controller-gen version to that release
  • Update the build-machinery-go vendored dep here in CCO to pick it up.

We also may still need to do something akin to the make dependency shuffle in this PR, since we still want to make sure we've done the regeneration and copying before we build bindata. Without that, I was finding yesterday that one would have to run make update* multiple times if those CRDs had changed.

@stevekuznetsov
Copy link
Contributor

@2uasimojo I chatted with the folks doing there, and it seems like the real flow will be:

  • make build-machinery-go use go mod to install controller-gen
  • re-vendor build-machinery-go in CCO
  • update the version of controller-gen used in CCO to be newer

Looks like they don't want to be pushing releases anymore, so the curl-based install is not something we can continue to do anymore in BMG. Even now it's pulling in something only as recent as last September...

@stevekuznetsov
Copy link
Contributor

@2uasimojo also good point on bindata - I noticed the same.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 29, 2023
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

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/test-infra repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 9, 2023

@2uasimojo: The following test 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/e2e-azure-manual-oidc 1361f4f link true /test e2e-azure-manual-oidc

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/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 7, 2023
@2uasimojo 2uasimojo closed this Nov 7, 2023
@2uasimojo 2uasimojo deleted the move-manifests branch November 7, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants