Sha256: 4a76b6d5ee83bf8afaf97c457ae0d29644a850976a283096718a9c5a21c5c5cf
Contents?: true
Size: 549 Bytes
Versions: 8
Compression:
Stored size: 549 Bytes
Contents
module Katello module Validators class ContainerImageNameValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) if value && !ContainerImageNameValidator.validate_name(value) record.errors[attribute] << N_("invalid container image name") end end def self.validate_name(name) if name.empty? || name.length > 255 || !/\A([a-z0-9]+[a-z0-9\-_.]*)+(\/[a-z0-9]+[a-z0-9\-_.]*)*\z/.match?(name) return false end true end end end end
Version data entries
8 entries across 8 versions & 1 rubygems