kubernetes-sigs / kubernetes-sigs/cluster-api

Conversion errors in unit test logs

Open
#8,605 16 comments 1 reaction 0 assignees View on GitHub
help wanted kind/bug priority/backlog triage/accepted
Dominant language
Go
Stars
4.3k
Forks
1.6k
Avg merge
1d 3h
Merged PRs (30d)
113

Description

### What steps did you take and what happened?

There are a lot of errors in the logs of our conversion unit tests (xref: https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/8007/pull-cluster-api-test-mink8s-main/1654053928607682560/build-log.txt)

> {"Time":"2023-05-04T09:26:31.736455585Z","Action":"output","Package":"sigs.k8s.io/cluster-api/exp/addons/api/v1alpha3","Test":"TestClusterResourceSetConversion","Output":"=== RUN TestClusterResourceSetConversion\n"}
> {"Time":"2023-05-04T09:26:31.832727542Z","Action":"output","Package":"sigs.k8s.io/cluster-api/exp/addons/api/v1alpha3","Test":"TestClusterResourceSetConversion","Output":"E0504 09:26:31.831850 19242 conversion.go:74] conversion-webhook \"msg\"=\"failed to convert\" \"error\"=\"no kind \\\"ClusterResourceSet\\\" is registered for version \\\"addons.cluster.x-k8s.io/v1alpha4\\\" in scheme \\\"pkg/runtime/scheme.go:100\\\"\" \"request\"=\"504bb6d6-33de-4392-85f8-5eff3be8c09d\"\n"}

Note: I'm talking about unit tests like `TestClusterResourceSetConversion` not the fuzz tests.

Basically we run v1alpha3 conversion tests and the error is that v1alpha4 is not registered. I don't really understand why there should be a conversion to v1alpha4. But this also doesn't fail the tests.

Would be interesting to figure out what's going on.

### What did you expect to happen?

No errors in the logs of our conversion unit tests

### Cluster API version

main

### Kubernetes version

_No response_

### Anything else you would like to add?

_No response_

### Label(s) to be applied

/kind bug
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

Contributor guide

Open the contributing guide

Research direction

Start with TestClusterResourceSetConversion in sigs.k8s.io/cluster-api/exp/addons/api/v1alpha3 and inspect conversion.go:74 alongside the linked test log. Trace why the v1alpha3 unit test attempts v1alpha4 conversion and determine why the error is logged without failing the test; done means the conversion tests run without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.