Skip to content

Revert "Updating to k8s 1.11." #110

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
343 changes: 48 additions & 295 deletions Gopkg.lock

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,19 @@ required = ["sigs.k8s.io/testing_frameworks/integration",

[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.11.0"
version = "kubernetes-1.10.1"

[[constraint]]
name = "k8s.io/apiextensions-apiserver"
version = "kubernetes-1.11.0"
version = "kubernetes-1.10.1"

[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.11.0"
version = "kubernetes-1.10.1"

[[constraint]]
name = "k8s.io/client-go"
version = "kubernetes-1.11.0"

[[override]]
name = "github.com/json-iterator/go"
# This is the commit at which k8s depends on this in 1.11
# It seems to be broken at HEAD.
revision = "f2b4162afba35581b6d4a50d3b8f34e33c144682"
version = "kubernetes-1.10.1"

[prune]
go-tests = true
20 changes: 1 addition & 19 deletions pkg/admission/cert/writer/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (s *SecretCertWriter) parseAnnotations(annotations map[string]string, secre
if strings.HasPrefix(k, SecretCertProvisionAnnotationKeyPrefix) {
webhookName := strings.TrimPrefix(k, SecretCertProvisionAnnotationKeyPrefix)
secretWebhookMap[webhookName] = &webhookAndSecret{
secret: newNamespacedNameFromString(v),
secret: types.NewNamespacedNameFromString(v),
}
}
}
Expand Down Expand Up @@ -182,24 +182,6 @@ func (s *secretReadWriter) read(webhookName string) (*generator.Artifacts, error
return secretToCerts(secret), err
}

// newNamespacedNameFromString parses the provided string and returns a NamespacedName.
// The expected format is as per String() above.
// If the input string is invalid, the returned NamespacedName has all empty string field values.
// This allows a single-value return from this function, while still allowing error checks in the caller.
// Note that an input string which does not include exactly one Separator is not a valid input (as it could never
// have neem returned by String() )
// NOTE: https://github.com/kubernetes/apimachinery/commit/2b167bb262168a225efe64d1fdc40ea97870ca9e removed this from
// "k8s.io/apimachinery/pkg/types". Code copied here.
func newNamespacedNameFromString(s string) types.NamespacedName {
nn := types.NamespacedName{}
result := strings.Split(s, string(types.Separator))
if len(result) == 2 {
nn.Namespace = result[0]
nn.Name = result[1]
}
return nn
}

func secretToCerts(secret *corev1.Secret) *generator.Artifacts {
if secret.Data == nil {
return nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/cache/internal/informers_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,14 @@ func (ip *InformersMap) newListWatch(gvk schema.GroupVersionKind) (*cache.ListWa
return &cache.ListWatch{
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
res := listObj.DeepCopyObject()
err := client.Get().Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Do().Into(res)
err := client.Get().Resource(mapping.Resource).VersionedParams(&opts, ip.paramCodec).Do().Into(res)
return res, err
},
// Setup the watch function
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
// Watch needs to be set to true separately
opts.Watch = true
return client.Get().Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Watch()
return client.Get().Resource(mapping.Resource).VersionedParams(&opts, ip.paramCodec).Watch()
},
}, nil
}
6 changes: 3 additions & 3 deletions pkg/client/apiutil/apimachinery.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/client-go/discovery"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/rest"
"k8s.io/client-go/restmapper"
)

// NewDiscoveryRESTMapper constructs a new RESTMapper based on discovery
// information fetched by a new client with the given config.
func NewDiscoveryRESTMapper(c *rest.Config) (meta.RESTMapper, error) {
// Get a mapper
dc := discovery.NewDiscoveryClientForConfigOrDie(c)
gr, err := restmapper.GetAPIGroupResources(dc)
gr, err := discovery.GetAPIGroupResources(dc)
if err != nil {
return nil, err
}
return restmapper.NewDiscoveryRESTMapper(gr), nil
return discovery.NewRESTMapper(gr, dynamic.VersionInterfaces), nil
}

// GVKForObject finds the GroupVersionKind associated with the given object, if there is only a single such GVK.
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (r *resourceMeta) isNamespaced() bool {

// resource returns the resource name of the type
func (r *resourceMeta) resource() string {
return r.mapping.Resource.Resource
return r.mapping.Resource
}

// objMeta stores type and object information about a Kubernetes type
Expand Down
1 change: 0 additions & 1 deletion vendor/github.com/google/btree/.travis.yml

This file was deleted.

202 changes: 0 additions & 202 deletions vendor/github.com/google/btree/LICENSE

This file was deleted.

12 changes: 0 additions & 12 deletions vendor/github.com/google/btree/README.md

This file was deleted.

Loading