kubernetes-sigs / kubebuilder-declarative-pattern

A toolkit for building declarative operators with kubebuilder
Apache License 2.0
254 stars 84 forks source link

WIP: mockkubeapiserver: some schema awareness #257

Closed justinsb closed 1 year ago

justinsb commented 1 year ago

Enough to support patch/merge a little better.

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

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-sigs/kubebuilder-declarative-pattern/blob/master/OWNERS)~~ [justinsb] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
justinsb commented 1 year ago

/assign @apelisse

apelisse commented 1 year ago

APIServer/fieldmanager contains the code that uses smd in Kubernetes.

You need a Parser in order to parse YAML objects into something that you can Apply or Update. It's done by instantiating a FieldManager, but this requires a bunch of version convertor, defaulter and creator that you can probably fake. There's an example for tests but it's not exported, so you can't re-use it, there's https://github.com/kubernetes/kubernetes/pull/110565 attempting to do just that.

justinsb commented 1 year ago

Thanks - I started to give that a go in https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/pull/270 .. it looks pretty good!

justinsb commented 1 year ago

Marking as WIP in favor of the approach in #270

k8s-ci-robot commented 1 year ago

@justinsb: PR needs rebase.

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/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
justinsb commented 1 year ago

Merged the approach in #270 instead - thanks @apelisse :-)

/close

k8s-ci-robot commented 1 year ago

@justinsb: Closed this PR.

In response to [this](https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/pull/257#issuecomment-1316756176): >Merged the approach in #270 instead - thanks @apelisse :-) > >/close 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/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.