Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate register functions for APIs #2023

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

damemi
Copy link
Contributor

@damemi damemi commented Dec 18, 2024

This updates api/hack/update-codegen.sh to call gen_register, which generates register code for our APIs. This also fixes broken code for calls to Resource()

@damemi damemi requested a review from blumamir December 18, 2024 18:19
@@ -39,7 +39,7 @@ func RenameAttribute(name, namespace string) *RenameAttributeApplyConfiguration
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("RenameAttribute")
b.WithAPIVersion("actions/v1alpha1")
b.WithAPIVersion("actions.odigos.io/v1alpha1")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check this, might be a mistake

@damemi
Copy link
Contributor Author

damemi commented Dec 18, 2024

Going to hold on merging this, there are a bunch of weird warnings when generating the clients such as:

$ make generate-client
GOWORK=off go mod vendor
./hack/update-codegen.sh
Generating register code for 2 targets
W1218 15:42:34.862642   72290 parse.go:817] Making unsupported type entry "any" for: &types.Alias{obj:(*types.TypeName)(0x14000132b90), orig:(*types.Alias)(0x140001120c0), tparams:(*types.TypeParamList)(nil), targs:(*types.TypeList)(nil), fromRHS:(*types.Interface)(0x14000132af0), actual:(*types.Interface)(0x14000132af0)}
W1218 15:42:34.863196   72290 parse.go:817] Making unsupported type entry "reflect.uncommonType" for: &types.Alias{obj:(*types.TypeName)(0x14001eca500), orig:(*types.Alias)(0x140012e9100), tparams:(*types.TypeParamList)(nil), targs:(*types.TypeList)(nil), fromRHS:(*types.Named)(0x1400082ed20), actual:(*types.Named)(0x1400082ed20)}

which seems to be an actual issue due to kubernetes/gengo#281. Unfortunately, the version of k8s.io/code-generator that pulls in the gengo fix is also currently broken due to kubernetes/kubernetes#129290 (caused by a different change in gengo)

@BenElferink BenElferink added the enhancement New feature or request label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants