Skip to content

pkg/ansible,pkg/helm: import client-go auth plugins #1199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 18, 2019
Merged
103 changes: 100 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
name = "k8s.io/kube-openapi"
revision = "0cf8f7e6ed1d2e3d47d02e3b6e559369af24d803"

# This override is required due to unspecificed dependency versions in
# contrib.go.opencensus.io/exporter/ocagent (v0.2.0), which is a dependency of
# the Azure auth plugin. contrib.go.opencensus.io/exporter/ocagent depends on
# (but does not declare a version constraint for) opencensus-proto. The most
# recent release of opencensus-proto (v0.2.0) breaks ocagent, so we need to
# override it back to a working release.
[[override]]
name = "github.com/census-instrumentation/opencensus-proto"
version = "=v0.1.0"

[[constraint]]
name = "sigs.k8s.io/controller-runtime"
version = "=v0.1.10"
Expand Down
1 change: 0 additions & 1 deletion commands/operator-sdk/cmd/test/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)

type testClusterConfig struct {
Expand Down
4 changes: 4 additions & 0 deletions commands/operator-sdk/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ package main
import (
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that `run` and `up local` can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/operator-framework/operator-sdk/commands/operator-sdk/cmd"
)

Expand Down
3 changes: 3 additions & 0 deletions pkg/scaffold/ansible/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const mainTmpl = `package main
import (
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
_ "k8s.io/client-go/plugin/pkg/client/auth"

aoflags "github.com/operator-framework/operator-sdk/pkg/ansible/flags"
"github.com/operator-framework/operator-sdk/pkg/ansible"
"github.com/operator-framework/operator-sdk/pkg/log/zap"
Expand Down
4 changes: 3 additions & 1 deletion pkg/scaffold/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ import (
"os"
"runtime"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
_ "k8s.io/client-go/plugin/pkg/client/auth"

"{{ .Repo }}/pkg/apis"
"{{ .Repo }}/pkg/controller"

Expand All @@ -52,7 +55,6 @@ import (
"github.com/operator-framework/operator-sdk/pkg/metrics"
sdkVersion "github.com/operator-framework/operator-sdk/version"
"github.com/spf13/pflag"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
Expand Down
4 changes: 3 additions & 1 deletion pkg/scaffold/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ import (
"os"
"runtime"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/example-inc/app-operator/pkg/apis"
"github.com/example-inc/app-operator/pkg/controller"

Expand All @@ -51,7 +54,6 @@ import (
"github.com/operator-framework/operator-sdk/pkg/metrics"
sdkVersion "github.com/operator-framework/operator-sdk/version"
"github.com/spf13/pflag"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
Expand Down
4 changes: 4 additions & 0 deletions pkg/scaffold/gopkgtoml.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ required = [
name = "github.com/coreos/prometheus-operator"
version = "=v0.26.0"

[[override]]
name = "github.com/census-instrumentation/opencensus-proto"
version = "=v0.1.0"

[[override]]
name = "sigs.k8s.io/controller-runtime"
version = "=v0.1.10"
Expand Down
4 changes: 4 additions & 0 deletions pkg/scaffold/gopkgtoml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ required = [
name = "github.com/coreos/prometheus-operator"
version = "=v0.26.0"

[[override]]
name = "github.com/census-instrumentation/opencensus-proto"
version = "=v0.1.0"

[[override]]
name = "sigs.k8s.io/controller-runtime"
version = "=v0.1.10"
Expand Down
3 changes: 3 additions & 0 deletions pkg/scaffold/helm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const mainTmpl = `package main
import (
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
_ "k8s.io/client-go/plugin/pkg/client/auth"

hoflags "github.com/operator-framework/operator-sdk/pkg/helm/flags"
"github.com/operator-framework/operator-sdk/pkg/helm"
"github.com/operator-framework/operator-sdk/pkg/log/zap"
Expand Down
4 changes: 3 additions & 1 deletion pkg/test/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import (
"sync"
"time"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
_ "k8s.io/client-go/plugin/pkg/client/auth"

k8sInternal "github.com/operator-framework/operator-sdk/internal/util/k8sutil"

extscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme"
Expand All @@ -31,7 +34,6 @@ import (
"k8s.io/client-go/discovery/cached"
"k8s.io/client-go/kubernetes"
cgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/client-go/rest"
"k8s.io/client-go/restmapper"
dynclient "sigs.k8s.io/controller-runtime/pkg/client"
Expand Down
4 changes: 3 additions & 1 deletion test/test-framework/cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
"os"
"runtime"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/operator-framework/operator-sdk/pkg/k8sutil"
"github.com/operator-framework/operator-sdk/pkg/leader"
"github.com/operator-framework/operator-sdk/pkg/log/zap"
Expand All @@ -29,7 +32,6 @@ import (
"github.com/operator-framework/operator-sdk/test/test-framework/pkg/controller"
sdkVersion "github.com/operator-framework/operator-sdk/version"
"github.com/spf13/pflag"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
Expand Down
Loading