Skip to content

How to set custom validation on CRD using oneOf #1844

@ffoysal

Description

@ffoysal

I have a struct

type Volume struct {
	VolumeClaim string `json:"existingVolumeClaim,omitempty" yaml:"existingVolumeClaim,omitempty"`
	HostPath            string `json:"hostPath,omitempty" yaml:"hostPath,omitempty"`
}

In the CR the app should accept either VolumeClaim or HostPath not both. How to set this validation in the generated CRD. In terms functionality it will be similar to oneOf keyword

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