Skip to content

Enable CRD validation generation for Helm and Ansible #3770

@camilamacedo86

Description

@camilamacedo86

Feature Request

Is your feature request related to a problem? Please describe.

When we scaffold a project using a chart for example, the CRs will be automatically created with the chart values but the CRD will not be created with these data.

For Go, the CRDs are updated when we run make manifests via controller-gen and because of this, the projects pass by default in the scorecard-test olm-crds-have-validation which is not achievable with Helm or Ansible.

For reference using helm operator-sdk-sample:

$ cd ~/devel/operator-sdk-samples/helm/memcached-operator
$ operator-sdk scorecard ./bundle --selector=suite=olm

SNIP...
--------------------------------------------------------------------------------
Image:      quay.io/operator-framework/scorecard-test:master
Entrypoint: [scorecard-test olm-crds-have-validation]
Labels:
	"suite":"olm"
	"test":"olm-crds-have-validation-test"
Results:
	Name: olm-crds-have-validation
	State: fail

	Suggestions:
		Add CRD validation for spec field `metrics` in Memcached/v1alpha1
		Add CRD validation for spec field `podAnnotations` in Memcached/v1alpha1
		Add CRD validation for spec field `updateStrategy` in Memcached/v1alpha1
		Add CRD validation for spec field `extraContainers` in Memcached/v1alpha1
		Add CRD validation for spec field `image` in Memcached/v1alpha1
		Add CRD validation for spec field `kind` in Memcached/v1alpha1
		Add CRD validation for spec field `pdbMinAvailable` in Memcached/v1alpha1
		Add CRD validation for spec field `replicaCount` in Memcached/v1alpha1
		Add CRD validation for spec field `securityContext` in Memcached/v1alpha1
		Add CRD validation for spec field `tolerations` in Memcached/v1alpha1
		Add CRD validation for spec field `affinity` in Memcached/v1alpha1
		Add CRD validation for spec field `memcached` in Memcached/v1alpha1
		Add CRD validation for spec field `resources` in Memcached/v1alpha1
		Add CRD validation for spec field `serviceAnnotations` in Memcached/v1alpha1
		Add CRD validation for spec field `AntiAffinity` in Memcached/v1alpha1
		Add CRD validation for spec field `nodeSelector` in Memcached/v1alpha1
		Add CRD validation for spec field `extraVolumes` in Memcached/v1alpha1
	Log:
		Loaded 1 Custom Resources from alm-examples
		Loaded CustomresourceDefinitions: [&CustomResourceDefinition{ObjectMeta:{memcacheds.cac

Describe the solution you'd like

Have a target similar to make manifests for Helm/Ansible.

Maybe we could implement a similar feature which would:

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.needs discussion

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions