Introduce a facility to maintain kubernetes_api. Gitlab::Kubernetes::Client
The only change is to move all Kubernetes-related-kubeclient-methods into separate class
Gitlab::Kubernetes::Clientto hide a way how we interact with kubeclient and handle errors.
We introduced a
FetchKubernetesTokenService(app/services/ci/fetch_kubernetes_token_service.rb) in !14470 (merged). This class is almost copied from
KuberntesService(app/models/project_services/kubernetes_service.rb). This is not dry. We should introduce a facility to maintain kubernetes_api and points it from
KuberntesService. And we can remove
The following discussion from !14470 (merged) should be addressed:
@ayufan @nick.thomas This is a class to remove
attr_accessor :username, :passwordfrom
KubernetesService. Previously, we discussed at !14470 (comment 41830601). I know this is ugly but I don't want to tweak
KubernetesServicein this MR. I'll create a follow-up MR as technical debt. Then, we can have time to check if the new facility doesn't break any lagacy
KubernetesServicefunctionality. What do you think?