diff --git a/glide.lock b/glide.lock index a222d22b1..2b188a1ae 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 69a3a8b7a9d0599e8735c745c07b87edf78b6477d1a040140953079cbf33cc4e -updated: 2018-01-01T19:20:02.612476188+06:00 +hash: 3e4f068ac0ae69a448a4d274d4045d1f8816bce775333188d7b8be3ab5c17654 +updated: 2018-01-06T23:28:17.215504945-08:00 imports: - name: cloud.google.com/go version: fe3d41e1ecb2ce36ad3a979037c9b9a2b726226f @@ -22,19 +22,16 @@ imports: - types - version - name: github.com/appscode/kube-mon - version: dd6884c63ee4615ca9ecdb7f0ca3e35c975bcca3 + version: 7f7ea00b96f4fe39dbcc4fbe405768eae032ba2f subpackages: - api - name: github.com/appscode/kutil - version: a506fd42d3c4d688675c639c9c14c27b79275e73 + version: 4a8306c9183a0dbebfc98327238735a1fb015e6a subpackages: - - core/v1 - meta - tools/analytics -- name: github.com/appscode/mergo - version: e3000cb3d28c72b837601cac94debd91032d19fe - name: github.com/appscode/osm - version: 8e933dfca7c6a2730d77a63282369d843b1db1f4 + version: 8175dd853f6f3d4530b14018901c79140e305f3a subpackages: - context - name: github.com/aws/aws-sdk-go @@ -183,7 +180,7 @@ imports: - proto - sortkeys - name: github.com/golang/glog - version: 23def4e6c14b4da8ac2ed8007337bc5eb5007998 + version: 44145f04b68cf362d9c4df2182967c2275eaefed - name: github.com/golang/groupcache version: 02826c3e79038b59d737d3b1c0a1d937f71a4433 subpackages: @@ -200,7 +197,7 @@ imports: - name: github.com/google/btree version: 7d79101e329e5a3adf994758c578dab82b90c017 - name: github.com/google/go-cmp - version: 97a1ff3c48253a51c601f6e4420181273b6ca0ea + version: 97aa668b73e764ccdd786bc3ccd2edffe621150e subpackages: - cmp - cmp/internal/diff @@ -213,7 +210,7 @@ imports: - name: github.com/google/gofuzz version: 44d81051d367757e1c7c6a5a86423ece9afcf63c - name: github.com/google/uuid - version: e367a344cbe8e08149f9951115dc299ebd42b919 + version: dec09d789f3dba190787f8b4454c7d3c936fed9e - name: github.com/googleapis/gnostic version: 0c5108395e2debce0d731cf0287ddf7242066aba subpackages: @@ -248,7 +245,7 @@ imports: subpackages: - diskcache - name: github.com/hashicorp/go-version - version: ac737305c16432f4c660c6fc68cdcda4b5a0b5ae + version: 1b1de86cf2ec13494b6814b48157884efaf71c54 repo: https://github.com/appscode/go-version.git vcs: git - name: github.com/hashicorp/golang-lru @@ -274,7 +271,7 @@ imports: - name: github.com/juju/ratelimit version: 5b9ff866471762aa2ab2dced63c9fb6f53921342 - name: github.com/kubedb/apimachinery - version: f4fbe461c426dbecefee76e047e3a03058de525c + version: 7604bdfdd4e2b6f1c301847c8d43ecd8e726dc9d subpackages: - apis/kubedb - apis/kubedb/v1alpha1 @@ -284,32 +281,32 @@ imports: - pkg/storage - pkg/validator - name: github.com/kubedb/elasticsearch - version: 86b2b2f0ba1ac7d4b728f3c60c0f5afd7553e124 + version: 02c95056e79e1b0d68c61ce872e7edf608ef030e subpackages: - pkg/docker - pkg/validator - name: github.com/kubedb/memcached - version: 3fba5f4ef8fbb838567fa49c1a8d4313df7887cc + version: 72ac58c2530fdc791555f7b4a3a57491238e8543 subpackages: - pkg/docker - pkg/validator - name: github.com/kubedb/mongodb - version: ef1b6e14ef979cfaa3d40915f0ff5f8cd8db176d + version: a3947346193a6cc127254a853b8816c05c2ab83d subpackages: - pkg/docker - pkg/validator - name: github.com/kubedb/mysql - version: 788ae178f9b3c35c61d814deaa133be1e7b7425a + version: 2f1e4b7d1c3e85daea6c7fe6a1612b3d2859f26d subpackages: - pkg/docker - pkg/validator - name: github.com/kubedb/postgres - version: 4b8df806c06a7f50cca577f182793c6a22c92169 + version: 67472b345441321ec30c48b79f1bcd8ddf5eb3aa subpackages: - pkg/docker - pkg/validator - name: github.com/kubedb/redis - version: f6572764f926062b2e83a8e17571262c70b0a539 + version: 473d2107b6b507531d7ff5d33d9a1e1c6a4b5ffc subpackages: - pkg/docker - pkg/validator @@ -433,7 +430,7 @@ imports: - unicode/norm - width - name: google.golang.org/api - version: 92c31202d4179425301c9ad5a63abd8df45a9674 + version: b1c0f9b3aa8fac163224fab909402d49c6dce50a subpackages: - gensupport - googleapi @@ -483,7 +480,7 @@ imports: - storage/v1 - storage/v1beta1 - name: k8s.io/apiextensions-apiserver - version: 996a70a27a0dcf53642ca52601b9107cb2ad810a + version: d0becfa6529e20309bd6684f8486abc265cf0b59 subpackages: - pkg/apis/apiextensions - pkg/apis/apiextensions/v1beta1 @@ -530,7 +527,6 @@ imports: - pkg/util/httpstream/spdy - pkg/util/intstr - pkg/util/json - - pkg/util/jsonmergepatch - pkg/util/mergepatch - pkg/util/net - pkg/util/rand @@ -549,7 +545,7 @@ imports: - third_party/forked/golang/netutil - third_party/forked/golang/reflect - name: k8s.io/apiserver - version: 2279c12eff8d4d1dc65a104dac36483c1b59ff54 + version: 5f5a3e21b6c737592610cc10da258e88418ab895 subpackages: - pkg/admission - pkg/admission/initializer @@ -853,7 +849,7 @@ imports: - plugin/pkg/scheduler/util - staging/src/k8s.io/apimachinery/pkg/util/rand - name: k8s.io/metrics - version: 1c9c9d9dd5fbc5954f19e06aaa557b34c9857a5c + version: 7c6ce8e360c420e59fb0a8005972ddce5aa5bb9b subpackages: - pkg/apis/metrics - pkg/apis/metrics/v1alpha1 diff --git a/glide.yaml b/glide.yaml index a2422a0d2..f526bbbd3 100644 --- a/glide.yaml +++ b/glide.yaml @@ -5,25 +5,25 @@ import: - package: github.com/appscode/kutil version: release-5.0 - package: github.com/appscode/kube-mon - version: master + version: release-5.0 - package: github.com/ghodss/yaml version: v1.0.0 - package: github.com/golang/glog - package: github.com/jpillora/go-ogle-analytics - package: github.com/kubedb/apimachinery - version: master + version: 0.8.0-beta.0 - package: github.com/kubedb/elasticsearch - version: master + version: 0.8.0-beta.0 - package: github.com/kubedb/postgres - version: master + version: 0.8.0-beta.0 - package: github.com/kubedb/mysql - version: master + version: 0.1.0-beta.0 - package: github.com/kubedb/mongodb - version: master + version: 0.1.0-beta.0 - package: github.com/kubedb/redis - version: master + version: 0.1.0-beta.0 - package: github.com/kubedb/memcached - version: master + version: 0.1.0-beta.0 - package: github.com/spf13/cobra version: master - package: github.com/yudai/gojsondiff @@ -53,7 +53,7 @@ import: - package: golang.org/x/sys version: 7ddbeae9ae08c6a06a59597f0c9edbc5ff2444ce - package: github.com/appscode/kube-mon - version: master + version: release-5.0 - package: github.com/hashicorp/go-version repo: https://github.com/appscode/go-version.git vcs: git diff --git a/vendor/github.com/appscode/kutil/core/v1/configmap.go b/vendor/github.com/appscode/kutil/core/v1/configmap.go deleted file mode 100644 index 1142a43bc..000000000 --- a/vendor/github.com/appscode/kutil/core/v1/configmap.go +++ /dev/null @@ -1,78 +0,0 @@ -package v1 - -import ( - "encoding/json" - "fmt" - - "github.com/appscode/kutil" - "github.com/golang/glog" - core "k8s.io/api/core/v1" - kerr "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" -) - -func CreateOrPatchConfigMap(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.ConfigMap) *core.ConfigMap) (*core.ConfigMap, kutil.VerbType, error) { - cur, err := c.CoreV1().ConfigMaps(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(err) { - glog.V(3).Infof("Creating ConfigMap %s/%s.", meta.Namespace, meta.Name) - out, err := c.CoreV1().ConfigMaps(meta.Namespace).Create(transform(&core.ConfigMap{ - TypeMeta: metav1.TypeMeta{ - Kind: "ConfigMap", - APIVersion: core.SchemeGroupVersion.String(), - }, - ObjectMeta: meta, - })) - return out, kutil.VerbCreated, err - } else if err != nil { - return nil, kutil.VerbUnchanged, err - } - return PatchConfigMap(c, cur, transform) -} - -func PatchConfigMap(c kubernetes.Interface, cur *core.ConfigMap, transform func(*core.ConfigMap) *core.ConfigMap) (*core.ConfigMap, kutil.VerbType, error) { - curJson, err := json.Marshal(cur) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - modJson, err := json.Marshal(transform(cur.DeepCopy())) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - patch, err := strategicpatch.CreateTwoWayMergePatch(curJson, modJson, core.ConfigMap{}) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - if len(patch) == 0 || string(patch) == "{}" { - return cur, kutil.VerbUnchanged, nil - } - glog.V(3).Infof("Patching ConfigMap %s/%s with %s", cur.Namespace, cur.Name, string(patch)) - out, err := c.CoreV1().ConfigMaps(cur.Namespace).Patch(cur.Name, types.StrategicMergePatchType, patch) - return out, kutil.VerbPatched, err -} - -func TryUpdateConfigMap(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.ConfigMap) *core.ConfigMap) (result *core.ConfigMap, err error) { - attempt := 0 - err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { - attempt++ - cur, e2 := c.CoreV1().ConfigMaps(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(e2) { - return false, e2 - } else if e2 == nil { - result, e2 = c.CoreV1().ConfigMaps(cur.Namespace).Update(transform(cur.DeepCopy())) - return e2 == nil, nil - } - glog.Errorf("Attempt %d failed to update ConfigMap %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) - return false, nil - }) - - if err != nil { - err = fmt.Errorf("failed to update ConfigMap %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) - } - return -} diff --git a/vendor/github.com/appscode/kutil/core/v1/kubernetes.go b/vendor/github.com/appscode/kutil/core/v1/kubernetes.go deleted file mode 100644 index e5177a0bd..000000000 --- a/vendor/github.com/appscode/kutil/core/v1/kubernetes.go +++ /dev/null @@ -1,241 +0,0 @@ -package v1 - -import ( - "errors" - - "github.com/appscode/kutil/meta" - "github.com/appscode/mergo" - core "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/conversion" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -func GetGroupVersionKind(v interface{}) schema.GroupVersionKind { - return core.SchemeGroupVersion.WithKind(meta.GetKind(v)) -} - -func AssignTypeKind(v interface{}) error { - _, err := conversion.EnforcePtr(v) - if err != nil { - return err - } - - switch u := v.(type) { - case *core.Pod: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.ReplicationController: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.ConfigMap: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.Secret: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.Service: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.PersistentVolumeClaim: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.PersistentVolume: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.Node: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.ServiceAccount: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.Namespace: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.Endpoints: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.ComponentStatus: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.LimitRange: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - case *core.Event: - u.APIVersion = core.SchemeGroupVersion.String() - u.Kind = meta.GetKind(v) - return nil - } - return errors.New("unknown api object type") -} - -func RemoveNextInitializer(m metav1.ObjectMeta) metav1.ObjectMeta { - if m.GetInitializers() != nil { - pendingInitializers := m.GetInitializers().Pending - // Remove self from the list of pending Initializers while preserving ordering. - if len(pendingInitializers) == 1 { - m.Initializers = nil - } else { - m.Initializers.Pending = append(pendingInitializers[:0], pendingInitializers[1:]...) - } - } - return m -} - -func AddFinalizer(m metav1.ObjectMeta, finalizer string) metav1.ObjectMeta { - for _, name := range m.Finalizers { - if name == finalizer { - return m - } - } - m.Finalizers = append(m.Finalizers, finalizer) - return m -} - -func HasFinalizer(m metav1.ObjectMeta, finalizer string) bool { - for _, name := range m.Finalizers { - if name == finalizer { - return true - } - } - return false -} - -func RemoveFinalizer(m metav1.ObjectMeta, finalizer string) metav1.ObjectMeta { - // https://github.com/golang/go/wiki/SliceTricks#filtering-without-allocating - r := m.Finalizers[:0] - for _, name := range m.Finalizers { - if name != finalizer { - r = append(r, name) - } - } - m.Finalizers = r - return m -} - -func EnsureContainerDeleted(containers []core.Container, name string) []core.Container { - for i, c := range containers { - if c.Name == name { - return append(containers[:i], containers[i+1:]...) - } - } - return containers -} - -func UpsertContainer(containers []core.Container, upsert core.Container) []core.Container { - for i, container := range containers { - if container.Name == upsert.Name { - err := mergo.MergeWithOverwrite(&container, upsert) - if err != nil { - panic(err) - } - containers[i] = container - return containers - } - } - return append(containers, upsert) -} - -func GetString(m map[string]string, key string) string { - if m == nil { - return "" - } - return m[key] -} - -func UpsertVolume(volumes []core.Volume, nv core.Volume) []core.Volume { - for i, vol := range volumes { - if vol.Name == nv.Name { - volumes[i] = nv - return volumes - } - } - return append(volumes, nv) -} - -func UpsertVolumeClaim(volumeClaims []core.PersistentVolumeClaim, upsert core.PersistentVolumeClaim) []core.PersistentVolumeClaim { - for i, vc := range volumeClaims { - if vc.Name == upsert.Name { - volumeClaims[i] = upsert - return volumeClaims - } - } - return append(volumeClaims, upsert) -} - -func EnsureVolumeDeleted(volumes []core.Volume, name string) []core.Volume { - for i, v := range volumes { - if v.Name == name { - return append(volumes[:i], volumes[i+1:]...) - } - } - return volumes -} - -func UpsertVolumeMount(mounts []core.VolumeMount, nv core.VolumeMount) []core.VolumeMount { - for i, vol := range mounts { - if vol.Name == nv.Name { - mounts[i] = nv - return mounts - } - } - return append(mounts, nv) -} - -func EnsureVolumeMountDeleted(mounts []core.VolumeMount, name string) []core.VolumeMount { - for i, v := range mounts { - if v.Name == name { - return append(mounts[:i], mounts[i+1:]...) - } - } - return mounts -} - -func UpsertEnvVars(vars []core.EnvVar, nv ...core.EnvVar) []core.EnvVar { - upsert := func(env core.EnvVar) { - for i, v := range vars { - if v.Name == env.Name { - vars[i] = env - return - } - } - vars = append(vars, env) - } - - for _, env := range nv { - upsert(env) - } - return vars -} - -func EnsureEnvVarDeleted(vars []core.EnvVar, name string) []core.EnvVar { - for i, v := range vars { - if v.Name == name { - return append(vars[:i], vars[i+1:]...) - } - } - return vars -} - -func UpsertMap(maps, upsert map[string]string) map[string]string { - if maps == nil { - maps = make(map[string]string) - } - for k, v := range upsert { - maps[k] = v - } - return maps -} diff --git a/vendor/github.com/appscode/kutil/core/v1/node.go b/vendor/github.com/appscode/kutil/core/v1/node.go deleted file mode 100644 index 594b80359..000000000 --- a/vendor/github.com/appscode/kutil/core/v1/node.go +++ /dev/null @@ -1,96 +0,0 @@ -package v1 - -import ( - "encoding/json" - "fmt" - - "github.com/appscode/kutil" - "github.com/golang/glog" - core "k8s.io/api/core/v1" - kerr "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" -) - -func CreateOrPatchNode(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.Node) *core.Node) (*core.Node, kutil.VerbType, error) { - cur, err := c.CoreV1().Nodes().Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(err) { - glog.V(3).Infof("Creating Node %s/%s.", meta.Namespace, meta.Name) - out, err := c.CoreV1().Nodes().Create(transform(&core.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: core.SchemeGroupVersion.String(), - }, - ObjectMeta: meta, - })) - return out, kutil.VerbCreated, err - } else if err != nil { - return nil, kutil.VerbUnchanged, err - } - return PatchNode(c, cur, transform) -} - -func PatchNode(c kubernetes.Interface, cur *core.Node, transform func(*core.Node) *core.Node) (*core.Node, kutil.VerbType, error) { - curJson, err := json.Marshal(cur) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - modJson, err := json.Marshal(transform(cur.DeepCopy())) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - patch, err := strategicpatch.CreateTwoWayMergePatch(curJson, modJson, core.Node{}) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - if len(patch) == 0 || string(patch) == "{}" { - return cur, kutil.VerbUnchanged, nil - } - glog.V(3).Infof("Patching Node %s with %s", cur.Name, string(patch)) - out, err := c.CoreV1().Nodes().Patch(cur.Name, types.StrategicMergePatchType, patch) - return out, kutil.VerbPatched, err -} - -func TryUpdateNode(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.Node) *core.Node) (result *core.Node, err error) { - attempt := 0 - err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { - attempt++ - cur, e2 := c.CoreV1().Nodes().Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(e2) { - return false, e2 - } else if e2 == nil { - result, e2 = c.CoreV1().Nodes().Update(transform(cur.DeepCopy())) - return e2 == nil, nil - } - glog.Errorf("Attempt %d failed to update Node %s due to %v.", attempt, cur.Name, e2) - return false, nil - }) - - if err != nil { - err = fmt.Errorf("failed to update Node %s after %d attempts due to %v", meta.Name, attempt, err) - } - return -} - -// NodeReady returns whether a node is ready. -func NodeReady(node core.Node) bool { - for _, cond := range node.Status.Conditions { - if cond.Type != core.NodeReady { - continue - } - return cond.Status == core.ConditionTrue - } - return false -} - -// IsMaster returns whether a node is a master. -func IsMaster(node core.Node) bool { - _, ok17 := node.Labels["node-role.kubernetes.io/master"] - role16, ok16 := node.Labels["kubernetes.io/role"] - return ok17 || (ok16 && role16 == "master") -} diff --git a/vendor/github.com/appscode/kutil/core/v1/pod.go b/vendor/github.com/appscode/kutil/core/v1/pod.go deleted file mode 100644 index 3b1054fe2..000000000 --- a/vendor/github.com/appscode/kutil/core/v1/pod.go +++ /dev/null @@ -1,163 +0,0 @@ -package v1 - -import ( - "encoding/json" - "errors" - "fmt" - - "github.com/appscode/kutil" - "github.com/golang/glog" - core "k8s.io/api/core/v1" - kerr "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" -) - -func CreateOrPatchPod(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.Pod) *core.Pod) (*core.Pod, kutil.VerbType, error) { - cur, err := c.CoreV1().Pods(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(err) { - glog.V(3).Infof("Creating Pod %s/%s.", meta.Namespace, meta.Name) - out, err := c.CoreV1().Pods(meta.Namespace).Create(transform(&core.Pod{ - TypeMeta: metav1.TypeMeta{ - Kind: "Pod", - APIVersion: core.SchemeGroupVersion.String(), - }, - ObjectMeta: meta, - })) - return out, kutil.VerbCreated, err - } else if err != nil { - return nil, kutil.VerbUnchanged, err - } - return PatchPod(c, cur, transform) -} - -func PatchPod(c kubernetes.Interface, cur *core.Pod, transform func(*core.Pod) *core.Pod) (*core.Pod, kutil.VerbType, error) { - curJson, err := json.Marshal(cur) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - modJson, err := json.Marshal(transform(cur.DeepCopy())) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - patch, err := strategicpatch.CreateTwoWayMergePatch(curJson, modJson, core.Pod{}) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - if len(patch) == 0 || string(patch) == "{}" { - return cur, kutil.VerbUnchanged, nil - } - glog.V(3).Infof("Patching Pod %s/%s with %s", cur.Namespace, cur.Name, string(patch)) - out, err := c.CoreV1().Pods(cur.Namespace).Patch(cur.Name, types.StrategicMergePatchType, patch) - return out, kutil.VerbPatched, err -} - -func TryUpdatePod(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.Pod) *core.Pod) (result *core.Pod, err error) { - attempt := 0 - err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { - attempt++ - cur, e2 := c.CoreV1().Pods(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(e2) { - return false, e2 - } else if e2 == nil { - result, e2 = c.CoreV1().Pods(cur.Namespace).Update(transform(cur.DeepCopy())) - return e2 == nil, nil - } - glog.Errorf("Attempt %d failed to update Pod %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) - return false, nil - }) - - if err != nil { - err = fmt.Errorf("failed to update Pod %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) - } - return -} - -// ref: https://github.com/coreos/prometheus-operator/blob/c79166fcff3dae7bb8bc1e6bddc81837c2d97c04/pkg/k8sutil/k8sutil.go#L64 -// PodRunningAndReady returns whether a pod is running and each container has -// passed it's ready state. -func PodRunningAndReady(pod core.Pod) (bool, error) { - switch pod.Status.Phase { - case core.PodFailed, core.PodSucceeded: - return false, errors.New("pod completed") - case core.PodRunning: - for _, cond := range pod.Status.Conditions { - if cond.Type != core.PodReady { - continue - } - return cond.Status == core.ConditionTrue, nil - } - return false, errors.New("pod ready condition not found") - } - return false, nil -} - -func RestartPods(kubeClient kubernetes.Interface, namespace string, selector *metav1.LabelSelector) error { - r, err := metav1.LabelSelectorAsSelector(selector) - if err != nil { - return err - } - return kubeClient.CoreV1().Pods(namespace).DeleteCollection(&metav1.DeleteOptions{}, metav1.ListOptions{ - LabelSelector: r.String(), - }) -} - -func WaitUntilPodRunning(kubeClient kubernetes.Interface, meta metav1.ObjectMeta) error { - return wait.PollImmediate(kutil.RetryInterval, kutil.ReadinessTimeout, func() (bool, error) { - if pod, err := kubeClient.CoreV1().Pods(meta.Namespace).Get(meta.Name, metav1.GetOptions{}); err == nil { - runningAndReady, _ := PodRunningAndReady(*pod) - return runningAndReady, nil - } - return false, nil - }) -} - -func WaitUntilPodRunningBySelector(kubeClient kubernetes.Interface, namespace string, selector *metav1.LabelSelector, count int) error { - r, err := metav1.LabelSelectorAsSelector(selector) - if err != nil { - return err - } - - return wait.PollImmediate(kutil.RetryInterval, kutil.ReadinessTimeout, func() (bool, error) { - podList, err := kubeClient.CoreV1().Pods(namespace).List(metav1.ListOptions{ - LabelSelector: r.String(), - }) - if err != nil { - return false, nil - } - - if len(podList.Items) != count { - return false, nil - } - - for _, pod := range podList.Items { - runningAndReady, _ := PodRunningAndReady(pod) - if !runningAndReady { - return false, nil - } - } - return true, nil - }) -} - -func WaitUntilPodDeletedBySelector(kubeClient kubernetes.Interface, namespace string, selector *metav1.LabelSelector) error { - r, err := metav1.LabelSelectorAsSelector(selector) - if err != nil { - return err - } - - return wait.PollImmediate(kutil.RetryInterval, kutil.ReadinessTimeout, func() (bool, error) { - podList, err := kubeClient.CoreV1().Pods(namespace).List(metav1.ListOptions{ - LabelSelector: r.String(), - }) - if err != nil { - return false, nil - } - return len(podList.Items) == 0, nil - }) -} diff --git a/vendor/github.com/appscode/kutil/core/v1/rc.go b/vendor/github.com/appscode/kutil/core/v1/rc.go deleted file mode 100644 index 07de7170e..000000000 --- a/vendor/github.com/appscode/kutil/core/v1/rc.go +++ /dev/null @@ -1,89 +0,0 @@ -package v1 - -import ( - "encoding/json" - "fmt" - - . "github.com/appscode/go/types" - "github.com/appscode/kutil" - "github.com/golang/glog" - core "k8s.io/api/core/v1" - kerr "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" -) - -func CreateOrPatchRC(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.ReplicationController) *core.ReplicationController) (*core.ReplicationController, kutil.VerbType, error) { - cur, err := c.CoreV1().ReplicationControllers(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(err) { - glog.V(3).Infof("Creating ReplicationController %s/%s.", meta.Namespace, meta.Name) - out, err := c.CoreV1().ReplicationControllers(meta.Namespace).Create(transform(&core.ReplicationController{ - TypeMeta: metav1.TypeMeta{ - Kind: "ReplicationController", - APIVersion: core.SchemeGroupVersion.String(), - }, - ObjectMeta: meta, - })) - return out, kutil.VerbCreated, err - } else if err != nil { - return nil, kutil.VerbUnchanged, err - } - return PatchRC(c, cur, transform) -} - -func PatchRC(c kubernetes.Interface, cur *core.ReplicationController, transform func(*core.ReplicationController) *core.ReplicationController) (*core.ReplicationController, kutil.VerbType, error) { - curJson, err := json.Marshal(cur) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - modJson, err := json.Marshal(transform(cur.DeepCopy())) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - patch, err := strategicpatch.CreateTwoWayMergePatch(curJson, modJson, core.ReplicationController{}) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - if len(patch) == 0 || string(patch) == "{}" { - return cur, kutil.VerbUnchanged, nil - } - glog.V(3).Infof("Patching ReplicationController %s/%s with %s.", cur.Namespace, cur.Name, string(patch)) - out, err := c.CoreV1().ReplicationControllers(cur.Namespace).Patch(cur.Name, types.StrategicMergePatchType, patch) - return out, kutil.VerbPatched, err -} - -func TryUpdateRC(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.ReplicationController) *core.ReplicationController) (result *core.ReplicationController, err error) { - attempt := 0 - err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { - attempt++ - cur, e2 := c.CoreV1().ReplicationControllers(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(e2) { - return false, e2 - } else if e2 == nil { - result, e2 = c.CoreV1().ReplicationControllers(cur.Namespace).Update(transform(cur.DeepCopy())) - return e2 == nil, nil - } - glog.Errorf("Attempt %d failed to update ReplicationController %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) - return false, nil - }) - - if err != nil { - err = fmt.Errorf("failed to update ReplicationController %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) - } - return -} - -func WaitUntilRCReady(c kubernetes.Interface, meta metav1.ObjectMeta) error { - return wait.PollImmediate(kutil.RetryInterval, kutil.ReadinessTimeout, func() (bool, error) { - if obj, err := c.CoreV1().ReplicationControllers(meta.Namespace).Get(meta.Name, metav1.GetOptions{}); err == nil { - return Int32(obj.Spec.Replicas) == obj.Status.ReadyReplicas, nil - } - - return false, nil - }) -} diff --git a/vendor/github.com/appscode/kutil/core/v1/secret.go b/vendor/github.com/appscode/kutil/core/v1/secret.go deleted file mode 100644 index ffeee9155..000000000 --- a/vendor/github.com/appscode/kutil/core/v1/secret.go +++ /dev/null @@ -1,87 +0,0 @@ -package v1 - -import ( - "encoding/json" - "fmt" - - "github.com/appscode/kutil" - "github.com/golang/glog" - core "k8s.io/api/core/v1" - kerr "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" -) - -func CreateOrPatchSecret(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.Secret) *core.Secret) (*core.Secret, kutil.VerbType, error) { - cur, err := c.CoreV1().Secrets(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(err) { - glog.V(3).Infof("Creating Secret %s/%s.", meta.Namespace, meta.Name) - out, err := c.CoreV1().Secrets(meta.Namespace).Create(transform(&core.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: core.SchemeGroupVersion.String(), - }, - ObjectMeta: meta, - })) - return out, kutil.VerbCreated, err - } else if err != nil { - return nil, kutil.VerbUnchanged, err - } - return PatchSecret(c, cur, transform) -} - -func PatchSecret(c kubernetes.Interface, cur *core.Secret, transform func(*core.Secret) *core.Secret) (*core.Secret, kutil.VerbType, error) { - curJson, err := json.Marshal(cur) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - modJson, err := json.Marshal(transform(cur.DeepCopy())) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - patch, err := strategicpatch.CreateTwoWayMergePatch(curJson, modJson, core.Secret{}) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - if len(patch) == 0 || string(patch) == "{}" { - return cur, kutil.VerbUnchanged, nil - } - glog.V(3).Infof("Patching Secret %s/%s", cur.Namespace, cur.Name) - out, err := c.CoreV1().Secrets(cur.Namespace).Patch(cur.Name, types.StrategicMergePatchType, patch) - return out, kutil.VerbPatched, err -} - -func TryUpdateSecret(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.Secret) *core.Secret) (result *core.Secret, err error) { - attempt := 0 - err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { - attempt++ - cur, e2 := c.CoreV1().Secrets(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(e2) { - return false, e2 - } else if e2 == nil { - result, e2 = c.CoreV1().Secrets(cur.Namespace).Update(transform(cur.DeepCopy())) - return e2 == nil, nil - } - glog.Errorf("Attempt %d failed to update Secret %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) - return false, nil - }) - - if err != nil { - err = fmt.Errorf("failed to update Secret %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) - } - return -} - -func ObfuscateSecret(in core.Secret) *core.Secret { - data := make(map[string][]byte) - for k := range in.Data { - data[k] = []byte("-") - } - in.Data = data - return &in -} diff --git a/vendor/github.com/appscode/kutil/core/v1/service.go b/vendor/github.com/appscode/kutil/core/v1/service.go deleted file mode 100644 index 6a7cdfefe..000000000 --- a/vendor/github.com/appscode/kutil/core/v1/service.go +++ /dev/null @@ -1,107 +0,0 @@ -package v1 - -import ( - "encoding/json" - "fmt" - - "github.com/appscode/kutil" - "github.com/golang/glog" - core "k8s.io/api/core/v1" - kerr "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" -) - -func CreateOrPatchService(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.Service) *core.Service) (*core.Service, kutil.VerbType, error) { - cur, err := c.CoreV1().Services(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(err) { - glog.V(3).Infof("Creating Service %s/%s.", meta.Namespace, meta.Name) - out, err := c.CoreV1().Services(meta.Namespace).Create(transform(&core.Service{ - TypeMeta: metav1.TypeMeta{ - Kind: "Service", - APIVersion: core.SchemeGroupVersion.String(), - }, - ObjectMeta: meta, - })) - return out, kutil.VerbCreated, err - } else if err != nil { - return nil, kutil.VerbUnchanged, err - } - return PatchService(c, cur, transform) -} - -func PatchService(c kubernetes.Interface, cur *core.Service, transform func(*core.Service) *core.Service) (*core.Service, kutil.VerbType, error) { - curJson, err := json.Marshal(cur) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - modJson, err := json.Marshal(transform(cur.DeepCopy())) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - patch, err := strategicpatch.CreateTwoWayMergePatch(curJson, modJson, core.Service{}) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - if len(patch) == 0 || string(patch) == "{}" { - return cur, kutil.VerbUnchanged, nil - } - glog.V(3).Infof("Patching Service %s/%s with %s.", cur.Namespace, cur.Name, string(patch)) - out, err := c.CoreV1().Services(cur.Namespace).Patch(cur.Name, types.StrategicMergePatchType, patch) - return out, kutil.VerbPatched, err -} - -func TryUpdateService(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.Service) *core.Service) (result *core.Service, err error) { - attempt := 0 - err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { - attempt++ - cur, e2 := c.CoreV1().Services(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(e2) { - return false, e2 - } else if e2 == nil { - result, e2 = c.CoreV1().Services(cur.Namespace).Update(transform(cur.DeepCopy())) - return e2 == nil, nil - } - glog.Errorf("Attempt %d failed to update Service %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) - return false, nil - }) - - if err != nil { - err = fmt.Errorf("failed to update Service %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) - } - return -} - -func MergeServicePorts(cur, desired []core.ServicePort) []core.ServicePort { - if len(cur) == 0 { - return desired - } - - // ports - curPorts := make(map[int32]core.ServicePort) - for _, p := range cur { - curPorts[p.Port] = p - } - for i, dp := range desired { - cp, ok := curPorts[dp.Port] - - // svc port not found - if !ok { - continue - } - - if dp.NodePort == 0 { - dp.NodePort = cp.NodePort // avoid reassigning port - } - if dp.Protocol == "" { - dp.Protocol = cp.Protocol - } - desired[i] = dp - } - return desired -} diff --git a/vendor/github.com/appscode/kutil/core/v1/serviceaccount.go b/vendor/github.com/appscode/kutil/core/v1/serviceaccount.go deleted file mode 100644 index 1a64b94d1..000000000 --- a/vendor/github.com/appscode/kutil/core/v1/serviceaccount.go +++ /dev/null @@ -1,78 +0,0 @@ -package v1 - -import ( - "encoding/json" - "fmt" - - "github.com/appscode/kutil" - "github.com/golang/glog" - core "k8s.io/api/core/v1" - kerr "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/kubernetes" -) - -func CreateOrPatchServiceAccount(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.ServiceAccount) *core.ServiceAccount) (*core.ServiceAccount, kutil.VerbType, error) { - cur, err := c.CoreV1().ServiceAccounts(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(err) { - glog.V(3).Infof("Creating ServiceAccount %s/%s.", meta.Namespace, meta.Name) - out, err := c.CoreV1().ServiceAccounts(meta.Namespace).Create(transform(&core.ServiceAccount{ - TypeMeta: metav1.TypeMeta{ - Kind: "ServiceAccount", - APIVersion: core.SchemeGroupVersion.String(), - }, - ObjectMeta: meta, - })) - return out, kutil.VerbCreated, err - } else if err != nil { - return nil, kutil.VerbUnchanged, err - } - return PatchServiceAccount(c, cur, transform) -} - -func PatchServiceAccount(c kubernetes.Interface, cur *core.ServiceAccount, transform func(*core.ServiceAccount) *core.ServiceAccount) (*core.ServiceAccount, kutil.VerbType, error) { - curJson, err := json.Marshal(cur) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - modJson, err := json.Marshal(transform(cur.DeepCopy())) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - - patch, err := strategicpatch.CreateTwoWayMergePatch(curJson, modJson, core.ServiceAccount{}) - if err != nil { - return nil, kutil.VerbUnchanged, err - } - if len(patch) == 0 || string(patch) == "{}" { - return cur, kutil.VerbUnchanged, nil - } - glog.V(3).Infof("Patching ServiceAccount %s/%s with %s", cur.Namespace, cur.Name, string(patch)) - out, err := c.CoreV1().ServiceAccounts(cur.Namespace).Patch(cur.Name, types.StrategicMergePatchType, patch) - return out, kutil.VerbPatched, err -} - -func TryUpdateServiceAccount(c kubernetes.Interface, meta metav1.ObjectMeta, transform func(*core.ServiceAccount) *core.ServiceAccount) (result *core.ServiceAccount, err error) { - attempt := 0 - err = wait.PollImmediate(kutil.RetryInterval, kutil.RetryTimeout, func() (bool, error) { - attempt++ - cur, e2 := c.CoreV1().ServiceAccounts(meta.Namespace).Get(meta.Name, metav1.GetOptions{}) - if kerr.IsNotFound(e2) { - return false, e2 - } else if e2 == nil { - result, e2 = c.CoreV1().ServiceAccounts(cur.Namespace).Update(transform(cur.DeepCopy())) - return e2 == nil, nil - } - glog.Errorf("Attempt %d failed to update ServiceAccount %s/%s due to %v.", attempt, cur.Namespace, cur.Name, e2) - return false, nil - }) - - if err != nil { - err = fmt.Errorf("failed to update ServiceAccount %s/%s after %d attempts due to %v", meta.Namespace, meta.Name, attempt, err) - } - return -} diff --git a/vendor/github.com/appscode/kutil/meta/annotations.go b/vendor/github.com/appscode/kutil/meta/annotations.go index a9109fa4d..0368d4987 100644 --- a/vendor/github.com/appscode/kutil/meta/annotations.go +++ b/vendor/github.com/appscode/kutil/meta/annotations.go @@ -3,31 +3,37 @@ package meta import ( "encoding/json" "strconv" + + "github.com/appscode/kutil" ) func GetBool(m map[string]string, key string) (bool, error) { if m == nil { - return false, nil + return false, kutil.ErrNotFound } return strconv.ParseBool(m[key]) } func GetInt(m map[string]string, key string) (int, error) { if m == nil { - return 0, nil + return 0, kutil.ErrNotFound } - s, ok := m[key] + v, ok := m[key] if !ok { - return 0, nil + return 0, kutil.ErrNotFound } - return strconv.Atoi(s) + return strconv.Atoi(v) } -func GetString(m map[string]string, key string) string { +func GetString(m map[string]string, key string) (string, error) { if m == nil { - return "" + return "", kutil.ErrNotFound + } + v, ok := m[key] + if !ok { + return "", kutil.ErrNotFound } - return m[key] + return v, nil } func HasKey(m map[string]string, key string) bool { @@ -48,11 +54,11 @@ func RemoveKey(m map[string]string, key string) map[string]string { func GetList(m map[string]string, key string) ([]string, error) { if m == nil { - return []string{}, nil + return []string{}, kutil.ErrNotFound } s, ok := m[key] if !ok { - return []string{}, nil + return []string{}, kutil.ErrNotFound } v := make([]string, 0) err := json.Unmarshal([]byte(s), &v) @@ -61,11 +67,11 @@ func GetList(m map[string]string, key string) ([]string, error) { func GetMap(m map[string]string, key string) (map[string]string, error) { if m == nil { - return map[string]string{}, nil + return map[string]string{}, kutil.ErrNotFound } s, ok := m[key] if !ok { - return map[string]string{}, nil + return map[string]string{}, kutil.ErrNotFound } v := make(map[string]string) err := json.Unmarshal([]byte(s), &v) diff --git a/vendor/github.com/appscode/kutil/tools/analytics/analytics.go b/vendor/github.com/appscode/kutil/tools/analytics/analytics.go index cd5e592cf..4145812ed 100644 --- a/vendor/github.com/appscode/kutil/tools/analytics/analytics.go +++ b/vendor/github.com/appscode/kutil/tools/analytics/analytics.go @@ -4,31 +4,47 @@ import ( "bytes" "crypto/md5" "encoding/hex" + "io/ioutil" "net" + "net/http" + "os" "sort" + "time" "github.com/appscode/go/analytics" "github.com/appscode/kutil/meta" + "github.com/ghodss/yaml" core "k8s.io/api/core/v1" kerr "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" ) +const ( + Key = "APPSCODE_ANALYTICS_CLIENT_ID" +) + func ClientID() string { + defer runtime.HandleCrash() + if !meta.PossiblyInCluster() { return analytics.ClientID() } + if id := os.Getenv(Key); id != "" { + return id + } + cfg, err := rest.InClusterConfig() if err != nil { - return "" + return "$k8s$inclusterconfig" } client, err := kubernetes.NewForConfig(cfg) if err != nil { - return "" + return "$k8s$newforconfig" } nodes, err := client.CoreV1().Nodes().List(metav1.ListOptions{ LabelSelector: labels.SelectorFromSet(map[string]string{ @@ -57,7 +73,7 @@ func ClientID() string { } } if len(ips) == 0 { - return "" + return tryGKE() } sort.Slice(ips, func(i, j int) bool { return bytes.Compare(ips[i], ips[j]) < 0 }) hasher := md5.New() @@ -99,7 +115,45 @@ func ipBytes(ip net.IP) []byte { func reasonForError(err error) string { switch t := err.(type) { case kerr.APIStatus: - return string(t.Status().Reason) + return "$k8s$err$" + string(t.Status().Reason) + } + return "$k8s$err$" + trim(err.Error(), 32) // 32 = length of uuid +} + +// ref: https://cloud.google.com/compute/docs/storing-retrieving-metadata +func tryGKE() string { + client := &http.Client{Timeout: time.Millisecond * 100} + req, err := http.NewRequest(http.MethodGet, "http://metadata.google.internal/computeMetadata/v1/instance/attributes/kube-env", nil) + if err != nil { + return "$gke$err$" + trim(err.Error(), 32) // 32 = length of uuid + } + req.Header.Set("Metadata-Flavor", "Google") + resp, err := client.Do(req) + if err != nil { + return "$gke$err$" + trim(err.Error(), 32) // 32 = length of uuid + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return "$gke$ReadAll(resp.Body)" + } + data := make(map[string]interface{}) + err = yaml.Unmarshal(body, &data) + if err != nil { + return "$gke$Unmarshal(body)" + } + v, ok := data["KUBERNETES_MASTER_NAME"] + if !ok { + return "$gke$KUBERNETES_MASTER_NAME" + } + masterIP := v.(string) + hashed := md5.Sum([]byte(masterIP)) + return hex.EncodeToString(hashed[:]) +} + +func trim(s string, length int) string { + if len(s) > length { + return s[:length] } - return string(metav1.StatusReasonUnknown) + return s } diff --git a/vendor/github.com/appscode/kutil/util.go b/vendor/github.com/appscode/kutil/util.go index 3847388e2..539944bc2 100644 --- a/vendor/github.com/appscode/kutil/util.go +++ b/vendor/github.com/appscode/kutil/util.go @@ -1,6 +1,9 @@ package kutil -import "time" +import ( + "errors" + "time" +) const ( RetryInterval = 50 * time.Millisecond @@ -17,3 +20,7 @@ const ( VerbUpdated VerbType = "updated" VerbDeleted VerbType = "deleted" ) + +var ( + ErrNotFound = errors.New("not found") +) diff --git a/vendor/github.com/appscode/mergo/LICENSE b/vendor/github.com/appscode/mergo/LICENSE deleted file mode 100644 index 686680298..000000000 --- a/vendor/github.com/appscode/mergo/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2013 Dario Castañé. All rights reserved. -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/appscode/mergo/doc.go b/vendor/github.com/appscode/mergo/doc.go deleted file mode 100644 index 6e9aa7baf..000000000 --- a/vendor/github.com/appscode/mergo/doc.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2013 Dario Castañé. All rights reserved. -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package mergo merges same-type structs and maps by setting default values in zero-value fields. - -Mergo won't merge unexported (private) fields but will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). - -Usage - -From my own work-in-progress project: - - type networkConfig struct { - Protocol string - Address string - ServerType string `json: "server_type"` - Port uint16 - } - - type FssnConfig struct { - Network networkConfig - } - - var fssnDefault = FssnConfig { - networkConfig { - "tcp", - "127.0.0.1", - "http", - 31560, - }, - } - - // Inside a function [...] - - if err := mergo.Merge(&config, fssnDefault); err != nil { - log.Fatal(err) - } - - // More code [...] - -*/ -package mergo diff --git a/vendor/github.com/appscode/mergo/map.go b/vendor/github.com/appscode/mergo/map.go deleted file mode 100644 index 8e8c4ba8e..000000000 --- a/vendor/github.com/appscode/mergo/map.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2014 Dario Castañé. All rights reserved. -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Based on src/pkg/reflect/deepequal.go from official -// golang's stdlib. - -package mergo - -import ( - "fmt" - "reflect" - "unicode" - "unicode/utf8" -) - -func changeInitialCase(s string, mapper func(rune) rune) string { - if s == "" { - return s - } - r, n := utf8.DecodeRuneInString(s) - return string(mapper(r)) + s[n:] -} - -func isExported(field reflect.StructField) bool { - r, _ := utf8.DecodeRuneInString(field.Name) - return r >= 'A' && r <= 'Z' -} - -// Traverses recursively both values, assigning src's fields values to dst. -// The map argument tracks comparisons that have already been seen, which allows -// short circuiting on recursive types. -func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, overwrite bool) (err error) { - if dst.CanAddr() { - addr := dst.UnsafeAddr() - h := 17 * addr - seen := visited[h] - typ := dst.Type() - for p := seen; p != nil; p = p.next { - if p.ptr == addr && p.typ == typ { - return nil - } - } - // Remember, remember... - visited[h] = &visit{addr, typ, seen} - } - zeroValue := reflect.Value{} - switch dst.Kind() { - case reflect.Map: - dstMap := dst.Interface().(map[string]interface{}) - for i, n := 0, src.NumField(); i < n; i++ { - srcType := src.Type() - field := srcType.Field(i) - if !isExported(field) { - continue - } - fieldName := field.Name - fieldName = changeInitialCase(fieldName, unicode.ToLower) - if v, ok := dstMap[fieldName]; !ok || (isEmptyValue(reflect.ValueOf(v)) || overwrite) { - dstMap[fieldName] = src.Field(i).Interface() - } - } - case reflect.Struct: - srcMap := src.Interface().(map[string]interface{}) - for key := range srcMap { - srcValue := srcMap[key] - fieldName := changeInitialCase(key, unicode.ToUpper) - dstElement := dst.FieldByName(fieldName) - if dstElement == zeroValue { - // We discard it because the field doesn't exist. - continue - } - srcElement := reflect.ValueOf(srcValue) - dstKind := dstElement.Kind() - srcKind := srcElement.Kind() - if srcKind == reflect.Ptr && dstKind != reflect.Ptr { - srcElement = srcElement.Elem() - srcKind = reflect.TypeOf(srcElement.Interface()).Kind() - } else if dstKind == reflect.Ptr { - // Can this work? I guess it can't. - if srcKind != reflect.Ptr && srcElement.CanAddr() { - srcPtr := srcElement.Addr() - srcElement = reflect.ValueOf(srcPtr) - srcKind = reflect.Ptr - } - } - if !srcElement.IsValid() { - continue - } - if srcKind == dstKind { - if err = deepMerge(dstElement, srcElement, visited, depth+1, overwrite); err != nil { - return - } - } else { - if srcKind == reflect.Map { - if err = deepMap(dstElement, srcElement, visited, depth+1, overwrite); err != nil { - return - } - } else { - return fmt.Errorf("type mismatch on %s field: found %v, expected %v", fieldName, srcKind, dstKind) - } - } - } - } - return -} - -// Map sets fields' values in dst from src. -// src can be a map with string keys or a struct. dst must be the opposite: -// if src is a map, dst must be a valid pointer to struct. If src is a struct, -// dst must be map[string]interface{}. -// It won't merge unexported (private) fields and will do recursively -// any exported field. -// If dst is a map, keys will be src fields' names in lower camel case. -// Missing key in src that doesn't match a field in dst will be skipped. This -// doesn't apply if dst is a map. -// This is separated method from Merge because it is cleaner and it keeps sane -// semantics: merging equal types, mapping different (restricted) types. -func Map(dst, src interface{}) error { - return _map(dst, src, false) -} - -// MapWithOverwrite will do the same as Map except that non-empty dst attributes will be overriden by -// non-empty src attribute values. -func MapWithOverwrite(dst, src interface{}) error { - return _map(dst, src, true) -} - -func _map(dst, src interface{}, overwrite bool) error { - var ( - vDst, vSrc reflect.Value - err error - ) - if vDst, vSrc, err = resolveValues(dst, src); err != nil { - return err - } - // To be friction-less, we redirect equal-type arguments - // to deepMerge. Only because arguments can be anything. - if vSrc.Kind() == vDst.Kind() { - return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, overwrite) - } - switch vSrc.Kind() { - case reflect.Struct: - if vDst.Kind() != reflect.Map { - return ErrExpectedMapAsDestination - } - case reflect.Map: - if vDst.Kind() != reflect.Struct { - return ErrExpectedStructAsDestination - } - default: - return ErrNotSupported - } - return deepMap(vDst, vSrc, make(map[uintptr]*visit), 0, overwrite) -} diff --git a/vendor/github.com/appscode/mergo/merge.go b/vendor/github.com/appscode/mergo/merge.go deleted file mode 100644 index 513774f4c..000000000 --- a/vendor/github.com/appscode/mergo/merge.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2013 Dario Castañé. All rights reserved. -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Based on src/pkg/reflect/deepequal.go from official -// golang's stdlib. - -package mergo - -import ( - "reflect" -) - -// Traverses recursively both values, assigning src's fields values to dst. -// The map argument tracks comparisons that have already been seen, which allows -// short circuiting on recursive types. -func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, overwrite bool) (err error) { - if !src.IsValid() { - return - } - if dst.CanAddr() { - addr := dst.UnsafeAddr() - h := 17 * addr - seen := visited[h] - typ := dst.Type() - for p := seen; p != nil; p = p.next { - if p.ptr == addr && p.typ == typ { - return nil - } - } - // Remember, remember... - visited[h] = &visit{addr, typ, seen} - } - switch dst.Kind() { - case reflect.Struct: - for i, n := 0, dst.NumField(); i < n; i++ { - if err = deepMerge(dst.Field(i), src.Field(i), visited, depth+1, overwrite); err != nil { - return - } - } - case reflect.Map: - for _, key := range src.MapKeys() { - srcElement := src.MapIndex(key) - if !srcElement.IsValid() { - continue - } - dstElement := dst.MapIndex(key) - switch srcElement.Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Slice: - if srcElement.IsNil() { - continue - } - fallthrough - default: - if !srcElement.CanInterface() { - continue - } - switch reflect.TypeOf(srcElement.Interface()).Kind() { - case reflect.Struct: - fallthrough - case reflect.Ptr: - fallthrough - case reflect.Map: - if err = deepMerge(dstElement, srcElement, visited, depth+1, overwrite); err != nil { - return - } - } - } - if !isEmptyValue(srcElement) && (overwrite || (!dstElement.IsValid() || isEmptyValue(dst))) { - if dst.IsNil() { - dst.Set(reflect.MakeMap(dst.Type())) - } - dst.SetMapIndex(key, srcElement) - } - } - case reflect.Ptr: - fallthrough - case reflect.Interface: - if src.IsNil() { - break - } else if dst.IsNil() || overwrite { - if dst.CanSet() && (overwrite || isEmptyValue(dst)) { - dst.Set(src) - } - } else if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, overwrite); err != nil { - return - } - default: - if dst.CanSet() && !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) { - dst.Set(src) - } - } - return -} - -// Merge will fill any empty for value type attributes on the dst struct using corresponding -// src attributes if they themselves are not empty. dst and src must be valid same-type structs -// and dst must be a pointer to struct. -// It won't merge unexported (private) fields and will do recursively any exported field. -func Merge(dst, src interface{}) error { - return merge(dst, src, false) -} - -// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overriden by -// non-empty src attribute values. -func MergeWithOverwrite(dst, src interface{}) error { - return merge(dst, src, true) -} - -func merge(dst, src interface{}, overwrite bool) error { - var ( - vDst, vSrc reflect.Value - err error - ) - if vDst, vSrc, err = resolveValues(dst, src); err != nil { - return err - } - if vDst.Type() != vSrc.Type() { - return ErrDifferentArgumentsTypes - } - return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, overwrite) -} diff --git a/vendor/github.com/appscode/mergo/mergo.go b/vendor/github.com/appscode/mergo/mergo.go deleted file mode 100644 index f8a0991ec..000000000 --- a/vendor/github.com/appscode/mergo/mergo.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2013 Dario Castañé. All rights reserved. -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Based on src/pkg/reflect/deepequal.go from official -// golang's stdlib. - -package mergo - -import ( - "errors" - "reflect" -) - -// Errors reported by Mergo when it finds invalid arguments. -var ( - ErrNilArguments = errors.New("src and dst must not be nil") - ErrDifferentArgumentsTypes = errors.New("src and dst must be of same type") - ErrNotSupported = errors.New("only structs and maps are supported") - ErrExpectedMapAsDestination = errors.New("dst was expected to be a map") - ErrExpectedStructAsDestination = errors.New("dst was expected to be a struct") -) - -// During deepMerge, must keep track of checks that are -// in progress. The comparison algorithm assumes that all -// checks in progress are true when it reencounters them. -// Visited are stored in a map indexed by 17 * a1 + a2; -type visit struct { - ptr uintptr - typ reflect.Type - next *visit -} - -// From src/pkg/encoding/json. -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - return false -} - -func resolveValues(dst, src interface{}) (vDst, vSrc reflect.Value, err error) { - if dst == nil || src == nil { - err = ErrNilArguments - return - } - vDst = reflect.ValueOf(dst).Elem() - if vDst.Kind() != reflect.Struct && vDst.Kind() != reflect.Map { - err = ErrNotSupported - return - } - vSrc = reflect.ValueOf(src) - // We check if vSrc is a pointer to dereference it. - if vSrc.Kind() == reflect.Ptr { - vSrc = vSrc.Elem() - } - return -} - -// Traverses recursively both values, assigning src's fields values to dst. -// The map argument tracks comparisons that have already been seen, which allows -// short circuiting on recursive types. -func deeper(dst, src reflect.Value, visited map[uintptr]*visit, depth int) (err error) { - if dst.CanAddr() { - addr := dst.UnsafeAddr() - h := 17 * addr - seen := visited[h] - typ := dst.Type() - for p := seen; p != nil; p = p.next { - if p.ptr == addr && p.typ == typ { - return nil - } - } - // Remember, remember... - visited[h] = &visit{addr, typ, seen} - } - return // TODO refactor -} diff --git a/vendor/github.com/golang/glog/glog.go b/vendor/github.com/golang/glog/glog.go index 54bd7afdc..3e63fffd5 100644 --- a/vendor/github.com/golang/glog/glog.go +++ b/vendor/github.com/golang/glog/glog.go @@ -676,10 +676,7 @@ func (l *loggingT) output(s severity, buf *buffer, file string, line int, alsoTo } } data := buf.Bytes() - if !flag.Parsed() { - os.Stderr.Write([]byte("ERROR: logging before flag.Parse: ")) - os.Stderr.Write(data) - } else if l.toStderr { + if l.toStderr { os.Stderr.Write(data) } else { if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() { diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/format.go b/vendor/github.com/google/go-cmp/cmp/internal/value/format.go index 6de45c573..657e50877 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/format.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/format.go @@ -22,24 +22,28 @@ var stringerIface = reflect.TypeOf((*fmt.Stringer)(nil)).Elem() // * Avoids printing struct fields that are zero // * Prints a nil-slice as being nil, not empty // * Prints map entries in deterministic order -func Format(v reflect.Value, useStringer bool) string { - return formatAny(v, formatConfig{useStringer, true, true, true}, nil) +func Format(v reflect.Value, conf FormatConfig) string { + conf.printType = true + conf.followPointers = true + conf.realPointers = true + return formatAny(v, conf, nil) } -type formatConfig struct { - useStringer bool // Should the String method be used if available? - printType bool // Should we print the type before the value? - followPointers bool // Should we recursively follow pointers? - realPointers bool // Should we print the real address of pointers? +type FormatConfig struct { + UseStringer bool // Should the String method be used if available? + printType bool // Should we print the type before the value? + PrintPrimitiveType bool // Should we print the type of primitives? + followPointers bool // Should we recursively follow pointers? + realPointers bool // Should we print the real address of pointers? } -func formatAny(v reflect.Value, conf formatConfig, visited map[uintptr]bool) string { +func formatAny(v reflect.Value, conf FormatConfig, visited map[uintptr]bool) string { // TODO: Should this be a multi-line printout in certain situations? if !v.IsValid() { return "" } - if conf.useStringer && v.Type().Implements(stringerIface) && v.CanInterface() { + if conf.UseStringer && v.Type().Implements(stringerIface) && v.CanInterface() { if (v.Kind() == reflect.Ptr || v.Kind() == reflect.Interface) && v.IsNil() { return "" } @@ -150,7 +154,7 @@ func formatAny(v reflect.Value, conf formatConfig, visited map[uintptr]bool) str continue // Elide zero value fields } name := v.Type().Field(i).Name - subConf.useStringer = conf.useStringer + subConf.UseStringer = conf.UseStringer s := formatAny(vv, subConf, visited) ss = append(ss, fmt.Sprintf("%s: %s", name, s)) } @@ -183,14 +187,14 @@ func formatString(s string) string { return qs } -func formatPrimitive(t reflect.Type, v interface{}, conf formatConfig) string { - if conf.printType && t.PkgPath() != "" { +func formatPrimitive(t reflect.Type, v interface{}, conf FormatConfig) string { + if conf.printType && (conf.PrintPrimitiveType || t.PkgPath() != "") { return fmt.Sprintf("%v(%v)", t, v) } return fmt.Sprintf("%v", v) } -func formatPointer(v reflect.Value, conf formatConfig) string { +func formatPointer(v reflect.Value, conf FormatConfig) string { p := v.Pointer() if !conf.realPointers { p = 0 // For deterministic printing purposes diff --git a/vendor/github.com/google/go-cmp/cmp/reporter.go b/vendor/github.com/google/go-cmp/cmp/reporter.go index 3be56644f..20e9f18e0 100644 --- a/vendor/github.com/google/go-cmp/cmp/reporter.go +++ b/vendor/github.com/google/go-cmp/cmp/reporter.go @@ -30,12 +30,12 @@ func (r *defaultReporter) Report(x, y reflect.Value, eq bool, p Path) { const maxLines = 256 r.ndiffs++ if r.nbytes < maxBytes && r.nlines < maxLines { - sx := value.Format(x, true) - sy := value.Format(y, true) + sx := value.Format(x, value.FormatConfig{UseStringer: true}) + sy := value.Format(y, value.FormatConfig{UseStringer: true}) if sx == sy { - // Stringer is not helpful, so rely on more exact formatting. - sx = value.Format(x, false) - sy = value.Format(y, false) + // Unhelpful output, so use more exact formatting. + sx = value.Format(x, value.FormatConfig{PrintPrimitiveType: true}) + sy = value.Format(y, value.FormatConfig{PrintPrimitiveType: true}) } s := fmt.Sprintf("%#v:\n\t-: %s\n\t+: %s\n", p, sx, sy) r.diffs = append(r.diffs, s) diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go index 4fc5a77df..b17461631 100644 --- a/vendor/github.com/google/uuid/hash.go +++ b/vendor/github.com/google/uuid/hash.go @@ -27,7 +27,7 @@ var ( func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID { h.Reset() h.Write(space[:]) - h.Write([]byte(data)) + h.Write(data) s := h.Sum(nil) var uuid UUID copy(uuid[:], s) diff --git a/vendor/github.com/google/uuid/node.go b/vendor/github.com/google/uuid/node.go index f2c2765b2..384f07d02 100644 --- a/vendor/github.com/google/uuid/node.go +++ b/vendor/github.com/google/uuid/node.go @@ -5,16 +5,14 @@ package uuid import ( - "net" "sync" ) var ( - nodeMu sync.Mutex - interfaces []net.Interface // cached list of interfaces - ifname string // name of interface being used - nodeID [6]byte // hardware for version 1 UUIDs - zeroID [6]byte // nodeID with only 0's + nodeMu sync.Mutex + ifname string // name of interface being used + nodeID [6]byte // hardware for version 1 UUIDs + zeroID [6]byte // nodeID with only 0's ) // NodeInterface returns the name of the interface from which the NodeID was @@ -39,20 +37,12 @@ func SetNodeInterface(name string) bool { } func setNodeInterface(name string) bool { - if interfaces == nil { - var err error - interfaces, err = net.Interfaces() - if err != nil && name != "" { - return false - } - } - for _, ifs := range interfaces { - if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) { - copy(nodeID[:], ifs.HardwareAddr) - ifname = ifs.Name - return true - } + iname, addr := getHardwareInterface(name) // null implementation for js + if iname != "" && addr != nil { + ifname = iname + copy(nodeID[:], addr) + return true } // We found no interfaces with a valid hardware address. If name diff --git a/vendor/github.com/google/uuid/node_js.go b/vendor/github.com/google/uuid/node_js.go new file mode 100644 index 000000000..24b78edc9 --- /dev/null +++ b/vendor/github.com/google/uuid/node_js.go @@ -0,0 +1,12 @@ +// Copyright 2017 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build js + +package uuid + +// getHardwareInterface returns nil values for the JS version of the code. +// This remvoves the "net" dependency, because it is not used in the browser. +// Using the "net" library inflates the size of the transpiled JS code by 673k bytes. +func getHardwareInterface(name string) (string, []byte) { return "", nil } diff --git a/vendor/github.com/google/uuid/node_net.go b/vendor/github.com/google/uuid/node_net.go new file mode 100644 index 000000000..0cbbcddbd --- /dev/null +++ b/vendor/github.com/google/uuid/node_net.go @@ -0,0 +1,33 @@ +// Copyright 2017 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !js + +package uuid + +import "net" + +var interfaces []net.Interface // cached list of interfaces + +// getHardwareInterface returns the name and hardware address of interface name. +// If name is "" then the name and hardware address of one of the system's +// interfaces is returned. If no interfaces are found (name does not exist or +// there are no interfaces) then "", nil is returned. +// +// Only addresses of at least 6 bytes are returned. +func getHardwareInterface(name string) (string, []byte) { + if interfaces == nil { + var err error + interfaces, err = net.Interfaces() + if err != nil { + return "", nil + } + } + for _, ifs := range interfaces { + if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) { + return ifs.Name, ifs.HardwareAddr + } + } + return "", nil +} diff --git a/vendor/github.com/google/uuid/time.go b/vendor/github.com/google/uuid/time.go index fd7fe0ac4..e6ef06cdc 100644 --- a/vendor/github.com/google/uuid/time.go +++ b/vendor/github.com/google/uuid/time.go @@ -86,7 +86,7 @@ func clockSequence() int { return int(clockSeq & 0x3fff) } -// SetClockSeq sets the clock sequence to the lower 14 bits of seq. Setting to +// SetClockSequence sets the clock sequence to the lower 14 bits of seq. Setting to // -1 causes a new sequence to be generated. func SetClockSequence(seq int) { defer timeMu.Unlock() @@ -100,9 +100,9 @@ func setClockSequence(seq int) { randomBits(b[:]) // clock sequence seq = int(b[0])<<8 | int(b[1]) } - old_seq := clockSeq + oldSeq := clockSeq clockSeq = uint16(seq&0x3fff) | 0x8000 // Set our variant - if old_seq != clockSeq { + if oldSeq != clockSeq { lasttime = 0 } } diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go index 23161a86c..7f3643fe9 100644 --- a/vendor/github.com/google/uuid/uuid.go +++ b/vendor/github.com/google/uuid/uuid.go @@ -58,11 +58,11 @@ func Parse(s string) (UUID, error) { 14, 16, 19, 21, 24, 26, 28, 30, 32, 34} { - if v, ok := xtob(s[x], s[x+1]); !ok { + v, ok := xtob(s[x], s[x+1]) + if !ok { return uuid, errors.New("invalid UUID format") - } else { - uuid[i] = v } + uuid[i] = v } return uuid, nil } @@ -88,15 +88,22 @@ func ParseBytes(b []byte) (UUID, error) { 14, 16, 19, 21, 24, 26, 28, 30, 32, 34} { - if v, ok := xtob(b[x], b[x+1]); !ok { + v, ok := xtob(b[x], b[x+1]) + if !ok { return uuid, errors.New("invalid UUID format") - } else { - uuid[i] = v } + uuid[i] = v } return uuid, nil } +// FromBytes creates a new UUID from a byte slice. Returns an error if the slice +// does not have a length of 16. The bytes are copied from the slice. +func FromBytes(b []byte) (uuid UUID, err error) { + err = uuid.UnmarshalBinary(b) + return uuid, err +} + // Must returns uuid if err is nil and panics otherwise. func Must(uuid UUID, err error) UUID { if err != nil { diff --git a/vendor/github.com/google/uuid/version4.go b/vendor/github.com/google/uuid/version4.go index 74c4e6c9f..84af91c9f 100644 --- a/vendor/github.com/google/uuid/version4.go +++ b/vendor/github.com/google/uuid/version4.go @@ -14,7 +14,7 @@ func New() UUID { return Must(NewRandom()) } -// NewRandom returns a Random (Version 4) UUID or panics. +// NewRandom returns a Random (Version 4) UUID. // // The strength of the UUIDs is based on the strength of the crypto/rand // package. diff --git a/vendor/github.com/hashicorp/go-version/version.go b/vendor/github.com/hashicorp/go-version/version.go index c82272253..0a3ef1764 100644 --- a/vendor/github.com/hashicorp/go-version/version.go +++ b/vendor/github.com/hashicorp/go-version/version.go @@ -15,8 +15,8 @@ var versionRegexp *regexp.Regexp // The raw regular expression string used for testing the validity // of a version. const VersionRegexpRaw string = `v?([0-9]+(\.[0-9]+)*?)` + - `(-?([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + - `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + + `(-?([0-9A-Za-z\-~]+(\.[0-9A-Za-z\-~]+)*))?` + + `(\+([0-9A-Za-z\-~]+(\.[0-9A-Za-z\-~]+)*))?` + `?` // Version represents a single version. @@ -166,14 +166,16 @@ func comparePart(preSelf string, preOther string) int { return 0 } + var selfInt int64 selfNumeric := true - _, err := strconv.ParseInt(preSelf, 10, 64) + selfInt, err := strconv.ParseInt(preSelf, 10, 64) if err != nil { selfNumeric = false } + var otherInt int64 otherNumeric := true - _, err = strconv.ParseInt(preOther, 10, 64) + otherInt, err = strconv.ParseInt(preOther, 10, 64) if err != nil { otherNumeric = false } @@ -197,7 +199,9 @@ func comparePart(preSelf string, preOther string) int { return -1 } else if !selfNumeric && otherNumeric { return 1 - } else if preSelf > preOther { + } else if !selfNumeric && !otherNumeric && preSelf > preOther { + return 1 + } else if selfInt > otherInt { return 1 } diff --git a/vendor/github.com/kubedb/mysql/pkg/docker/images.go b/vendor/github.com/kubedb/mysql/pkg/docker/images.go index d9335e3bc..fe3ccf4ac 100644 --- a/vendor/github.com/kubedb/mysql/pkg/docker/images.go +++ b/vendor/github.com/kubedb/mysql/pkg/docker/images.go @@ -6,7 +6,7 @@ import ( const ( ImageKubedbOperator = "operator" - ImageMySQLOperator = "ms-operator" + ImageMySQLOperator = "my-operator" ImageMySQL = "mysql" ImageMySQLTools = "mysql-tools" ) diff --git a/vendor/github.com/kubedb/postgres/pkg/docker/images.go b/vendor/github.com/kubedb/postgres/pkg/docker/images.go index e23e9510e..7e9cbffdc 100644 --- a/vendor/github.com/kubedb/postgres/pkg/docker/images.go +++ b/vendor/github.com/kubedb/postgres/pkg/docker/images.go @@ -5,6 +5,7 @@ import ( ) const ( + ImageKubedbOperator = "operator" ImagePostgresOperator = "pg-operator" ImagePostgres = "postgres" ImagePostgresTools = "postgres-tools" @@ -26,7 +27,7 @@ func (d Docker) GetImageWithTag(postgres *api.Postgres) string { } func (d Docker) GetOperatorImage(postgres *api.Postgres) string { - return d.Registry + "/" + ImagePostgresOperator + return d.Registry + "/" + ImageKubedbOperator } func (d Docker) GetOperatorImageWithTag(postgres *api.Postgres) string { diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go index e9b16e6db..488f53560 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go index 26fcb6cc0..5b0451138 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go index 6f97eb6db..7b0d703d7 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.defaults.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.defaults.go index 55798082e..5c30d5b0a 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.defaults.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1/zz_generated.defaults.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go index ae6f2d79f..1e4971735 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/doc.go index 5d8ec824f..9e5efb259 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/doc.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/register.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/register.go index 95f4bb41a..af2951a76 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/register.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/apiextensions_client.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/apiextensions_client.go index 6a15dadd7..90d280f89 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/apiextensions_client.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/apiextensions_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go index 73238715b..e1477df5f 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/customresourcedefinition.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/doc.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/doc.go index 11b523897..6bd6c5839 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/doc.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/generated_expansion.go b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/generated_expansion.go index 2f721078b..35554a068 100644 --- a/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch.go b/vendor/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch.go deleted file mode 100644 index e81e4f23a..000000000 --- a/vendor/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch.go +++ /dev/null @@ -1,144 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package jsonmergepatch - -import ( - "fmt" - "reflect" - - "github.com/evanphx/json-patch" - "k8s.io/apimachinery/pkg/util/json" - "k8s.io/apimachinery/pkg/util/mergepatch" -) - -// Create a 3-way merge patch based-on JSON merge patch. -// Calculate addition-and-change patch between current and modified. -// Calculate deletion patch between original and modified. -func CreateThreeWayJSONMergePatch(original, modified, current []byte, fns ...mergepatch.PreconditionFunc) ([]byte, error) { - if len(original) == 0 { - original = []byte(`{}`) - } - if len(modified) == 0 { - modified = []byte(`{}`) - } - if len(current) == 0 { - current = []byte(`{}`) - } - - addAndChangePatch, err := jsonpatch.CreateMergePatch(current, modified) - if err != nil { - return nil, err - } - // Only keep addition and changes - addAndChangePatch, addAndChangePatchObj, err := keepOrDeleteNullInJsonPatch(addAndChangePatch, false) - if err != nil { - return nil, err - } - - deletePatch, err := jsonpatch.CreateMergePatch(original, modified) - if err != nil { - return nil, err - } - // Only keep deletion - deletePatch, deletePatchObj, err := keepOrDeleteNullInJsonPatch(deletePatch, true) - if err != nil { - return nil, err - } - - hasConflicts, err := mergepatch.HasConflicts(addAndChangePatchObj, deletePatchObj) - if err != nil { - return nil, err - } - if hasConflicts { - return nil, mergepatch.NewErrConflict(mergepatch.ToYAMLOrError(addAndChangePatchObj), mergepatch.ToYAMLOrError(deletePatchObj)) - } - patch, err := jsonpatch.MergePatch(deletePatch, addAndChangePatch) - if err != nil { - return nil, err - } - - var patchMap map[string]interface{} - err = json.Unmarshal(patch, &patchMap) - if err != nil { - return nil, fmt.Errorf("Failed to unmarshal patch for precondition check: %s", patch) - } - meetPreconditions, err := meetPreconditions(patchMap, fns...) - if err != nil { - return nil, err - } - if !meetPreconditions { - return nil, mergepatch.NewErrPreconditionFailed(patchMap) - } - - return patch, nil -} - -// keepOrDeleteNullInJsonPatch takes a json-encoded byte array and a boolean. -// It returns a filtered object and its corresponding json-encoded byte array. -// It is a wrapper of func keepOrDeleteNullInObj -func keepOrDeleteNullInJsonPatch(patch []byte, keepNull bool) ([]byte, map[string]interface{}, error) { - var patchMap map[string]interface{} - err := json.Unmarshal(patch, &patchMap) - if err != nil { - return nil, nil, err - } - filteredMap, err := keepOrDeleteNullInObj(patchMap, keepNull) - if err != nil { - return nil, nil, err - } - o, err := json.Marshal(filteredMap) - return o, filteredMap, err -} - -// keepOrDeleteNullInObj will keep only the null value and delete all the others, -// if keepNull is true. Otherwise, it will delete all the null value and keep the others. -func keepOrDeleteNullInObj(m map[string]interface{}, keepNull bool) (map[string]interface{}, error) { - filteredMap := make(map[string]interface{}) - var err error - for key, val := range m { - switch { - case keepNull && val == nil: - filteredMap[key] = nil - case val != nil: - switch typedVal := val.(type) { - case map[string]interface{}: - filteredMap[key], err = keepOrDeleteNullInObj(typedVal, keepNull) - if err != nil { - return nil, err - } - case []interface{}, string, float64, bool, int, int64, nil: - // Lists are always replaced in Json, no need to check each entry in the list. - if !keepNull { - filteredMap[key] = val - } - default: - return nil, fmt.Errorf("unknown type: %v", reflect.TypeOf(typedVal)) - } - } - } - return filteredMap, nil -} - -func meetPreconditions(patchObj map[string]interface{}, fns ...mergepatch.PreconditionFunc) (bool, error) { - // Apply the preconditions to the patch, and return an error if any of them fail. - for _, fn := range fns { - if !fn(patchObj) { - return false, fmt.Errorf("precondition failed for: %v", patchObj) - } - } - return true, nil -} diff --git a/vendor/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go b/vendor/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go index 907e51b12..df1a920bc 100644 --- a/vendor/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go +++ b/vendor/k8s.io/apiserver/pkg/apis/audit/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.pb.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.pb.go index 7fc447d52..c92780182 100644 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.pb.go +++ b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.conversion.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.conversion.go index 3ec0eba6b..cb04bee11 100644 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.conversion.go +++ b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go index e4223daa4..50d69912b 100644 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/metrics/pkg/apis/metrics/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/generated.pb.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/generated.pb.go index 115df3ed2..184e7aa32 100644 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/generated.pb.go +++ b/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/generated.pb.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/zz_generated.conversion.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/zz_generated.conversion.go index c44a1d5ce..f6a1c47e7 100644 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/zz_generated.conversion.go +++ b/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/zz_generated.conversion.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/zz_generated.deepcopy.go index 3f67eeff2..f5dcc084c 100644 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/metrics/pkg/apis/metrics/v1beta1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/apis/metrics/zz_generated.deepcopy.go b/vendor/k8s.io/metrics/pkg/apis/metrics/zz_generated.deepcopy.go index 88b5d0a88..d9dac915a 100644 --- a/vendor/k8s.io/metrics/pkg/apis/metrics/zz_generated.deepcopy.go +++ b/vendor/k8s.io/metrics/pkg/apis/metrics/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/clientset.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/clientset.go index fa5da317a..8ca71f572 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/clientset.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/doc.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/doc.go index 7d72e7fb2..fd7fee0b0 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/doc.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/scheme/doc.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/scheme/doc.go index 5d8ec824f..9e5efb259 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/scheme/doc.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/scheme/register.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/scheme/register.go index 74d09ac86..772cd9d19 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/scheme/register.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/doc.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/doc.go index ba8d10d3b..f51751d64 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/doc.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/generated_expansion.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/generated_expansion.go index 919bdc267..f325d33dc 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/generated_expansion.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/metrics_client.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/metrics_client.go index b838b83e1..f31235ee5 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/metrics_client.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/metrics_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/nodemetrics.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/nodemetrics.go index 4883f07c3..b2ea591f7 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/nodemetrics.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/nodemetrics.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/podmetrics.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/podmetrics.go index 0fbb38c68..c0b617e22 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/podmetrics.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1/podmetrics.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/doc.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/doc.go index 11b523897..6bd6c5839 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/doc.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/generated_expansion.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/generated_expansion.go index 6c64173c4..419975b55 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/metrics_client.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/metrics_client.go index 53fe0d87f..a540a03c4 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/metrics_client.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/metrics_client.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/nodemetrics.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/nodemetrics.go index d23bc4053..18adf9dd4 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/nodemetrics.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/nodemetrics.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/podmetrics.go b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/podmetrics.go index 459664cbf..5d5e19e03 100644 --- a/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/podmetrics.go +++ b/vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/typed/metrics/v1beta1/podmetrics.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.