cloud-8.x-2.0-beta1/modules/cloud_service_providers/k8s/src/Plugin/Validation/Constraint/YamlObjectSupportConstraint.php
modules/cloud_service_providers/k8s/src/Plugin/Validation/Constraint/YamlObjectSupportConstraint.php
<?php
namespace Drupal\k8s\Plugin\Validation\Constraint;
/**
* Check the "Kind" element in the YAML file.
*
* The kind element needs to be supported by the K8s cloud server template.
* Currently only Pod and Deployment are supported.
*
* @Constraint(
* id = "yaml_object_support",
* label = @Translation("Yaml", context = "Validation"),
* )
*/
class YamlObjectSupportConstraint extends YamlArrayDataConstraint {
/**
* Error if object in "Kind" is not supported.
*
* @var string
*/
public $unsupportedObjectType = 'Unsupported object in "Kind" element. Only
Pod or Deployment supported';
/**
* Error if no "Kind" element found in K8s yaml file.
*
* @var string
*/
public $noObjectFound = 'No "Kind" element found.';
}
