Skip to content

applyconfiguration-gen does not respect the +groupName tag and uses the plain apiVersion #150

Open
@EraYaN

Description

@EraYaN

So when using the Operator-SDK it generates a go file like groupversion_info.go in your main API package. This defines stuff like:

// Package v1alpha1 contains API Schema definitions for the cal.casa.eu v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=group.example.com
// +k8s:deepcopy-gen=package,register
// +k8s:openapi-gen=true
// +genclient
package v1alpha1

I added the genclient and k8s:openapi-gen=true, both of those are ignored by the way and need to be on every type.

But it also ignores the groupName so the applyconfiguration object ends up with

b.WithAPIVersion("v1alpha1")

While I expect

b.WithAPIVersion("group.example.com/v1alpha1")

Which I can fix with sed but I feel like it shouldn't really be a thing. I'm at a loss currently as to how to get it to first respect the tags on the package and then to actually include the groupName.

I got my generation code from here: cert-manager/cert-manager#5383

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions