Skip to content

updated k8s deps to 1.11.2 version #125

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
Sep 4, 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
  •  
  •  
  •  
82 changes: 58 additions & 24 deletions Gopkg.lock

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

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

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

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

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

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

[[constraint]]
name = "github.com/onsi/ginkgo"
Expand Down
20 changes: 19 additions & 1 deletion 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: types.NewNamespacedNameFromString(v),
secret: newNamespacedNameFromString(v),
}
}
}
Expand Down Expand Up @@ -182,6 +182,24 @@ 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).VersionedParams(&opts, ip.paramCodec).Do().Into(res)
err := client.Get().Resource(mapping.Resource.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).VersionedParams(&opts, ip.paramCodec).Watch()
return client.Get().Resource(mapping.Resource.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 @@ -24,20 +24,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 := discovery.GetAPIGroupResources(dc)
gr, err := restmapper.GetAPIGroupResources(dc)
if err != nil {
return nil, err
}
return discovery.NewRESTMapper(gr, dynamic.VersionInterfaces), nil
return restmapper.NewDiscoveryRESTMapper(gr), 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
return r.mapping.Resource.Resource
}

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

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

Loading