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

Update apiextensions to v1 #353

Merged
merged 3 commits into from
Mar 9, 2021
Merged

Update apiextensions to v1 #353

merged 3 commits into from
Mar 9, 2021

Conversation

k0da
Copy link
Collaborator

@k0da k0da commented Mar 5, 2021

This updates apiextensions.k8s.io/v1beta1 to apiextensions.k8s.io/v1

Signed-off-by: Dinar Valeev dinar.valeev@absa.africa

Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

@k0da just to double-check, everything under chart/k8gb/templates/k8gb.absa.oss_gslbs_crd.yaml is purely a result of generation, no manual modifications were required?

@k0da
Copy link
Collaborator Author

k0da commented Mar 8, 2021

@ytsarev The flow is change controller-gen options to produce v1 into config/crd/bases/k8gb.absa.oss_gslbs.yaml, modify it to validate http and paths fields of an IngressSpec and copy it over into chart/k8gb/templates

Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

@k0da Please make the generation and manual modification in form of separate commits so it is clear what is actually happening in the git history.

Apparently we also need to get rid of duplicate in deploy/crds/k8gb.absa.oss_gslbs_crd.yaml

Is it possible to symlink chart/k8gb/templates/k8gb.absa.oss_gslbs_crd.yaml and config/crd/bases/k8gb.absa.oss_gslbs.yaml to avoid manual copy over? (I'm not sure if it will properly work during packaging)

@somaritane surprise surprise, we hit the case when we need a Merge commit containing multiple logically separated commits ;)

@somaritane
Copy link
Contributor

somaritane commented Mar 8, 2021

@somaritane surprise surprise, we hit the case when we need a Merge commit containing multiple logically separated commits ;)

@ytsarev yet it still looks like exceptional case rather than common one :)
This PR can be split into two separate.
Or you can temporary lift "squash only" cap from merge trigger for this particular case.

@k0da
Copy link
Collaborator Author

k0da commented Mar 8, 2021

Reworked in a way:

  • dropped config/crd
  • generate straight into chart/k8gb/templates

Makefile Outdated
@@ -410,7 +410,7 @@ define generate
endef

define manifest
$(call controller-gen,crd:trivialVersions=true rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases)
$(call controller-gen,crd paths="./..." output:crd:artifacts:config=chart/k8gb/templates/)
Copy link
Member

Choose a reason for hiding this comment

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

is crd version v1 is the default in sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0 ? I recall explicit version statement in the first version of this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, it is. Since v1beta1 is deprecated quite a while ago. We can have it explicit though

* Switches to v1 crd by default
* fix/cleanup generator opts (generator outputs crd only
  "output:crd:artifact")

Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

Apparently

deploy/crds/k8gb.absa.oss_gslbs_crd.yaml

still should be removed

k0da added 2 commits March 8, 2021 21:12
Since controller isn't using webhook or cert-manger we don't really need
to pass crd through kustomize in order to install it. We switch
generating CRD into chart template directory. In order to keep single
file reference.

Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
After CRD generated, we need to bring back validation of
.spec.ingress.rules.http field.

Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
@k0da
Copy link
Collaborator Author

k0da commented Mar 8, 2021

done

@k0da k0da requested a review from ytsarev March 8, 2021 20:13
Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

Probably last bit, sorry, just remembered.
We should remove associated kubelinter exclusion https://github.com/AbsaOSS/k8gb/blob/master/.kube-linter.yaml#L3

@k0da
Copy link
Collaborator Author

k0da commented Mar 8, 2021

@ytsarev not yet. DNSEndpoint is still v1beta1

@k0da k0da requested a review from ytsarev March 8, 2021 20:25
@ytsarev
Copy link
Member

ytsarev commented Mar 8, 2021

@k0da indeed 👍

Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

Looks great

@k0da
Copy link
Collaborator Author

k0da commented Mar 8, 2021

DNSEndpoint addresed in kubernetes-sigs/external-dns#2001

@k0da k0da merged commit 0f1dbb3 into master Mar 9, 2021
@somaritane somaritane deleted the crd_v1 branch March 9, 2021 20:49
@ytsarev ytsarev mentioned this pull request Mar 16, 2021
1 task
@somaritane somaritane linked an issue Mar 22, 2021 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrate off deprecated APIs
3 participants