Class: K8y::REST::ConfigValidator
- Inherits:
-
Object
- Object
- K8y::REST::ConfigValidator
- Defined in:
- lib/k8y/rest/config_validator.rb
Defined Under Namespace
Classes: ValidationError
Constant Summary collapse
- VALIDATIONS =
[ :validate_auth_info, :validate_context, :validate_cluster, :validate_usable, ].freeze
Instance Method Summary collapse
-
#initialize(kubeconfig, context:) ⇒ ConfigValidator
constructor
A new instance of ConfigValidator.
- #validate! ⇒ Object
Constructor Details
#initialize(kubeconfig, context:) ⇒ ConfigValidator
Returns a new instance of ConfigValidator.
20 21 22 23 |
# File 'lib/k8y/rest/config_validator.rb', line 20 def initialize(kubeconfig, context:) @kubeconfig = kubeconfig @context = context end |
Instance Method Details
#validate! ⇒ Object
25 26 27 28 |
# File 'lib/k8y/rest/config_validator.rb', line 25 def validate! errors = VALIDATIONS.map { |validation| send(validation) }.compact raise ValidationError, errors if errors.present? end |