kube icon indicating copy to clipboard operation
kube copied to clipboard

Automate guarantee that mk8sv is satisified

Open aviramha opened this issue 1 year ago • 4 comments

Followup from:

I think this breaks the Kubernetes version guarantee - requires openapi to upgraded to 1.31 to compile kube-rs as a dependency. @clux

Originally posted by @aviramha in https://github.com/kube-rs/kube/issues/1605#issuecomment-2421919001

An innocent change broke that guarantee and could've slipped to a release. Opening this issue to discuss how we can guarantee that this doesn't happen in the future. My suggestion is to change the dev dependency of openapi to use mk8sv (perhaps run tests both on latest and mk8sv?)

Happy to hear other suggestions

aviramha avatar Oct 18 '24 10:10 aviramha

It's funny because we do run the tests on both versions, but there's clearly a gap here since this got through.

Thanks for raising.

clux avatar Oct 18 '24 10:10 clux

Yeah it's runtime vs compilation - the new version will run on older clusters, just won't compile with "old" openapi

aviramha avatar Oct 18 '24 10:10 aviramha

Yeah. Tbh, this is a reason why parts of me wants to drop k8s-openapi's version choice and turn it into fixed latest because the runtime is way more important than the schemas. If we pin latest we can:

  • drop all the feature madness, e2e tests actualling un-defaulting the feature, and adding in earliest*
  • re-export k8s-openapi exports under a namespace (as in here)
  • avoid people having to update k8s-openapi and kube together (we pin, you get updates)

It's also the versioning strategy most other kubernetes tools on the go side uses (update client-go? cool, dont' stray too far, here's a compatibility matrix, but you get updated structs anyway).

The alternative here is doing more like what we do in the e2e style tests (which do actually run both feature versions).

clux avatar Oct 18 '24 10:10 clux

Okay, sounds like a good plan to me. It's less backward compatible but good trade offs in terms of usability/maintenance and if it's the standard then no reason to stray from that.

aviramha avatar Oct 18 '24 11:10 aviramha