diff --git a/doc/user/project/deploy_boards.md b/doc/user/project/deploy_boards.md index 0994c51abb2de881a6a581b1c9e0a207faf6b1ca..b7f6a855cb6ca880f220bdcac6b9cba7109c281f 100644 --- a/doc/user/project/deploy_boards.md +++ b/doc/user/project/deploy_boards.md @@ -86,8 +86,7 @@ To display the Deploy Boards for a specific [environment] you should: Kubernetes. NOTE: **Note:** - The Kubernetes label of `app` is deprecated and may be removed in next major - release, GitLab 12.0. + Matching based on the Kubernetes `app` label was removed in [GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14020) ![Deploy Boards Kubernetes Label](img/deploy_boards_kubernetes_label.png) diff --git a/lib/gitlab/kubernetes.rb b/lib/gitlab/kubernetes.rb index d46b5e3aee37465062da53a6369bf7c29cc87263..1103a4eed1d850121f154a38792b9628ea739c5b 100644 --- a/lib/gitlab/kubernetes.rb +++ b/lib/gitlab/kubernetes.rb @@ -37,15 +37,10 @@ module Gitlab # Filters an array of pods (as returned by the kubernetes API) by their project and environment def filter_by_project_environment(items, app, env) - pods = filter_by_annotation(items, { + filter_by_annotation(items, { 'app.gitlab.com/app' => app, 'app.gitlab.com/env' => env }) - return pods unless pods.empty? - - filter_by_label(items, { - 'app' => env, # deprecated: replaced by app.gitlab.com/env - }) end # Converts a pod (as returned by the kubernetes API) into a terminal diff --git a/spec/lib/gitlab/kubernetes_spec.rb b/spec/lib/gitlab/kubernetes_spec.rb index 57b570a91661ab0cc78074f3e9c4436f57006e85..45369b91ed69581f960a37549a5fbd706016f967 100644 --- a/spec/lib/gitlab/kubernetes_spec.rb +++ b/spec/lib/gitlab/kubernetes_spec.rb @@ -59,16 +59,6 @@ describe Gitlab::Kubernetes do describe '#filter_by_project_environment' do let(:matching_pod) { kube_pod(environment_slug: 'production', project_slug: 'my-cool-app') } - it 'returns matching legacy env label' do - matching_pod['metadata']['annotations'].delete('app.gitlab.com/app') - matching_pod['metadata']['annotations'].delete('app.gitlab.com/env') - matching_pod['metadata']['labels']['app'] = 'production' - matching_items = [matching_pod] - items = matching_items + [kube_pod] - - expect(filter_by_project_environment(items, 'my-cool-app', 'production')).to eq(matching_items) - end - it 'returns matching env label' do matching_items = [matching_pod] items = matching_items + [kube_pod]