diff --git a/api/v1alpha1/classifier_types.go b/api/v1alpha1/classifier_types.go index b44af26..7b063f5 100644 --- a/api/v1alpha1/classifier_types.go +++ b/api/v1alpha1/classifier_types.go @@ -132,6 +132,12 @@ type DeployedResourceConstraint struct { // MaxCount is the maximun number of resources to match // +optional MaxCount *int `json:"maxCount,omitempty"` + + // Script is a text containing a lua script. + // Must return struct with field "matching" + // representing whether object is a match. + // +optional + Script string `json:"script,omitempty"` } type KubernetesComparison string diff --git a/config/crd/bases/lib.projectsveltos.io_classifiers.yaml b/config/crd/bases/lib.projectsveltos.io_classifiers.yaml index 929abdc..0fe8259 100644 --- a/config/crd/bases/lib.projectsveltos.io_classifiers.yaml +++ b/config/crd/bases/lib.projectsveltos.io_classifiers.yaml @@ -123,6 +123,11 @@ spec: description: Namespace of the resource deployed in the Cluster. Empty for resources scoped at cluster level. type: string + script: + description: Script is a text containing a lua script. Must + return struct with field "matching" representing whether object + is a match. + type: string version: description: Version of the resource deployed in the Cluster. type: string diff --git a/lib/crd/classifiers.go b/lib/crd/classifiers.go index 630e5db..4870782 100644 --- a/lib/crd/classifiers.go +++ b/lib/crd/classifiers.go @@ -142,6 +142,11 @@ spec: description: Namespace of the resource deployed in the Cluster. Empty for resources scoped at cluster level. type: string + script: + description: Script is a text containing a lua script. Must + return struct with field "matching" representing whether object + is a match. + type: string version: description: Version of the resource deployed in the Cluster. type: string