Sha256: 8dc754f979cad85fa203add9298e1d7f815a3ba565a578dc81818c53003510cd
Contents?: true
Size: 1.14 KB
Versions: 56
Compression:
Stored size: 1.14 KB
Contents
# frozen_string_literal: true module Krane class DeployTaskConfigValidator < TaskConfigValidator def initialize(protected_namespaces, prune, *arguments) super(*arguments) @protected_namespaces = protected_namespaces @allow_protected_ns = !protected_namespaces.empty? @prune = prune @validations += %i(validate_protected_namespaces) end private def validate_protected_namespaces if @protected_namespaces.include?(namespace) if @allow_protected_ns && @prune @errors << "Refusing to deploy to protected namespace '#{namespace}' with pruning enabled" elsif @allow_protected_ns logger.warn("You're deploying to protected namespace #{namespace}, which cannot be pruned.") logger.warn("Existing resources can only be removed manually with kubectl. " \ "Removing templates from the set deployed will have no effect.") logger.warn("***Please do not deploy to #{namespace} unless you really know what you are doing.***") else @errors << "Refusing to deploy to protected namespace '#{namespace}'" end end end end end
Version data entries
56 entries across 56 versions & 2 rubygems