Commit 3554a22b authored by Albert Salim's avatar Albert Salim

Include resource type in `KubernetesClient#raw_resource_names`

parent 5cd90761
...@@ -63,7 +63,7 @@ module Quality ...@@ -63,7 +63,7 @@ module Quality
'get', 'get',
RESOURCE_LIST, RESOURCE_LIST,
%(--namespace "#{namespace}"), %(--namespace "#{namespace}"),
'-o custom-columns=NAME:.metadata.name' '-o name'
] ]
run_command(command).lines.map(&:strip) run_command(command).lines.map(&:strip)
end end
......
...@@ -102,7 +102,7 @@ RSpec.describe Quality::KubernetesClient do ...@@ -102,7 +102,7 @@ RSpec.describe Quality::KubernetesClient do
it 'calls kubectl to retrieve the resource names' do it 'calls kubectl to retrieve the resource names' do
expect(Gitlab::Popen).to receive(:popen_with_detail) expect(Gitlab::Popen).to receive(:popen_with_detail)
.with(["kubectl get #{described_class::RESOURCE_LIST} " + .with(["kubectl get #{described_class::RESOURCE_LIST} " +
%(--namespace "#{namespace}" -o custom-columns=NAME:.metadata.name)]) %(--namespace "#{namespace}" -o name)])
.and_return(Gitlab::Popen::Result.new([], raw_resource_names_str, '', double(success?: true))) .and_return(Gitlab::Popen::Result.new([], raw_resource_names_str, '', double(success?: true)))
expect(subject.__send__(:raw_resource_names)).to eq(raw_resource_names) expect(subject.__send__(:raw_resource_names)).to eq(raw_resource_names)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment