Sha256: f7c6c2c1fa7a655dddb893c8f655ed647b58d294a9ea083f2f6aaaf659b8d40b
Contents?: true
Size: 976 Bytes
Versions: 6
Compression:
Stored size: 976 Bytes
Contents
# frozen_string_literal: true module Metatron module Templates # Template for basic RoleBinding k8s resource class RoleBinding < Template include Concerns::Annotated include Concerns::Namespaced attr_accessor :role_ref, :subjects, :role alias roleRef role_ref def initialize(name, role) super(name) @api_version = "rbac.authorization.k8s.io/v1" @role = role @role_ref = { kind: "Role", name: role.respond_to?(:name) ? role.name : role, apiGroup: "rbac.authorization.k8s.io" } @subjects = [] end def render { apiVersion:, kind:, metadata: { name:, labels: { "#{label_namespace}/name": name }.merge(additional_labels) }.merge(formatted_annotations).merge(formatted_namespace).compact, roleRef:, subjects: }.compact end end end end
Version data entries
6 entries across 6 versions & 1 rubygems