diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-06-19 02:02:43 +0000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2019-06-19 02:02:43 +0000 |
commit | 02fad28a52ae192e72413eb1dcf80f8f2e990f43 (patch) | |
tree | bbbd330588a1ea19eef2c6ee04356d81af50d4a1 | |
parent | bb34f09fbe04b9cc915211c1af262068ef792994 (diff) | |
parent | 1a3d6ad649e796585005e35c0d5a662610a988ea (diff) | |
download | gitlab-ce-02fad28a52ae192e72413eb1dcf80f8f2e990f43.tar.gz |
Merge branch 'remove-support-for-app-label-matching' into 'master'
Remove support for app label matching
See merge request gitlab-org/gitlab-ce!29460
-rw-r--r-- | doc/user/project/deploy_boards.md | 3 | ||||
-rw-r--r-- | lib/gitlab/kubernetes.rb | 7 | ||||
-rw-r--r-- | spec/lib/gitlab/kubernetes_spec.rb | 10 |
3 files changed, 2 insertions, 18 deletions
diff --git a/doc/user/project/deploy_boards.md b/doc/user/project/deploy_boards.md index 0994c51abb2..b7f6a855cb6 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 d46b5e3aee3..1103a4eed1d 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 57b570a9166..45369b91ed6 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] |