kubernetes-client / haskell

Haskell client for the kubernetes API. A work in progress.
Apache License 2.0
127 stars 59 forks source link

Support all Kubernetes versions 1.20 through 1.30 #107

Closed thomasjm closed 2 months ago

thomasjm commented 4 months ago

I noticed that when trying to use certain Kubernetes endpoints with this library (such as DELETE of a Service), the response would fail to parse.

Looking into it, I found it's because kubernetes-client-core is currently generated against K8S release 1.20, which is rather old at this point. The K8S API is pretty stable, but not stable enough that such an old version will work flawlessly against a newer cluster (mine is 1.27).

So, I decided to generate kubernetes-client-core for all versions from 1.20 through 1.30. These are now stored in the folders ./kubernetes-1.xx. I think it would be nice to publish all of these to Hackage using their version numbers, but for now it's easy to use in a stack.yaml like this:

# stack.yaml
# ...

extra-deps:
# For a project targeting Kubernetes 1.27
- git: https://github.com/codedownio/kubernetes-client-haskell.git
  commit: 47d88d7061cda5227c8f7819e3a640c7dea247f3
  subdirs:
  - kubernetes-1.27
  - kubernetes-client

I also:

I think the results are good. You can now easily choose the version of the K8S API you want to target. And a git clone is still plenty fast, with each autogenerated folder only contributing around 6MB uncompressed.

CC @jonschoning @akshaymankar @guoshimin

k8s-ci-robot commented 4 months ago

Hi @thomasjm. Thanks for your PR.

I'm waiting for a kubernetes-client member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
fuadimanov commented 2 months ago

Is anyone going to merge this?

thomasjm commented 2 months ago

I'm thinking about just publishing it on Hackage myself.

jonschoning commented 2 months ago

/approve /lgtm

k8s-ci-robot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jonschoning, thomasjm

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

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-client/haskell/blob/master/OWNERS)~~ [jonschoning] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
jonschoning commented 2 months ago

/lgtm

k8s-ci-robot commented 2 months ago

@thomasjm: 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
kubernetes-clients-haskell-unit-tests a747f6fdc62d34c684709740422497d3c088f8d9 link false /test kubernetes-clients-haskell-unit-tests

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
jonschoning commented 2 months ago

I'm thinking about just publishing it on Hackage myself.

I don't have access to the hackage repo, I think that's @akshaymankar