diff options
Diffstat (limited to 'lib/gitlab/kubernetes/cluster_role.rb')
-rw-r--r-- | lib/gitlab/kubernetes/cluster_role.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/gitlab/kubernetes/cluster_role.rb b/lib/gitlab/kubernetes/cluster_role.rb new file mode 100644 index 00000000000..4d40736a0b5 --- /dev/null +++ b/lib/gitlab/kubernetes/cluster_role.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Gitlab + module Kubernetes + class ClusterRole + attr_reader :name, :rules + + def initialize(name:, rules:) + @name = name + @rules = rules + end + + def generate + ::Kubeclient::Resource.new( + metadata: metadata, + rules: rules + ) + end + + private + + def metadata + { + name: name + } + end + end + end +end |