Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use latest controller-gen, which allows CEL validations #1692

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

joshuatcasey
Copy link
Member

@joshuatcasey joshuatcasey commented Sep 25, 2023

Use latest controller-gen, which allows CEL validations.

This PR is only a result of running ./hack/update.sh to update the generated (and deploy) files. There are no manual changes here.

See #185863937.

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #1692 (ac9887a) into main (58c5146) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1692      +/-   ##
==========================================
+ Coverage   79.14%   79.16%   +0.01%     
==========================================
  Files         163      163              
  Lines       15769    15769              
==========================================
+ Hits        12481    12484       +3     
+ Misses       2972     2970       -2     
+ Partials      316      315       -1     

see 2 files with indirect coverage changes

@@ -116,6 +115,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? Are we okay with this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://kubernetes.io/docs/reference/using-api/server-side-apply/,

Applicable to maps. atomic means that the map can only be entirely replaced by a single manager. granular means that the map supports separate managers updating individual fields.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this only applies to managedFields, which does not appear to be used in Pinniped.

Copy link
Member

@cfryanr cfryanr Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this more closely, x-kubernetes-map-type: atomic got applied to:

  • objectRef, which is of type corev1.TypedLocalObjectReference
  • jwks, tokenSigningKey, stateSigningKey, and stateEncryptionKey which are all of type corev1.LocalObjectReference

So in all these cases the +structType=atomic tag is coming from the authors of the corev1 package, so that seems fine. Presumably they know what they are doing with these server-side apply settings. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to test the upgrade path, I tried applying this CRD from main and then applying this CRD from this PR branch. It applied without complaint about adding x-kubernetes-map-type to these fields. It did not seem to have any impact on my existing FederationDomain resource either. Seems like it worked fine to upgrade the CRD to add these settings.

hack/lib/update-codegen.sh Outdated Show resolved Hide resolved
@cfryanr
Copy link
Member

cfryanr commented Sep 25, 2023

concourse-ci/integration-test-latest-fips flaked and I attempted a fix in #1695.

In the meantime I reran that job for your PR.

@cfryanr cfryanr merged commit e25ecea into main Sep 26, 2023
8 checks passed
@cfryanr cfryanr deleted the jtc/use-latest-controller-gen branch September 26, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants