diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/services/ci/generate_kubeconfig_service_spec.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/services/ci/generate_kubeconfig_service_spec.rb')
-rw-r--r-- | spec/services/ci/generate_kubeconfig_service_spec.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/services/ci/generate_kubeconfig_service_spec.rb b/spec/services/ci/generate_kubeconfig_service_spec.rb index e3088ca6ea7..bfde39780dd 100644 --- a/spec/services/ci/generate_kubeconfig_service_spec.rb +++ b/spec/services/ci/generate_kubeconfig_service_spec.rb @@ -9,6 +9,8 @@ RSpec.describe Ci::GenerateKubeconfigService do let(:pipeline) { build.pipeline } let(:agent1) { create(:cluster_agent, project: project) } let(:agent2) { create(:cluster_agent) } + let(:authorization1) { create(:agent_project_authorization, agent: agent1) } + let(:authorization2) { create(:agent_project_authorization, agent: agent2) } let(:template) { instance_double(Gitlab::Kubernetes::Kubeconfig::Template) } @@ -16,7 +18,7 @@ RSpec.describe Ci::GenerateKubeconfigService do before do expect(Gitlab::Kubernetes::Kubeconfig::Template).to receive(:new).and_return(template) - expect(pipeline).to receive(:authorized_cluster_agents).and_return([agent1, agent2]) + expect(pipeline).to receive(:cluster_agent_authorizations).and_return([authorization1, authorization2]) end it 'adds a cluster, and a user and context for each available agent' do @@ -36,11 +38,13 @@ RSpec.describe Ci::GenerateKubeconfigService do expect(template).to receive(:add_context).with( name: "#{project.full_path}:#{agent1.name}", + namespace: 'production', cluster: 'gitlab', user: "agent:#{agent1.id}" ) expect(template).to receive(:add_context).with( name: "#{agent2.project.full_path}:#{agent2.name}", + namespace: 'production', cluster: 'gitlab', user: "agent:#{agent2.id}" ) |