BZ 2087504: Add Early test to check for CRD subresource.status#26954
Conversation
4347b5a to
9af899c
Compare
|
/retest |
|
|
||
| // check_crds returns a list of names of CRDs that don't have subresource.status | ||
| // For now, it ignores the ones that are currently failing. | ||
| func check_crds(crd_item_list []v1.CustomResourceDefinition) []string { |
There was a problem hiding this comment.
checkCRDs is the general go format.
| } | ||
|
|
||
| failures := []string{} | ||
| for _, crd_item := range crd_item_list { |
There was a problem hiding this comment.
crdItem, crdItemList typically in go. (for these and any other vars/funcs in here, see https://go.dev/doc/effective_go#mixed-caps
| } | ||
|
|
||
| // Use the latest version | ||
| index := len(crd_item.Spec.Versions) - 1 |
There was a problem hiding this comment.
Is the latest version always the last in the list?
There was a problem hiding this comment.
Hm... I looked at the version name field and it can be something like v1, v1beta, etc. and so we can't tell which one is latest. So I added a loop to check all versions. It turns out today, there is only one version in all of the CRDs ending in openshift.io.
There was a problem hiding this comment.
Ah good, that makes sense, I recall it was a pretty huge pain to support more than one version at a time.
| }) | ||
| }) | ||
|
|
||
| func get_crd_item_list(crdClient apiextensionsclientset.Clientset) ([]v1.CustomResourceDefinition, error) { |
| // check_crd_subresource_status gets the list of CustomeResourceDefinitions and | ||
| // checks if the subresource.status stanza is present. It also does a count. | ||
| // This is meant to be a test you can run outside of CI. | ||
| // |
There was a problem hiding this comment.
We don't want to commit this second variant correct?
It should be possible to run a specific ginko test, assuming you've oc login'd to the correct cluster under test,
$ with make && ./openshift-tests run-test "[sig-arch] ClusterOperators should define valid related objects [Suite:openshift/conformance/parallel]"
There was a problem hiding this comment.
I tried the command above (but just built openshift-tests separately and ran it) and it works. So I remove it. Thanks for the tip.
9af899c to
c1968d6
Compare
|
/retest-required |
91498a7 to
c83df77
Compare
|
/retest-required |
|
/lgtm |
| e2e "k8s.io/kubernetes/test/e2e/framework" | ||
|
|
||
| exutil "github.com/openshift/origin/test/extended/util" | ||
| v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" |
There was a problem hiding this comment.
alias as apiextensionsv1 for consistency
| for i := 0; i < len(crdItem.Spec.Versions); i++ { | ||
|
|
||
| versionName = crdItem.Spec.Versions[i].Name | ||
| if crdItem.Spec.Versions[i].Subresources == nil { |
There was a problem hiding this comment.
if any version has a status, that will be good enough. As opposed to requiring all versions to have a status.
There was a problem hiding this comment.
This doesn't look addressed, still looks like we fail for any version missing status.
I'd expect a bool foundVersionWithStatusSubresource, add to failures outside the loop if it never got set to true.
a5ef5f9 to
f43e620
Compare
| } | ||
|
|
||
| // Iterate through all versions of the Spec. | ||
| var versionName string |
There was a problem hiding this comment.
No need to define this outside the loop.
f43e620 to
774ec60
Compare
|
/lgtm |
|
/retest-required |
1 similar comment
|
/retest-required |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/bugzilla refresh |
|
@DennisPeriquet: No Bugzilla bug is referenced in the title of this pull request. Retaining the bugzilla/valid-bug label as it was manually added. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
9 similar comments
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
@DennisPeriquet: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
7 similar comments
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
TRT-158
The purpose of this test is to enforce (at least for the ones that have it now), spec/status separation by ensuring:
.../statusendpoint) which can be used for the controller to write status.The CRDs that do not pass are treated as "exceptions" for now. We can open up a BZ for them.