kubernetes-sigs / kubebuilder-declarative-pattern

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

mockkubeapiserver: deployments should become healthy #320

Closed justinsb closed 1 year ago

justinsb commented 1 year ago

Write some simple stub-logic so that deployments immediately have a status indicating that they are ready.

justinsb commented 1 year ago

/wip

justinsb commented 1 year ago

/test pull-declarative-test

justinsb commented 1 year ago

/test pull-declarative-test

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb, yuwenma

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
yuwenma commented 1 year ago

/lgtm

atoato88 commented 1 year ago

/lgtm I also agree with this update.

atoato88 commented 1 year ago

/retest Can we pass the test? :thinking:

yuwenma commented 1 year ago

/retest Can we pass the test? 🤔

The e2e test is bundled with a specific mock-kubeapiserver, so the e2e test won't pass until this PR is merged and then we bump the mockkubeapiserver in the main k-d-p. Justin has another improvement on having the e2e test using the latest mockkubeapiserver, which itself is blocked by the flaky results that this PR supposes to help 😅

justinsb commented 1 year ago

I'm trying to get the tests to pass by cherry-picking #321 onto this branch, so that we can see them pass together and merge them as one. (#321 has lgtm so would merge if tests passed, but it would be good to prove that the combination here does indeed pass tests!)

yuwenma commented 1 year ago

/lgtm

justinsb commented 1 year ago

/test pull-declarative-test

This is the kubectl discovery being non-deterministic. I think that's the remaining big source of non-determinism. I had a look at the code this morning and I didn't see a problem ... but I'm going to keep looking.

justinsb commented 1 year ago

I have a theory that #324 is the cause of the dropped kubectl discovery requests - it isn't that kubectl isn't making them, it is that we aren't recording them (which makes a lot of sense, we wouldn't expect a bug of this nature in kubectl)

justinsb commented 1 year ago

/test pull-declarative-test