1
0
mirror of https://github.com/rancher/types.git synced 2025-06-29 23:16:48 +00:00

Vendor update

This commit is contained in:
Dan Ramich 2019-11-11 13:33:05 -07:00 committed by Alena Prokharchyk
parent 9644e7bb84
commit 37b6b2cc25
5 changed files with 23 additions and 4 deletions

2
go.mod
View File

@ -33,7 +33,7 @@ require (
github.com/coreos/prometheus-operator v0.33.0
github.com/knative/pkg v0.0.0-20190817231834-12ee58e32cc8
github.com/pkg/errors v0.8.1
github.com/rancher/norman v0.0.0-20191003174345-0ac7dd6ccb36
github.com/rancher/norman v0.0.0-20191111202053-1fcac7eb4fea
github.com/sirupsen/logrus v1.4.2
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c // indirect
k8s.io/api v0.0.0

4
go.sum
View File

@ -476,8 +476,8 @@ github.com/prometheus/tsdb v0.8.0/go.mod h1:fSI0j+IUQrDd7+ZtR9WKIGtoYAYAJUKcKhYL
github.com/quobyte/api v0.1.2/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H6VI=
github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009 h1:Xsxh7fX3+2wAUJtPy8g2lZh0cYuyifqhBL0vxCIYojs=
github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009/go.mod h1:wpITyDPTi/Na5h73XkbuEf2AP9fbgrIGqqxVzFhYD6U=
github.com/rancher/norman v0.0.0-20191003174345-0ac7dd6ccb36 h1:N0ZUBJRq/ydy2ULiuqKhmiKShmEtpDOWXxKzVZxTzHk=
github.com/rancher/norman v0.0.0-20191003174345-0ac7dd6ccb36/go.mod h1:kVWc1OyHK9decIY90IYExSHedI5a5qze7IfLiEOTmXQ=
github.com/rancher/norman v0.0.0-20191111202053-1fcac7eb4fea h1:XMBnoi65IA7PO17j6JBnPAbJIDLf8wXho9WgDb/TXVo=
github.com/rancher/norman v0.0.0-20191111202053-1fcac7eb4fea/go.mod h1:kVWc1OyHK9decIY90IYExSHedI5a5qze7IfLiEOTmXQ=
github.com/rancher/pkg v0.0.0-20190514055449-b30ab9de040e h1:j6+HqCET/NLPBtew2m5apL7jWw/PStQ7iGwXjgAqdvo=
github.com/rancher/pkg v0.0.0-20190514055449-b30ab9de040e/go.mod h1:XbYHTPaXuw8ZY9bylhYKQh/nJxDaTKk3YhAxPl4Qy/k=
github.com/rancher/wrangler v0.1.5 h1:HiXOeP6Kci2DK+e04D1g6INT77xAYpAr54zmTTe0Spk=

View File

@ -91,6 +91,7 @@ type {{.schema.CodeName}}Interface interface {
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*{{.schema.CodeName}}List, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*{{.schema.CodeName}}List, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() {{.schema.CodeName}}Controller
@ -279,6 +280,11 @@ func (s *{{.schema.ID}}Client) List(opts metav1.ListOptions) (*{{.schema.CodeNam
return obj.(*{{.schema.CodeName}}List), err
}
func (s *{{.schema.ID}}Client) ListNamespaced(namespace string, opts metav1.ListOptions) (*{{.schema.CodeName}}List, error) {
obj, err := s.objectClient.ListNamespaced(namespace, opts)
return obj.(*{{.schema.CodeName}}List), err
}
func (s *{{.schema.ID}}Client) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return s.objectClient.Watch(opts)
}

View File

@ -48,6 +48,7 @@ type GenericClient interface {
DeleteNamespaced(namespace, name string, opts *metav1.DeleteOptions) error
Delete(name string, opts *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (runtime.Object, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (runtime.Object, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOptions *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Patch(name string, o runtime.Object, patchType types.PatchType, data []byte, subresources ...string) (runtime.Object, error)
@ -228,6 +229,18 @@ func (p *ObjectClient) List(opts metav1.ListOptions) (runtime.Object, error) {
Into(result)
}
func (p *ObjectClient) ListNamespaced(namespace string, opts metav1.ListOptions) (runtime.Object, error) {
result := p.Factory.List()
logrus.Debugf("REST LIST %s/%s/%s/%s/%s", p.getAPIPrefix(), p.gvk.Group, p.gvk.Version, namespace, p.resource.Name)
return result, p.restClient.Get().
Prefix(p.getAPIPrefix(), p.gvk.Group, p.gvk.Version).
NamespaceIfScoped(namespace, p.resource.Namespaced).
Resource(p.resource.Name).
VersionedParams(&opts, metav1.ParameterCodec).
Do().
Into(result)
}
func (p *ObjectClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
restClient := p.restClient
if watchClient, ok := restClient.(restwatch.WatchClient); ok {

2
vendor/modules.txt vendored
View File

@ -84,7 +84,7 @@ github.com/prometheus/procfs
github.com/prometheus/procfs/nfs
github.com/prometheus/procfs/xfs
github.com/prometheus/procfs/internal/util
# github.com/rancher/norman v0.0.0-20191003174345-0ac7dd6ccb36
# github.com/rancher/norman v0.0.0-20191111202053-1fcac7eb4fea
github.com/rancher/norman/controller
github.com/rancher/norman/lifecycle
github.com/rancher/norman/objectclient