From c60b6d6aa1eb450f6ef23fc32c064ec47f52dad7 Mon Sep 17 00:00:00 2001 From: Jared Patrick Date: Mon, 5 Oct 2020 15:58:49 +0000 Subject: [PATCH 1/2] ansible-operator|helm-operator: add the kubernetes auth clients This PR adds the kubernetes auth clients to the ansible-operator and helm-operator binaries. Closes #3973 --- changelog/fragments/fix-ansible-helm-auth-providers.yaml | 8 ++++++++ cmd/ansible-operator/main.go | 4 ++++ cmd/helm-operator/main.go | 4 ++++ 3 files changed, 16 insertions(+) create mode 100644 changelog/fragments/fix-ansible-helm-auth-providers.yaml diff --git a/changelog/fragments/fix-ansible-helm-auth-providers.yaml b/changelog/fragments/fix-ansible-helm-auth-providers.yaml new file mode 100644 index 0000000000..215374cad5 --- /dev/null +++ b/changelog/fragments/fix-ansible-helm-auth-providers.yaml @@ -0,0 +1,8 @@ +entries: + - description: > + Added kubernetes authentication clients to `ansible-operator` and + `helm-operator` to enable authentication to gcp, azure, etc. kubernetes + clusters. + + kind: bugfix + breaking: false diff --git a/cmd/ansible-operator/main.go b/cmd/ansible-operator/main.go index 78db568b61..9af2890fa8 100644 --- a/cmd/ansible-operator/main.go +++ b/cmd/ansible-operator/main.go @@ -17,6 +17,10 @@ package main import ( "log" + // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) + // to ensure that `exec-entrypoint` and `run` can make use of them. + _ "k8s.io/client-go/plugin/pkg/client/auth" + "github.com/spf13/cobra" "github.com/operator-framework/operator-sdk/internal/cmd/ansible-operator/run" diff --git a/cmd/helm-operator/main.go b/cmd/helm-operator/main.go index 7332e9564e..ab672833bd 100644 --- a/cmd/helm-operator/main.go +++ b/cmd/helm-operator/main.go @@ -17,6 +17,10 @@ package main import ( "log" + // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) + // to ensure that `exec-entrypoint` and `run` can make use of them. + _ "k8s.io/client-go/plugin/pkg/client/auth" + "github.com/spf13/cobra" "github.com/operator-framework/operator-sdk/internal/cmd/helm-operator/run" From f0bded8e7bf14bdb26a56398dd14ade5a59f3c10 Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Mon, 5 Oct 2020 17:38:43 -0400 Subject: [PATCH 2/2] cmd/ansible|helm-operator: minor nit improvements --- cmd/ansible-operator/main.go | 5 +---- cmd/helm-operator/main.go | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cmd/ansible-operator/main.go b/cmd/ansible-operator/main.go index 9af2890fa8..12f79ce780 100644 --- a/cmd/ansible-operator/main.go +++ b/cmd/ansible-operator/main.go @@ -17,11 +17,8 @@ package main import ( "log" - // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) - // to ensure that `exec-entrypoint` and `run` can make use of them. - _ "k8s.io/client-go/plugin/pkg/client/auth" - "github.com/spf13/cobra" + _ "k8s.io/client-go/plugin/pkg/client/auth" "github.com/operator-framework/operator-sdk/internal/cmd/ansible-operator/run" "github.com/operator-framework/operator-sdk/internal/cmd/ansible-operator/version" diff --git a/cmd/helm-operator/main.go b/cmd/helm-operator/main.go index ab672833bd..c223adcea3 100644 --- a/cmd/helm-operator/main.go +++ b/cmd/helm-operator/main.go @@ -17,11 +17,8 @@ package main import ( "log" - // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) - // to ensure that `exec-entrypoint` and `run` can make use of them. - _ "k8s.io/client-go/plugin/pkg/client/auth" - "github.com/spf13/cobra" + _ "k8s.io/client-go/plugin/pkg/client/auth" "github.com/operator-framework/operator-sdk/internal/cmd/helm-operator/run" "github.com/operator-framework/operator-sdk/internal/cmd/helm-operator/version"