Skip to content

KAL skips List tags linting #147

@avalanche123

Description

@avalanche123

Looks like #134 introduced a change that breaks jsontags linter for list types.

jsontags relies on inspect.InspectFields
InspectFields will skip fields in list types

This makes it possible to define a list type like:

// +kubebuilder:object:root=true

// ResourceList contains a list of Resource
type ResourceList struct {
	metav1.TypeMeta `         json:",inline"`
	metav1.ListMeta `         json:"metadata"`
	Items           []Resource
}

this will lead to json serialization of list as:

{
  "apiVersion": "group/version"
  "kind": "ResourceList",
  "Items": []
}

and such list will miss its items when deserialized back using client-go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions