summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-05 10:20:03 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-05 10:20:03 +0000
commitd2612b42b9da6638d70b9d7144f6d427070d042d (patch)
treeed7de87d4b112cae8a45ba186d717ca9768c7d4e /lib
parentd80373b353005e70f44eca8a3bc4a4c5cfbf0e9e (diff)
downloadgitlab-ce-d2612b42b9da6638d70b9d7144f6d427070d042d.tar.gz
Add latest changes from gitlab-org/gitlab@15-1-stable-ee
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/kubernetes/kube_client.rb44
1 files changed, 4 insertions, 40 deletions
diff --git a/lib/gitlab/kubernetes/kube_client.rb b/lib/gitlab/kubernetes/kube_client.rb
index cd03e332175..92ffa65fe74 100644
--- a/lib/gitlab/kubernetes/kube_client.rb
+++ b/lib/gitlab/kubernetes/kube_client.rb
@@ -81,6 +81,10 @@ module Gitlab
:update_gateway,
to: :istio_client
+ delegate :get_ingresses, :patch_ingress, to: :networking_client
+
+ delegate :get_deployments, to: :apps_client
+
attr_reader :api_prefix, :kubeclient_options
DEFAULT_KUBECLIENT_OPTIONS = {
@@ -127,46 +131,6 @@ module Gitlab
validate_url!
end
- # Deployments resource is currently on the apis/extensions api group
- # until Kubernetes 1.15. Kubernetest 1.16+ has deployments resources in
- # the apis/apps api group.
- #
- # As we still support Kubernetes 1.12+, we will need to support both.
- def get_deployments(**args)
- extensions_client.discover unless extensions_client.discovered
-
- if extensions_client.respond_to?(:get_deployments)
- extensions_client.get_deployments(**args)
- else
- apps_client.get_deployments(**args)
- end
- end
-
- # Ingresses resource is currently on the apis/extensions api group
- # until Kubernetes 1.21. Kubernetest 1.22+ has ingresses resources in
- # the networking.k8s.io/v1 api group.
- #
- # As we still support Kubernetes 1.12+, we will need to support both.
- def get_ingresses(**args)
- extensions_client.discover unless extensions_client.discovered
-
- if extensions_client.respond_to?(:get_ingresses)
- extensions_client.get_ingresses(**args)
- else
- networking_client.get_ingresses(**args)
- end
- end
-
- def patch_ingress(*args)
- extensions_client.discover unless extensions_client.discovered
-
- if extensions_client.respond_to?(:patch_ingress)
- extensions_client.patch_ingress(*args)
- else
- networking_client.patch_ingress(*args)
- end
- end
-
def create_or_update_cluster_role_binding(resource)
update_cluster_role_binding(resource)
end