Sha256: a8dace8745e2df5ac5d7024d0d10b6f5a4eaac579797d7a8a61ed90900804dc8
Contents?: true
Size: 386 Bytes
Versions: 3
Compression:
Stored size: 386 Bytes
Contents
require 'json' class KubernetesAnnotationsTagAppender attr_reader :annotations def initialize(annotations) @annotations = annotations end def append(tag, data, container_name) matches = annotations.select do | annotation | json = data[annotation] || "[]" JSON.parse(json)&.include? container_name end return ([tag] + matches).join(".") end end
Version data entries
3 entries across 3 versions & 1 rubygems