Class: Gitlab::Kubernetes::ClusterRoleBinding

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/kubernetes/cluster_role_binding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, cluster_role_name, subjects) ⇒ ClusterRoleBinding

Returns a new instance of ClusterRoleBinding.


8
9
10
11
12
# File 'lib/gitlab/kubernetes/cluster_role_binding.rb', line 8

def initialize(name, cluster_role_name, subjects)
  @name = name
  @cluster_role_name = cluster_role_name
  @subjects = subjects
end

Instance Attribute Details

#cluster_role_nameObject (readonly)

Returns the value of attribute cluster_role_name


6
7
8
# File 'lib/gitlab/kubernetes/cluster_role_binding.rb', line 6

def cluster_role_name
  @cluster_role_name
end

#nameObject (readonly)

Returns the value of attribute name


6
7
8
# File 'lib/gitlab/kubernetes/cluster_role_binding.rb', line 6

def name
  @name
end

#subjectsObject (readonly)

Returns the value of attribute subjects


6
7
8
# File 'lib/gitlab/kubernetes/cluster_role_binding.rb', line 6

def subjects
  @subjects
end

Instance Method Details

#generateObject


14
15
16
17
18
19
20
# File 'lib/gitlab/kubernetes/cluster_role_binding.rb', line 14

def generate
  ::Kubeclient::Resource.new.tap do |resource|
    resource. = 
    resource.roleRef = role_ref
    resource.subjects = subjects
  end
end