Skip to content

Commit 78b3942

Browse files
committed
Use typed versioned client for CRD
1 parent b857b05 commit 78b3942

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

run.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import (
88
"github.com/appscode/go/log"
99
stringz "github.com/appscode/go/strings"
1010
"github.com/appscode/pat"
11-
sapi "github.com/appscode/stash/apis/stash"
11+
api "github.com/appscode/stash/apis/stash"
1212
cs "github.com/appscode/stash/client/typed/stash/v1alpha1"
1313
"github.com/appscode/stash/pkg/controller"
1414
"github.com/appscode/stash/pkg/docker"
1515
"github.com/appscode/stash/pkg/migrator"
1616
"github.com/prometheus/client_golang/prometheus/promhttp"
1717
"github.com/spf13/cobra"
18-
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
18+
crd_cs "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1"
1919
"k8s.io/client-go/kubernetes"
2020
"k8s.io/client-go/tools/clientcmd"
2121
)
@@ -54,7 +54,7 @@ func NewCmdRun(version string) *cobra.Command {
5454
}
5555
kubeClient = kubernetes.NewForConfigOrDie(config)
5656
stashClient = cs.NewForConfigOrDie(config)
57-
crdClient := apiextensionsclient.NewForConfigOrDie(config)
57+
crdClient := crd_cs.NewForConfigOrDie(config)
5858

5959
ctrl := controller.New(kubeClient, crdClient, stashClient, opts)
6060
err = ctrl.Setup()
@@ -75,7 +75,7 @@ func NewCmdRun(version string) *cobra.Command {
7575
m := pat.New()
7676
m.Get("/metrics", promhttp.Handler())
7777

78-
pattern := fmt.Sprintf("/%s/v1beta1/namespaces/%s/restics/%s/metrics", sapi.GroupName, PathParamNamespace, PathParamName)
78+
pattern := fmt.Sprintf("/%s/v1beta1/namespaces/%s/restics/%s/metrics", api.GroupName, PathParamNamespace, PathParamName)
7979
log.Infof("URL pattern: %s", pattern)
8080
m.Get(pattern, http.HandlerFunc(ExportSnapshots))
8181

0 commit comments

Comments
 (0)