Skip to content

KAL incorrectly recommends making a *[]corev1.Taint field with MinItems=0 a non-pointer #116

@sbueringer

Description

@sbueringer

We found this while using KAL in Cluster API, xref: kubernetes-sigs/cluster-api#12299 (comment)

The field looks like this

	// +optional
	// +kubebuilder:validation:MinItems=0
	// +kubebuilder:validation:MaxItems=100
	Taints *[]corev1.Taint `json:"taints,omitempty"`

And we get this finding

api/bootstrap/kubeadm/v1beta2/kubeadm_types.go:304:2: optionalfields: field Taints is optional but the underlying type does not need to be a pointer. The pointer should be removed. (kubeapilinter)
        Taints *[]corev1.Taint `json:"taints,omitempty"`
        ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.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