diff --git a/glide.lock b/glide.lock deleted file mode 100644 index 0253b136b..000000000 --- a/glide.lock +++ /dev/null @@ -1,332 +0,0 @@ -hash: 3c05531c0d590c16abd195c43c39e2090ca94de48404032f6bb2651158f8f3b9 -updated: 2016-11-30T11:07:18.630258453-08:00 -imports: -- name: cloud.google.com/go - version: 3b1ae45394a234c385be014e9a488f2bb6eef821 - subpackages: - - compute/metadata - - internal -- name: github.com/blang/semver - version: 31b736133b98f26d5e078ec9eb591666edfd091f -- name: github.com/coreos/etcd - version: ea057115224138376622d63a51b699133310ea31 - subpackages: - - client - - pkg/fileutil - - pkg/pathutil - - pkg/tlsutil - - pkg/transport - - pkg/types -- name: github.com/coreos/go-oidc - version: 5644a2f50e2d2d5ba0b474bc5bc55fea1925936d - subpackages: - - http - - jose - - key - - oauth2 - - oidc -- name: github.com/coreos/go-systemd - version: bfdc81d0d7e0fb19447b08571f63b774495251ce - subpackages: - - daemon - - journal - - util -- name: github.com/coreos/pkg - version: fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8 - subpackages: - - capnslog - - health - - httputil - - timeutil -- name: github.com/davecgh/go-spew - version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d - subpackages: - - spew -- name: github.com/docker/distribution - version: cd27f179f2c10c5d300e6d09025b538c475b0d51 - subpackages: - - digest - - reference -- name: github.com/docker/engine-api - version: 3d1601b9d2436a70b0dfc045a23f6503d19195df -- name: github.com/docopt/docopt-go - version: 784ddc588536785e7299f7272f39101f7faccc3f -- name: github.com/emicklei/go-restful - version: 89ef8af493ab468a45a42bb0d89a06fccdd2fb22 - subpackages: - - log - - swagger -- name: github.com/ghodss/yaml - version: a54de18a07046d8c4b26e9327698a2ebb9285b36 -- name: github.com/go-openapi/jsonpointer - version: 46af16f9f7b149af66e5d1bd010e3574dc06de98 -- name: github.com/go-openapi/jsonreference - version: 13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272 -- name: github.com/go-openapi/spec - version: 6aced65f8501fe1217321abf0749d354824ba2ff -- name: github.com/go-openapi/swag - version: 1d0bd113de87027671077d3c71eb3ac5d7dbba72 -- name: github.com/gogo/protobuf - version: e18d7aa8f8c624c915db340349aad4c49b10d173 - subpackages: - - proto - - sortkeys -- name: github.com/golang/glog - version: 44145f04b68cf362d9c4df2182967c2275eaefed -- name: github.com/golang/protobuf - version: 8616e8ee5e20a1704615e6c8d7afcdac06087a67 - subpackages: - - jsonpb - - proto -- name: github.com/google/gofuzz - version: bbcb9da2d746f8bdbd6a936686a0a6067ada0ec5 -- name: github.com/howeyc/gopass - version: 3ca23474a7c7203e0a0a070fd33508f6efdb9b3d -- name: github.com/imdario/mergo - version: 6633656539c1639d9d78127b7d47c622b5d7b6dc -- name: github.com/jonboulle/clockwork - version: 2eee05ed794112d45db504eb05aa693efd2b8b09 -- name: github.com/kelseyhightower/envconfig - version: 9aca109c9aec4633fced9717c4a09ecab3d33111 -- name: github.com/mailru/easyjson - version: d5b7844b561a7bc640052f1b935f7b800330d7e0 - subpackages: - - buffer - - jlexer - - jwriter -- name: github.com/mcuadros/go-version - version: 257f7b9a7d87427c8d7f89469a5958d57f8abd7c -- name: github.com/mitchellh/go-ps - version: e2d21980687ce16e58469d98dcee92d27fbbd7fb -- name: github.com/olekukonko/tablewriter - version: bdcc175572fd7abece6c831e643891b9331bc9e7 -- name: github.com/onsi/ginkgo - version: 00054c0bb96fc880d4e0be1b90937fad438c5290 - subpackages: - - config - - extensions/table - - internal/codelocation - - internal/containernode - - internal/failer - - internal/leafnodes - - internal/remote - - internal/spec - - internal/specrunner - - internal/suite - - internal/testingtproxy - - internal/writer - - reporters - - reporters/stenographer - - reporters/stenographer/support/go-colorable - - reporters/stenographer/support/go-isatty - - types -- name: github.com/pborman/uuid - version: ca53cad383cad2479bbba7f7a1a05797ec1386e4 -- name: github.com/PuerkitoBio/purell - version: 8a290539e2e8629dbc4e6bad948158f790ec31f4 -- name: github.com/PuerkitoBio/urlesc - version: 5bd2802263f21d8788851d5305584c82a5c75d7e -- name: github.com/satori/go.uuid - version: b061729afc07e77a8aa4fad0a2fd840958f1942a -- name: github.com/Sirupsen/logrus - version: d26492970760ca5d33129d2d799e34be5c4782eb -- name: github.com/spf13/pflag - version: 08b1a584251b5b62f458943640fc8ebd4d50aaa5 -- name: github.com/termie/go-shutil - version: bcacb06fecaeec8dc42af03c87c6949f4a05c74c -- name: github.com/ugorji/go - version: f1f1a805ed361a0e078bb537e4ea78cd37dcf065 - subpackages: - - codec -- name: golang.org/x/crypto - version: 1351f936d976c60a0a48d728281922cf63eafb8d - subpackages: - - bcrypt - - blowfish - - ssh/terminal -- name: golang.org/x/net - version: 6acef71eb69611914f7a30939ea9f6e194c78172 - subpackages: - - context - - context/ctxhttp - - http2 - - http2/hpack - - idna -- name: golang.org/x/oauth2 - version: 3c3a985cb79f52a3190fbc056984415ca6763d01 - subpackages: - - google - - internal - - jws - - jwt -- name: golang.org/x/sys - version: d5645953809d8b4752afb2c3224b1f1ad73dfa70 - subpackages: - - unix -- name: golang.org/x/text - version: 2910a502d2bf9e43193af9d68ca516529614eed3 - subpackages: - - cases - - internal/tag - - language - - runes - - secure/bidirule - - secure/precis - - transform - - unicode/bidi - - unicode/norm - - width -- name: google.golang.org/appengine - version: 4f7eeb5305a4ba1966344836ba4af9996b7b4e05 - subpackages: - - internal - - internal/app_identity - - internal/base - - internal/datastore - - internal/log - - internal/modules - - internal/remote_api - - internal/urlfetch - - urlfetch -- name: gopkg.in/go-playground/validator.v8 - version: 5f57d2222ad794d0dffb07e664ea05e2ee07d60c -- name: gopkg.in/inf.v0 - version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 -- name: gopkg.in/tchap/go-patricia.v2 - version: 666120de432aea38ab06bd5c818f04f4129882c9 - subpackages: - - patricia -- name: gopkg.in/yaml.v2 - version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 -- name: k8s.io/client-go - version: 5d8c36c93cf544e3bde13caa4c6222b65753ec3c - subpackages: - - discovery - - kubernetes - - kubernetes/typed/apps/v1beta1 - - kubernetes/typed/authentication/v1beta1 - - kubernetes/typed/authorization/v1beta1 - - kubernetes/typed/autoscaling/v1 - - kubernetes/typed/batch/v1 - - kubernetes/typed/batch/v2alpha1 - - kubernetes/typed/certificates/v1alpha1 - - kubernetes/typed/core/v1 - - kubernetes/typed/extensions/v1beta1 - - kubernetes/typed/policy/v1beta1 - - kubernetes/typed/rbac/v1alpha1 - - kubernetes/typed/storage/v1beta1 - - pkg/api - - pkg/api/errors - - pkg/api/install - - pkg/api/meta - - pkg/api/meta/metatypes - - pkg/api/resource - - pkg/api/unversioned - - pkg/api/v1 - - pkg/api/validation/path - - pkg/apimachinery - - pkg/apimachinery/announced - - pkg/apimachinery/registered - - pkg/apis/apps - - pkg/apis/apps/install - - pkg/apis/apps/v1beta1 - - pkg/apis/authentication - - pkg/apis/authentication/install - - pkg/apis/authentication/v1beta1 - - pkg/apis/authorization - - pkg/apis/authorization/install - - pkg/apis/authorization/v1beta1 - - pkg/apis/autoscaling - - pkg/apis/autoscaling/install - - pkg/apis/autoscaling/v1 - - pkg/apis/batch - - pkg/apis/batch/install - - pkg/apis/batch/v1 - - pkg/apis/batch/v2alpha1 - - pkg/apis/certificates - - pkg/apis/certificates/install - - pkg/apis/certificates/v1alpha1 - - pkg/apis/extensions - - pkg/apis/extensions/install - - pkg/apis/extensions/v1beta1 - - pkg/apis/policy - - pkg/apis/policy/install - - pkg/apis/policy/v1beta1 - - pkg/apis/rbac - - pkg/apis/rbac/install - - pkg/apis/rbac/v1alpha1 - - pkg/apis/storage - - pkg/apis/storage/install - - pkg/apis/storage/v1beta1 - - pkg/auth/user - - pkg/conversion - - pkg/conversion/queryparams - - pkg/fields - - pkg/genericapiserver/openapi/common - - pkg/labels - - pkg/runtime - - pkg/runtime/schema - - pkg/runtime/serializer - - pkg/runtime/serializer/json - - pkg/runtime/serializer/protobuf - - pkg/runtime/serializer/recognizer - - pkg/runtime/serializer/streaming - - pkg/runtime/serializer/versioning - - pkg/selection - - pkg/third_party/forked/golang/reflect - - pkg/third_party/forked/golang/template - - pkg/types - - pkg/util - - pkg/util/cert - - pkg/util/clock - - pkg/util/diff - - pkg/util/errors - - pkg/util/flowcontrol - - pkg/util/framer - - pkg/util/homedir - - pkg/util/integer - - pkg/util/intstr - - pkg/util/json - - pkg/util/jsonpath - - pkg/util/labels - - pkg/util/net - - pkg/util/parsers - - pkg/util/rand - - pkg/util/ratelimit - - pkg/util/runtime - - pkg/util/sets - - pkg/util/uuid - - pkg/util/validation - - pkg/util/validation/field - - pkg/util/wait - - pkg/util/yaml - - pkg/version - - pkg/watch - - pkg/watch/versioned - - plugin/pkg/client/auth - - plugin/pkg/client/auth/gcp - - plugin/pkg/client/auth/oidc - - rest - - tools/auth - - tools/cache - - tools/clientcmd - - tools/clientcmd/api - - tools/clientcmd/api/latest - - tools/clientcmd/api/v1 - - tools/metrics - - transport -testImports: -- name: github.com/onsi/gomega - version: f1f0f388b31eca4e2cbe7a6dd8a3a1dfddda5b1c - subpackages: - - format - - internal/assertion - - internal/asyncassertion - - internal/oraclematcher - - internal/testingtsupport - - matchers - - matchers/support/goraph/bipartitegraph - - matchers/support/goraph/edge - - matchers/support/goraph/node - - matchers/support/goraph/util - - types diff --git a/lib/backend/k8s/k8s.go b/lib/backend/k8s/k8s.go index 6ac88d43f..790426ae7 100644 --- a/lib/backend/k8s/k8s.go +++ b/lib/backend/k8s/k8s.go @@ -16,6 +16,7 @@ package k8s import ( goerrors "errors" + "fmt" "time" log "github.com/Sirupsen/logrus" @@ -87,15 +88,15 @@ func NewKubeClient(kc *KubeConfig) (*KubeClient, error) { } log.Debugf("Created k8s clientSet: %+v", cs) - kc := &KubeClient{clientSet: cs} + kubeClient := &KubeClient{clientSet: cs} // Ensure the necessary ThirdPartyResources exist in the API. - err = kc.ensureThirdPartyResources() + err = kubeClient.ensureThirdPartyResources() if err != nil { return nil, goerrors.New(fmt.Sprintf("Failed to create necessary ThirdPartyResources: %s", err)) } - return kc, nil + return kubeClient, nil } func (c *KubeClient) ensureThirdPartyResources() error { @@ -108,8 +109,15 @@ func (c *KubeClient) ensureThirdPartyResources() error { Description: "Calico Global Configuration", Versions: []extensions.APIVersion{{Name: "v1"}}, } - _, err := c.clientSet.Extensions().ThirdPartyResources().Update(&tpr) - return err + _, err := c.clientSet.Extensions().ThirdPartyResources().Get(tpr.ObjectMeta.Name) + if err != nil { + // The resource needs to be created. + _, err := c.clientSet.Extensions().ThirdPartyResources().Create(&tpr) + if err != nil { + return err + } + } + return nil } func (c *KubeClient) Syncer(callbacks api.SyncerCallbacks) api.Syncer { @@ -412,11 +420,11 @@ func (c *KubeClient) listGlobalConfig(l model.GlobalConfigListOptions) ([]*model if l.Name != "" { for _, cfg := range cfgs { - if cfg.Key.(GlobalConfigKey).Name == l.Name { + if cfg.Key.(model.GlobalConfigKey).Name == l.Name { return []*model.KVPair{cfg}, nil } } - return nil, goerrors.New("No GlobalConfig found for %+v", l) + return nil, goerrors.New(fmt.Sprintf("No GlobalConfig found for %+v", l)) } return cfgs, nil }