Skip to content

Commit

Permalink
Merge pull request #65 from ngtuna/client-go-v4
Browse files Browse the repository at this point in the history
Bump up client-go v4.0
  • Loading branch information
prydonius authored Nov 29, 2017
2 parents d45ef5e + a12aa7e commit 6dedd8d
Show file tree
Hide file tree
Showing 2,238 changed files with 339,303 additions and 209,530 deletions.
34 changes: 13 additions & 21 deletions cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,30 @@ package cmd
import (
"fmt"
"io"
"os"
"strconv"
"strings"

"github.com/gosuri/uitable"
"github.com/ksonnet/kubecfg/metadata"
"github.com/ksonnet/kubecfg/pkg/kubecfg"
"github.com/ksonnet/kubecfg/utils"
"github.com/kubeapps/kubeapps/pkg/gke"
"github.com/spf13/cobra"
k8sErrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/discovery"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/pkg/apis/apps/v1beta1"
k8sErrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
)

const (
GcTag = "bitnami/kubeapps"
KubeappsNS = "kubeapps"
KubelessNS = "kubeless"
SystemNS = "kube-system"
Kubeapps_NS = "kubeapps"
GcTag = "bitnami/kubeapps"
KubeappsNS = "kubeapps"
KubelessNS = "kubeless"
SystemNS = "kube-system"
Kubeapps_NS = "kubeapps"
MongoDB_Secret = "mongodb"
)

Expand All @@ -60,7 +58,7 @@ List of components that kubeapps up installs:
- Helm/Tiller (https://github.com/kubernetes/helm)
- Kubeapps Dashboard (https://github.com/kubeapps/dashboard)`,
RunE: func(cmd *cobra.Command, args []string) error {
c := kubecfg.ApplyCmd{
c := kubecfg.UpdateCmd{
DefaultNamespace: "default",
}
var err error
Expand All @@ -87,12 +85,6 @@ List of components that kubeapps up installs:
return fmt.Errorf("kubernetes with RBAC enabled (v1.7+) is required to run Kubeapps")
}

cwd, err := os.Getwd()
if err != nil {
return fmt.Errorf("can't get current directory: %v", err)
}
wd := metadata.AbsPath(cwd)

manifest, err := fsGetFile("/kubeapps-objs.yaml")
if err != nil {
return fmt.Errorf("can't read kubeapps manifest: %v", err)
Expand Down Expand Up @@ -126,7 +118,7 @@ List of components that kubeapps up installs:
// this clusterrolebinding will be created before others for granting the proper permission.
// when the installation finishes, it will be gc'd immediately.
c.SkipGc = true
err = c.Run(crb, wd)
err = c.Run(crb)
if err != nil {
return fmt.Errorf("can't assign cluster-admin permission to the current user: %v", err)
}
Expand Down Expand Up @@ -155,7 +147,7 @@ List of components that kubeapps up installs:
objs = append(objs, prevsecret)
}

err = c.Run(objs, wd)
err = c.Run(objs)
if err != nil {
return fmt.Errorf("can't install kubeapps components: %v", err)
}
Expand Down Expand Up @@ -218,14 +210,14 @@ func printOutput(w io.Writer, c *kubernetes.Clientset) error {
return nil
}

func mongoSecretExists(c kubecfg.ApplyCmd, name, ns string) (*unstructured.Unstructured, bool, error) {
func mongoSecretExists(c kubecfg.UpdateCmd, name, ns string) (*unstructured.Unstructured, bool, error) {
gvk := schema.GroupVersionKind{Version: "v1", Kind: "Secret"}
rc, err := clientForGroupVersionKind(c.ClientPool, c.Discovery, gvk, ns)
if err != nil {
return nil, false, err
}
pwFields := []string{"mongodb-password", "mongodb-root-password"}
prevSec, err := rc.Get(name)
prevSec, err := rc.Get(name, metav1.GetOptions{})

if k8sErrors.IsNotFound(err) {
return nil, false, nil
Expand Down
71 changes: 31 additions & 40 deletions glide.lock

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

8 changes: 6 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package: github.com/kubeapps/kubeapps
import:
- package: k8s.io/client-go
version: ^3.0.0
version: ^4.0.0
subpackages:
- pkg/api
- dynamic
- discovery
- tools/clientcmd
- plugin/pkg/client/auth/gcp
- package: k8s.io/apimachinery
version: 917740426ad66ff818da4809990480bcc0786a77
- package: github.com/ksonnet/kubecfg
version: 897a3db8a83ca195a2825b1fabe59ffca103e700
version: 1d656906cf6b19e94a02619f2f7a086ca06ea48e
subpackages:
- utils
- metadata
- pkg/kubecfg
- package: github.com/emicklei/go-restful
version: ff4f55a206334ef123e4f79bbf348980da81ca46
- package: github.com/spf13/cobra
version: f62e98d28ab7ad31d707ba837a966378465c7b57
- package: github.com/spf13/pflag
Expand Down
4 changes: 4 additions & 0 deletions vendor/github.com/emicklei/go-restful-swagger12/.travis.yml

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

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

Loading

0 comments on commit 6dedd8d

Please sign in to comment.