6971fd261d
GitLab uses a kubernetes service account to perform deployments. For serverless deployments to work as expected with externally created clusters with their own knative installations (e.g. via Cloud Run), this account requires additional permissions in the serving.knative.dev API group.
24 lines
448 B
Ruby
24 lines
448 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module Kubernetes
|
|
class Role
|
|
def initialize(name:, namespace:, rules:)
|
|
@name = name
|
|
@namespace = namespace
|
|
@rules = rules
|
|
end
|
|
|
|
def generate
|
|
::Kubeclient::Resource.new(
|
|
metadata: { name: name, namespace: namespace },
|
|
rules: rules
|
|
)
|
|
end
|
|
|
|
private
|
|
|
|
attr_reader :name, :namespace, :rules
|
|
end
|
|
end
|
|
end
|