diff --git a/apis/contour/v1beta1/tlscertificatedelegation.go b/apis/contour/v1beta1/tlscertificatedelegation.go new file mode 100644 index 00000000000..b398814eab2 --- /dev/null +++ b/apis/contour/v1beta1/tlscertificatedelegation.go @@ -0,0 +1,59 @@ +// Copyright © 2019 Heptio +// 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 v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// TLSCertificateDelegationSpec defines the spec of the CRD +type TLSCertificateDelegationSpec struct { + Delegations []CertificateDelegation `json:"delegations"` +} + +// CertificateDelegation maps the authority to reference a secret +// in the current namespace to a set of namespaces. +type CertificateDelegation struct { + + // required, the name of a secret in the current namespace. + SecretName string `json:"secretName"` + + // required, the namespaces the authority to reference the + // the secret will be delegated to. + // If TargetNamespaces is nil or empty, the CertificateDelegation' + // is ignored. If the TargetNamespace list contains the character, "*" + // the secret will be delegated to all namespaces. + TargetNamespaces []string `json:"targetNamespaces"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TLSCertificateDelefgation is an TLS Certificate Delegation CRD specificiation. +// See design/tls-certificate-delegation.md for details. +type TLSCertificateDelegation struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + Spec TLSCertificateDelegationSpec `json:"spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TLSCertificateDelegationList is a list of TLSCertificateDelegations. +type TLSCertificateDelegationList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []TLSCertificateDelegation `json:"items"` +} diff --git a/apis/contour/v1beta1/zz_generated.deepcopy.go b/apis/contour/v1beta1/zz_generated.deepcopy.go index 8d03db55606..2c39f83933c 100644 --- a/apis/contour/v1beta1/zz_generated.deepcopy.go +++ b/apis/contour/v1beta1/zz_generated.deepcopy.go @@ -24,6 +24,27 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertificateDelegation) DeepCopyInto(out *CertificateDelegation) { + *out = *in + if in.TargetNamespaces != nil { + in, out := &in.TargetNamespaces, &out.TargetNamespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateDelegation. +func (in *CertificateDelegation) DeepCopy() *CertificateDelegation { + if in == nil { + return nil + } + out := new(CertificateDelegation) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Delegate) DeepCopyInto(out *Delegate) { *out = *in @@ -259,6 +280,89 @@ func (in *TLS) DeepCopy() *TLS { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSCertificateDelegation) DeepCopyInto(out *TLSCertificateDelegation) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSCertificateDelegation. +func (in *TLSCertificateDelegation) DeepCopy() *TLSCertificateDelegation { + if in == nil { + return nil + } + out := new(TLSCertificateDelegation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TLSCertificateDelegation) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSCertificateDelegationList) DeepCopyInto(out *TLSCertificateDelegationList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TLSCertificateDelegation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSCertificateDelegationList. +func (in *TLSCertificateDelegationList) DeepCopy() *TLSCertificateDelegationList { + if in == nil { + return nil + } + out := new(TLSCertificateDelegationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TLSCertificateDelegationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSCertificateDelegationSpec) DeepCopyInto(out *TLSCertificateDelegationSpec) { + *out = *in + if in.Delegations != nil { + in, out := &in.Delegations, &out.Delegations + *out = make([]CertificateDelegation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSCertificateDelegationSpec. +func (in *TLSCertificateDelegationSpec) DeepCopy() *TLSCertificateDelegationSpec { + if in == nil { + return nil + } + out := new(TLSCertificateDelegationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VirtualHost) DeepCopyInto(out *VirtualHost) { *out = *in diff --git a/apis/generated/clientset/versioned/typed/contour/v1beta1/contour_client.go b/apis/generated/clientset/versioned/typed/contour/v1beta1/contour_client.go index 1e98a874d59..271d26717df 100644 --- a/apis/generated/clientset/versioned/typed/contour/v1beta1/contour_client.go +++ b/apis/generated/clientset/versioned/typed/contour/v1beta1/contour_client.go @@ -28,6 +28,7 @@ import ( type ContourV1beta1Interface interface { RESTClient() rest.Interface IngressRoutesGetter + TLSCertificateDelegationsGetter } // ContourV1beta1Client is used to interact with features provided by the contour.heptio.com group. @@ -39,6 +40,10 @@ func (c *ContourV1beta1Client) IngressRoutes(namespace string) IngressRouteInter return newIngressRoutes(c, namespace) } +func (c *ContourV1beta1Client) TLSCertificateDelegations(namespace string) TLSCertificateDelegationInterface { + return newTLSCertificateDelegations(c, namespace) +} + // NewForConfig creates a new ContourV1beta1Client for the given config. func NewForConfig(c *rest.Config) (*ContourV1beta1Client, error) { config := *c diff --git a/apis/generated/clientset/versioned/typed/contour/v1beta1/fake/fake_contour_client.go b/apis/generated/clientset/versioned/typed/contour/v1beta1/fake/fake_contour_client.go index 08390530ac4..c56d06ffad7 100644 --- a/apis/generated/clientset/versioned/typed/contour/v1beta1/fake/fake_contour_client.go +++ b/apis/generated/clientset/versioned/typed/contour/v1beta1/fake/fake_contour_client.go @@ -32,6 +32,10 @@ func (c *FakeContourV1beta1) IngressRoutes(namespace string) v1beta1.IngressRout return &FakeIngressRoutes{c, namespace} } +func (c *FakeContourV1beta1) TLSCertificateDelegations(namespace string) v1beta1.TLSCertificateDelegationInterface { + return &FakeTLSCertificateDelegations{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeContourV1beta1) RESTClient() rest.Interface { diff --git a/apis/generated/clientset/versioned/typed/contour/v1beta1/fake/fake_tlscertificatedelegation.go b/apis/generated/clientset/versioned/typed/contour/v1beta1/fake/fake_tlscertificatedelegation.go new file mode 100644 index 00000000000..30472ea36bf --- /dev/null +++ b/apis/generated/clientset/versioned/typed/contour/v1beta1/fake/fake_tlscertificatedelegation.go @@ -0,0 +1,128 @@ +/* +Copyright 2019 Heptio + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1beta1 "github.com/heptio/contour/apis/contour/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeTLSCertificateDelegations implements TLSCertificateDelegationInterface +type FakeTLSCertificateDelegations struct { + Fake *FakeContourV1beta1 + ns string +} + +var tlscertificatedelegationsResource = schema.GroupVersionResource{Group: "contour.heptio.com", Version: "v1beta1", Resource: "tlscertificatedelegations"} + +var tlscertificatedelegationsKind = schema.GroupVersionKind{Group: "contour.heptio.com", Version: "v1beta1", Kind: "TLSCertificateDelegation"} + +// Get takes name of the tLSCertificateDelegation, and returns the corresponding tLSCertificateDelegation object, and an error if there is any. +func (c *FakeTLSCertificateDelegations) Get(name string, options v1.GetOptions) (result *v1beta1.TLSCertificateDelegation, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(tlscertificatedelegationsResource, c.ns, name), &v1beta1.TLSCertificateDelegation{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TLSCertificateDelegation), err +} + +// List takes label and field selectors, and returns the list of TLSCertificateDelegations that match those selectors. +func (c *FakeTLSCertificateDelegations) List(opts v1.ListOptions) (result *v1beta1.TLSCertificateDelegationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(tlscertificatedelegationsResource, tlscertificatedelegationsKind, c.ns, opts), &v1beta1.TLSCertificateDelegationList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.TLSCertificateDelegationList{ListMeta: obj.(*v1beta1.TLSCertificateDelegationList).ListMeta} + for _, item := range obj.(*v1beta1.TLSCertificateDelegationList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested tLSCertificateDelegations. +func (c *FakeTLSCertificateDelegations) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(tlscertificatedelegationsResource, c.ns, opts)) + +} + +// Create takes the representation of a tLSCertificateDelegation and creates it. Returns the server's representation of the tLSCertificateDelegation, and an error, if there is any. +func (c *FakeTLSCertificateDelegations) Create(tLSCertificateDelegation *v1beta1.TLSCertificateDelegation) (result *v1beta1.TLSCertificateDelegation, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(tlscertificatedelegationsResource, c.ns, tLSCertificateDelegation), &v1beta1.TLSCertificateDelegation{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TLSCertificateDelegation), err +} + +// Update takes the representation of a tLSCertificateDelegation and updates it. Returns the server's representation of the tLSCertificateDelegation, and an error, if there is any. +func (c *FakeTLSCertificateDelegations) Update(tLSCertificateDelegation *v1beta1.TLSCertificateDelegation) (result *v1beta1.TLSCertificateDelegation, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(tlscertificatedelegationsResource, c.ns, tLSCertificateDelegation), &v1beta1.TLSCertificateDelegation{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TLSCertificateDelegation), err +} + +// Delete takes name of the tLSCertificateDelegation and deletes it. Returns an error if one occurs. +func (c *FakeTLSCertificateDelegations) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(tlscertificatedelegationsResource, c.ns, name), &v1beta1.TLSCertificateDelegation{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTLSCertificateDelegations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(tlscertificatedelegationsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1beta1.TLSCertificateDelegationList{}) + return err +} + +// Patch applies the patch and returns the patched tLSCertificateDelegation. +func (c *FakeTLSCertificateDelegations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.TLSCertificateDelegation, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(tlscertificatedelegationsResource, c.ns, name, data, subresources...), &v1beta1.TLSCertificateDelegation{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.TLSCertificateDelegation), err +} diff --git a/apis/generated/clientset/versioned/typed/contour/v1beta1/generated_expansion.go b/apis/generated/clientset/versioned/typed/contour/v1beta1/generated_expansion.go index 1b416ba33d1..405792becda 100644 --- a/apis/generated/clientset/versioned/typed/contour/v1beta1/generated_expansion.go +++ b/apis/generated/clientset/versioned/typed/contour/v1beta1/generated_expansion.go @@ -19,3 +19,5 @@ limitations under the License. package v1beta1 type IngressRouteExpansion interface{} + +type TLSCertificateDelegationExpansion interface{} diff --git a/apis/generated/clientset/versioned/typed/contour/v1beta1/tlscertificatedelegation.go b/apis/generated/clientset/versioned/typed/contour/v1beta1/tlscertificatedelegation.go new file mode 100644 index 00000000000..ba1dbbcec1e --- /dev/null +++ b/apis/generated/clientset/versioned/typed/contour/v1beta1/tlscertificatedelegation.go @@ -0,0 +1,157 @@ +/* +Copyright 2019 Heptio + +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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/heptio/contour/apis/contour/v1beta1" + scheme "github.com/heptio/contour/apis/generated/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// TLSCertificateDelegationsGetter has a method to return a TLSCertificateDelegationInterface. +// A group's client should implement this interface. +type TLSCertificateDelegationsGetter interface { + TLSCertificateDelegations(namespace string) TLSCertificateDelegationInterface +} + +// TLSCertificateDelegationInterface has methods to work with TLSCertificateDelegation resources. +type TLSCertificateDelegationInterface interface { + Create(*v1beta1.TLSCertificateDelegation) (*v1beta1.TLSCertificateDelegation, error) + Update(*v1beta1.TLSCertificateDelegation) (*v1beta1.TLSCertificateDelegation, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1beta1.TLSCertificateDelegation, error) + List(opts v1.ListOptions) (*v1beta1.TLSCertificateDelegationList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.TLSCertificateDelegation, err error) + TLSCertificateDelegationExpansion +} + +// tLSCertificateDelegations implements TLSCertificateDelegationInterface +type tLSCertificateDelegations struct { + client rest.Interface + ns string +} + +// newTLSCertificateDelegations returns a TLSCertificateDelegations +func newTLSCertificateDelegations(c *ContourV1beta1Client, namespace string) *tLSCertificateDelegations { + return &tLSCertificateDelegations{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the tLSCertificateDelegation, and returns the corresponding tLSCertificateDelegation object, and an error if there is any. +func (c *tLSCertificateDelegations) Get(name string, options v1.GetOptions) (result *v1beta1.TLSCertificateDelegation, err error) { + result = &v1beta1.TLSCertificateDelegation{} + err = c.client.Get(). + Namespace(c.ns). + Resource("tlscertificatedelegations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TLSCertificateDelegations that match those selectors. +func (c *tLSCertificateDelegations) List(opts v1.ListOptions) (result *v1beta1.TLSCertificateDelegationList, err error) { + result = &v1beta1.TLSCertificateDelegationList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("tlscertificatedelegations"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested tLSCertificateDelegations. +func (c *tLSCertificateDelegations) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("tlscertificatedelegations"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a tLSCertificateDelegation and creates it. Returns the server's representation of the tLSCertificateDelegation, and an error, if there is any. +func (c *tLSCertificateDelegations) Create(tLSCertificateDelegation *v1beta1.TLSCertificateDelegation) (result *v1beta1.TLSCertificateDelegation, err error) { + result = &v1beta1.TLSCertificateDelegation{} + err = c.client.Post(). + Namespace(c.ns). + Resource("tlscertificatedelegations"). + Body(tLSCertificateDelegation). + Do(). + Into(result) + return +} + +// Update takes the representation of a tLSCertificateDelegation and updates it. Returns the server's representation of the tLSCertificateDelegation, and an error, if there is any. +func (c *tLSCertificateDelegations) Update(tLSCertificateDelegation *v1beta1.TLSCertificateDelegation) (result *v1beta1.TLSCertificateDelegation, err error) { + result = &v1beta1.TLSCertificateDelegation{} + err = c.client.Put(). + Namespace(c.ns). + Resource("tlscertificatedelegations"). + Name(tLSCertificateDelegation.Name). + Body(tLSCertificateDelegation). + Do(). + Into(result) + return +} + +// Delete takes name of the tLSCertificateDelegation and deletes it. Returns an error if one occurs. +func (c *tLSCertificateDelegations) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("tlscertificatedelegations"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *tLSCertificateDelegations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("tlscertificatedelegations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched tLSCertificateDelegation. +func (c *tLSCertificateDelegations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.TLSCertificateDelegation, err error) { + result = &v1beta1.TLSCertificateDelegation{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("tlscertificatedelegations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/apis/generated/informers/externalversions/contour/v1beta1/interface.go b/apis/generated/informers/externalversions/contour/v1beta1/interface.go index 144fc4bfa0b..29525d60b57 100644 --- a/apis/generated/informers/externalversions/contour/v1beta1/interface.go +++ b/apis/generated/informers/externalversions/contour/v1beta1/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // IngressRoutes returns a IngressRouteInformer. IngressRoutes() IngressRouteInformer + // TLSCertificateDelegations returns a TLSCertificateDelegationInformer. + TLSCertificateDelegations() TLSCertificateDelegationInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) IngressRoutes() IngressRouteInformer { return &ingressRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// TLSCertificateDelegations returns a TLSCertificateDelegationInformer. +func (v *version) TLSCertificateDelegations() TLSCertificateDelegationInformer { + return &tLSCertificateDelegationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/apis/generated/informers/externalversions/contour/v1beta1/tlscertificatedelegation.go b/apis/generated/informers/externalversions/contour/v1beta1/tlscertificatedelegation.go new file mode 100644 index 00000000000..fee24cf9712 --- /dev/null +++ b/apis/generated/informers/externalversions/contour/v1beta1/tlscertificatedelegation.go @@ -0,0 +1,89 @@ +/* +Copyright 2019 Heptio + +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. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + time "time" + + contourv1beta1 "github.com/heptio/contour/apis/contour/v1beta1" + versioned "github.com/heptio/contour/apis/generated/clientset/versioned" + internalinterfaces "github.com/heptio/contour/apis/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/heptio/contour/apis/generated/listers/contour/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// TLSCertificateDelegationInformer provides access to a shared informer and lister for +// TLSCertificateDelegations. +type TLSCertificateDelegationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.TLSCertificateDelegationLister +} + +type tLSCertificateDelegationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTLSCertificateDelegationInformer constructs a new informer for TLSCertificateDelegation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTLSCertificateDelegationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTLSCertificateDelegationInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTLSCertificateDelegationInformer constructs a new informer for TLSCertificateDelegation type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTLSCertificateDelegationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ContourV1beta1().TLSCertificateDelegations(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ContourV1beta1().TLSCertificateDelegations(namespace).Watch(options) + }, + }, + &contourv1beta1.TLSCertificateDelegation{}, + resyncPeriod, + indexers, + ) +} + +func (f *tLSCertificateDelegationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTLSCertificateDelegationInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *tLSCertificateDelegationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&contourv1beta1.TLSCertificateDelegation{}, f.defaultInformer) +} + +func (f *tLSCertificateDelegationInformer) Lister() v1beta1.TLSCertificateDelegationLister { + return v1beta1.NewTLSCertificateDelegationLister(f.Informer().GetIndexer()) +} diff --git a/apis/generated/informers/externalversions/generic.go b/apis/generated/informers/externalversions/generic.go index d2f9d22ef42..6a9a5f4fb80 100644 --- a/apis/generated/informers/externalversions/generic.go +++ b/apis/generated/informers/externalversions/generic.go @@ -55,6 +55,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=contour.heptio.com, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithResource("ingressroutes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Contour().V1beta1().IngressRoutes().Informer()}, nil + case v1beta1.SchemeGroupVersion.WithResource("tlscertificatedelegations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Contour().V1beta1().TLSCertificateDelegations().Informer()}, nil } diff --git a/apis/generated/listers/contour/v1beta1/expansion_generated.go b/apis/generated/listers/contour/v1beta1/expansion_generated.go index 475b6634fff..69489b8ee99 100644 --- a/apis/generated/listers/contour/v1beta1/expansion_generated.go +++ b/apis/generated/listers/contour/v1beta1/expansion_generated.go @@ -25,3 +25,11 @@ type IngressRouteListerExpansion interface{} // IngressRouteNamespaceListerExpansion allows custom methods to be added to // IngressRouteNamespaceLister. type IngressRouteNamespaceListerExpansion interface{} + +// TLSCertificateDelegationListerExpansion allows custom methods to be added to +// TLSCertificateDelegationLister. +type TLSCertificateDelegationListerExpansion interface{} + +// TLSCertificateDelegationNamespaceListerExpansion allows custom methods to be added to +// TLSCertificateDelegationNamespaceLister. +type TLSCertificateDelegationNamespaceListerExpansion interface{} diff --git a/apis/generated/listers/contour/v1beta1/tlscertificatedelegation.go b/apis/generated/listers/contour/v1beta1/tlscertificatedelegation.go new file mode 100644 index 00000000000..7003ef30163 --- /dev/null +++ b/apis/generated/listers/contour/v1beta1/tlscertificatedelegation.go @@ -0,0 +1,94 @@ +/* +Copyright 2019 Heptio + +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. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/heptio/contour/apis/contour/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// TLSCertificateDelegationLister helps list TLSCertificateDelegations. +type TLSCertificateDelegationLister interface { + // List lists all TLSCertificateDelegations in the indexer. + List(selector labels.Selector) (ret []*v1beta1.TLSCertificateDelegation, err error) + // TLSCertificateDelegations returns an object that can list and get TLSCertificateDelegations. + TLSCertificateDelegations(namespace string) TLSCertificateDelegationNamespaceLister + TLSCertificateDelegationListerExpansion +} + +// tLSCertificateDelegationLister implements the TLSCertificateDelegationLister interface. +type tLSCertificateDelegationLister struct { + indexer cache.Indexer +} + +// NewTLSCertificateDelegationLister returns a new TLSCertificateDelegationLister. +func NewTLSCertificateDelegationLister(indexer cache.Indexer) TLSCertificateDelegationLister { + return &tLSCertificateDelegationLister{indexer: indexer} +} + +// List lists all TLSCertificateDelegations in the indexer. +func (s *tLSCertificateDelegationLister) List(selector labels.Selector) (ret []*v1beta1.TLSCertificateDelegation, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.TLSCertificateDelegation)) + }) + return ret, err +} + +// TLSCertificateDelegations returns an object that can list and get TLSCertificateDelegations. +func (s *tLSCertificateDelegationLister) TLSCertificateDelegations(namespace string) TLSCertificateDelegationNamespaceLister { + return tLSCertificateDelegationNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TLSCertificateDelegationNamespaceLister helps list and get TLSCertificateDelegations. +type TLSCertificateDelegationNamespaceLister interface { + // List lists all TLSCertificateDelegations in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1beta1.TLSCertificateDelegation, err error) + // Get retrieves the TLSCertificateDelegation from the indexer for a given namespace and name. + Get(name string) (*v1beta1.TLSCertificateDelegation, error) + TLSCertificateDelegationNamespaceListerExpansion +} + +// tLSCertificateDelegationNamespaceLister implements the TLSCertificateDelegationNamespaceLister +// interface. +type tLSCertificateDelegationNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TLSCertificateDelegations in the indexer for a given namespace. +func (s tLSCertificateDelegationNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.TLSCertificateDelegation, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.TLSCertificateDelegation)) + }) + return ret, err +} + +// Get retrieves the TLSCertificateDelegation from the indexer for a given namespace and name. +func (s tLSCertificateDelegationNamespaceLister) Get(name string) (*v1beta1.TLSCertificateDelegation, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("tlscertificatedelegation"), name) + } + return obj.(*v1beta1.TLSCertificateDelegation), nil +} diff --git a/deployment/common/common.yaml b/deployment/common/common.yaml index 17764bd6f3b..085b8965ace 100644 --- a/deployment/common/common.yaml +++ b/deployment/common/common.yaml @@ -148,3 +148,17 @@ spec: healthyThresholdCount: type: integer --- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: tlscertificatedelegations.contour.vmware.com + labels: + component: tlscertificatedelegation +spec: + group: contour.vmware.com + version: v1beta1 + scope: Namespaced + names: + plural: tlscertificatedelegations + kind: TLSCertificateDelegation +--- diff --git a/deployment/render/daemonset-rbac.yaml b/deployment/render/daemonset-rbac.yaml index 7983ad1028b..0bb079a0542 100644 --- a/deployment/render/daemonset-rbac.yaml +++ b/deployment/render/daemonset-rbac.yaml @@ -151,6 +151,20 @@ spec: healthyThresholdCount: type: integer --- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: tlscertificatedelegations.contour.vmware.com + labels: + component: tlscertificatedelegation +spec: + group: contour.vmware.com + version: v1beta1 + scope: Namespaced + names: + plural: tlscertificatedelegations + kind: TLSCertificateDelegation +--- apiVersion: extensions/v1beta1 kind: DaemonSet metadata: diff --git a/deployment/render/deployment-rbac.yaml b/deployment/render/deployment-rbac.yaml index ca917815e67..9a885e5176d 100644 --- a/deployment/render/deployment-rbac.yaml +++ b/deployment/render/deployment-rbac.yaml @@ -151,6 +151,20 @@ spec: healthyThresholdCount: type: integer --- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: tlscertificatedelegations.contour.vmware.com + labels: + component: tlscertificatedelegation +spec: + group: contour.vmware.com + version: v1beta1 + scope: Namespaced + names: + plural: tlscertificatedelegations + kind: TLSCertificateDelegation +--- apiVersion: extensions/v1beta1 kind: Deployment metadata: