gitlab-org--gitlab-foss/spec/lib/gitlab/kubernetes/role_spec.rb
Hordur Freyr Yngvason 6971fd261d Give Knative serving permissions to service account
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.
2019-07-11 11:26:15 +00:00

30 lines
654 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::Kubernetes::Role do
let(:role) { described_class.new(name: name, namespace: namespace, rules: rules) }
let(:name) { 'example-name' }
let(:namespace) { 'example-namespace' }
let(:rules) do
[{
apiGroups: %w(hello.world),
resources: %w(oil diamonds coffee),
verbs: %w(say do walk run)
}]
end
describe '#generate' do
subject { role.generate }
let(:resource) do
::Kubeclient::Resource.new(
metadata: { name: name, namespace: namespace },
rules: rules
)
end
it { is_expected.to eq(resource) }
end
end