Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Compat changes #24

Merged
merged 5 commits into from
Apr 9, 2021
Merged

Compat changes #24

merged 5 commits into from
Apr 9, 2021

Conversation

sonnysideup
Copy link
Contributor

@sonnysideup sonnysideup commented Apr 9, 2021

Helm Chart

  • relaxes kubeVersion constraint to allow deployment to v1.15 clusters
  • supports admissionregistration.k8s.io/v1beta1 API version so that mutating and validating webhook configurations can be used in v1.15 clusters

Code Changes

  • Generates CRDs in both v1 and v1beta1 formats
  • CRD apply/delete logic branches based on retrieved K8s version (i.e. if version is >= 1.1.6, use V1 API, else use V1Beta1)

we need to tack on a a trailing '-0' to account for pre-releases since
certain distros of k8s (e.g. GKE) append suffixes to their release names
degrades to v1.15 and makes admissionregistration apiVersion values
dynamic based on k8s version
- generating v1beta1 CRDs with Make
- updating crd code to switch between v1 and v1beta1 interfaces/types
so they work with the v1beta1 crds present. we're largely concerned with v1
functionality so this change just removes the other definitions.
@codecov
Copy link

codecov bot commented Apr 9, 2021

Codecov Report

Merging #24 (65654a7) into main (22e657e) will decrease coverage by 3.10%.
The diff coverage is 28.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
- Coverage   79.75%   76.64%   -3.11%     
==========================================
  Files          24       25       +1     
  Lines        1531     1593      +62     
==========================================
  Hits         1221     1221              
- Misses        223      280      +57     
- Partials       87       92       +5     
Impacted Files Coverage Δ
pkg/crd/v1beta1.go 0.00% <0.00%> (ø)
pkg/crd/crd.go 53.52% <78.12%> (+8.20%) ⬆️
controllers/sparkcluster_controller.go 42.66% <0.00%> (-4.89%) ⬇️
controllers/raycluster_controller.go 44.34% <0.00%> (+0.90%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 22e657e...65654a7. Read the comment docs.

@sonnysideup sonnysideup marked this pull request as ready for review April 9, 2021 14:29
@sonnysideup sonnysideup requested a review from a team April 9, 2021 14:29
@sonnysideup
Copy link
Contributor Author

@steved @ddl-audi

I tested this against two local clusters, v1.15.12 and v 1.16.15, and the chart/code switching works as expected. My expectation is that we'll remove support for v1.15 in the near future and, of course, I'm happy to help push this forward in any way possible.

Re: code changes, the k8s.io/apiextensions-apiserver pkg defines separate interfaces/clients/types for the different versions. This makes it difficult to create reusable functions that leverage a single interface. 😞 Instead, I create a separate set of duplicate, "v1beta1" functions and tried to limit my modifications to the existing code paths (because of my formerly-stated expectation). It's not DRY, I can't look at myself in the mirror right now, but this works.

@sonnysideup sonnysideup requested a review from steved April 9, 2021 15:31
pkg/crd/v1beta1.go Show resolved Hide resolved
@sonnysideup sonnysideup merged commit d350e5b into main Apr 9, 2021
@sonnysideup sonnysideup deleted the compat-changes branch April 9, 2021 18:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants