K8s: Add k8s codegen PR check (#91903)

This commit is contained in:
Todd Treece
2024-08-14 11:06:37 -04:00
committed by GitHub
parent 44290ddf32
commit da6b02a2b0
27 changed files with 363 additions and 456 deletions
@@ -30,22 +30,24 @@ var receiversKind = v0alpha1.SchemeGroupVersion.WithKind("Receiver")
// Get takes name of the receiver, and returns the corresponding receiver object, and an error if there is any.
func (c *FakeReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v0alpha1.Receiver, err error) {
emptyResult := &v0alpha1.Receiver{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(receiversResource, c.ns, name), &v0alpha1.Receiver{})
Invokes(testing.NewGetActionWithOptions(receiversResource, c.ns, name, options), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.Receiver), err
}
// List takes label and field selectors, and returns the list of Receivers that match those selectors.
func (c *FakeReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v0alpha1.ReceiverList, err error) {
emptyResult := &v0alpha1.ReceiverList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(receiversResource, receiversKind, c.ns, opts), &v0alpha1.ReceiverList{})
Invokes(testing.NewListActionWithOptions(receiversResource, receiversKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -64,28 +66,30 @@ func (c *FakeReceivers) List(ctx context.Context, opts v1.ListOptions) (result *
// Watch returns a watch.Interface that watches the requested receivers.
func (c *FakeReceivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(receiversResource, c.ns, opts))
InvokesWatch(testing.NewWatchActionWithOptions(receiversResource, c.ns, opts))
}
// Create takes the representation of a receiver and creates it. Returns the server's representation of the receiver, and an error, if there is any.
func (c *FakeReceivers) Create(ctx context.Context, receiver *v0alpha1.Receiver, opts v1.CreateOptions) (result *v0alpha1.Receiver, err error) {
emptyResult := &v0alpha1.Receiver{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(receiversResource, c.ns, receiver), &v0alpha1.Receiver{})
Invokes(testing.NewCreateActionWithOptions(receiversResource, c.ns, receiver, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.Receiver), err
}
// Update takes the representation of a receiver and updates it. Returns the server's representation of the receiver, and an error, if there is any.
func (c *FakeReceivers) Update(ctx context.Context, receiver *v0alpha1.Receiver, opts v1.UpdateOptions) (result *v0alpha1.Receiver, err error) {
emptyResult := &v0alpha1.Receiver{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(receiversResource, c.ns, receiver), &v0alpha1.Receiver{})
Invokes(testing.NewUpdateActionWithOptions(receiversResource, c.ns, receiver, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.Receiver), err
}
@@ -100,7 +104,7 @@ func (c *FakeReceivers) Delete(ctx context.Context, name string, opts v1.DeleteO
// DeleteCollection deletes a collection of objects.
func (c *FakeReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(receiversResource, c.ns, listOpts)
action := testing.NewDeleteCollectionActionWithOptions(receiversResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v0alpha1.ReceiverList{})
return err
@@ -108,11 +112,12 @@ func (c *FakeReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOpti
// Patch applies the patch and returns the patched receiver.
func (c *FakeReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v0alpha1.Receiver, err error) {
emptyResult := &v0alpha1.Receiver{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(receiversResource, c.ns, name, pt, data, subresources...), &v0alpha1.Receiver{})
Invokes(testing.NewPatchSubresourceActionWithOptions(receiversResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.Receiver), err
}
@@ -130,11 +135,12 @@ func (c *FakeReceivers) Apply(ctx context.Context, receiver *alertingnotificatio
if name == nil {
return nil, fmt.Errorf("receiver.Name must be provided to Apply")
}
emptyResult := &v0alpha1.Receiver{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(receiversResource, c.ns, *name, types.ApplyPatchType, data), &v0alpha1.Receiver{})
Invokes(testing.NewPatchSubresourceActionWithOptions(receiversResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.Receiver), err
}
@@ -30,22 +30,24 @@ var timeintervalsKind = v0alpha1.SchemeGroupVersion.WithKind("TimeInterval")
// Get takes name of the timeInterval, and returns the corresponding timeInterval object, and an error if there is any.
func (c *FakeTimeIntervals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v0alpha1.TimeInterval, err error) {
emptyResult := &v0alpha1.TimeInterval{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(timeintervalsResource, c.ns, name), &v0alpha1.TimeInterval{})
Invokes(testing.NewGetActionWithOptions(timeintervalsResource, c.ns, name, options), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.TimeInterval), err
}
// List takes label and field selectors, and returns the list of TimeIntervals that match those selectors.
func (c *FakeTimeIntervals) List(ctx context.Context, opts v1.ListOptions) (result *v0alpha1.TimeIntervalList, err error) {
emptyResult := &v0alpha1.TimeIntervalList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(timeintervalsResource, timeintervalsKind, c.ns, opts), &v0alpha1.TimeIntervalList{})
Invokes(testing.NewListActionWithOptions(timeintervalsResource, timeintervalsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -64,28 +66,30 @@ func (c *FakeTimeIntervals) List(ctx context.Context, opts v1.ListOptions) (resu
// Watch returns a watch.Interface that watches the requested timeIntervals.
func (c *FakeTimeIntervals) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(timeintervalsResource, c.ns, opts))
InvokesWatch(testing.NewWatchActionWithOptions(timeintervalsResource, c.ns, opts))
}
// Create takes the representation of a timeInterval and creates it. Returns the server's representation of the timeInterval, and an error, if there is any.
func (c *FakeTimeIntervals) Create(ctx context.Context, timeInterval *v0alpha1.TimeInterval, opts v1.CreateOptions) (result *v0alpha1.TimeInterval, err error) {
emptyResult := &v0alpha1.TimeInterval{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(timeintervalsResource, c.ns, timeInterval), &v0alpha1.TimeInterval{})
Invokes(testing.NewCreateActionWithOptions(timeintervalsResource, c.ns, timeInterval, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.TimeInterval), err
}
// Update takes the representation of a timeInterval and updates it. Returns the server's representation of the timeInterval, and an error, if there is any.
func (c *FakeTimeIntervals) Update(ctx context.Context, timeInterval *v0alpha1.TimeInterval, opts v1.UpdateOptions) (result *v0alpha1.TimeInterval, err error) {
emptyResult := &v0alpha1.TimeInterval{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(timeintervalsResource, c.ns, timeInterval), &v0alpha1.TimeInterval{})
Invokes(testing.NewUpdateActionWithOptions(timeintervalsResource, c.ns, timeInterval, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.TimeInterval), err
}
@@ -100,7 +104,7 @@ func (c *FakeTimeIntervals) Delete(ctx context.Context, name string, opts v1.Del
// DeleteCollection deletes a collection of objects.
func (c *FakeTimeIntervals) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(timeintervalsResource, c.ns, listOpts)
action := testing.NewDeleteCollectionActionWithOptions(timeintervalsResource, c.ns, opts, listOpts)
_, err := c.Fake.Invokes(action, &v0alpha1.TimeIntervalList{})
return err
@@ -108,11 +112,12 @@ func (c *FakeTimeIntervals) DeleteCollection(ctx context.Context, opts v1.Delete
// Patch applies the patch and returns the patched timeInterval.
func (c *FakeTimeIntervals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v0alpha1.TimeInterval, err error) {
emptyResult := &v0alpha1.TimeInterval{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(timeintervalsResource, c.ns, name, pt, data, subresources...), &v0alpha1.TimeInterval{})
Invokes(testing.NewPatchSubresourceActionWithOptions(timeintervalsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.TimeInterval), err
}
@@ -130,11 +135,12 @@ func (c *FakeTimeIntervals) Apply(ctx context.Context, timeInterval *alertingnot
if name == nil {
return nil, fmt.Errorf("timeInterval.Name must be provided to Apply")
}
emptyResult := &v0alpha1.TimeInterval{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(timeintervalsResource, c.ns, *name, types.ApplyPatchType, data), &v0alpha1.TimeInterval{})
Invokes(testing.NewPatchSubresourceActionWithOptions(timeintervalsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v0alpha1.TimeInterval), err
}
@@ -6,9 +6,6 @@ package v0alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v0alpha1 "github.com/grafana/grafana/pkg/apis/alerting_notifications/v0alpha1"
alertingnotificationsv0alpha1 "github.com/grafana/grafana/pkg/generated/applyconfiguration/alerting_notifications/v0alpha1"
@@ -16,7 +13,7 @@ import (
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"
gentype "k8s.io/client-go/gentype"
)
// ReceiversGetter has a method to return a ReceiverInterface.
@@ -41,154 +38,18 @@ type ReceiverInterface interface {
// receivers implements ReceiverInterface
type receivers struct {
client rest.Interface
ns string
*gentype.ClientWithListAndApply[*v0alpha1.Receiver, *v0alpha1.ReceiverList, *alertingnotificationsv0alpha1.ReceiverApplyConfiguration]
}
// newReceivers returns a Receivers
func newReceivers(c *NotificationsV0alpha1Client, namespace string) *receivers {
return &receivers{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithListAndApply[*v0alpha1.Receiver, *v0alpha1.ReceiverList, *alertingnotificationsv0alpha1.ReceiverApplyConfiguration](
"receivers",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *v0alpha1.Receiver { return &v0alpha1.Receiver{} },
func() *v0alpha1.ReceiverList { return &v0alpha1.ReceiverList{} }),
}
}
// Get takes name of the receiver, and returns the corresponding receiver object, and an error if there is any.
func (c *receivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v0alpha1.Receiver, err error) {
result = &v0alpha1.Receiver{}
err = c.client.Get().
Namespace(c.ns).
Resource("receivers").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of Receivers that match those selectors.
func (c *receivers) List(ctx context.Context, opts v1.ListOptions) (result *v0alpha1.ReceiverList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v0alpha1.ReceiverList{}
err = c.client.Get().
Namespace(c.ns).
Resource("receivers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested receivers.
func (c *receivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("receivers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a receiver and creates it. Returns the server's representation of the receiver, and an error, if there is any.
func (c *receivers) Create(ctx context.Context, receiver *v0alpha1.Receiver, opts v1.CreateOptions) (result *v0alpha1.Receiver, err error) {
result = &v0alpha1.Receiver{}
err = c.client.Post().
Namespace(c.ns).
Resource("receivers").
VersionedParams(&opts, scheme.ParameterCodec).
Body(receiver).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a receiver and updates it. Returns the server's representation of the receiver, and an error, if there is any.
func (c *receivers) Update(ctx context.Context, receiver *v0alpha1.Receiver, opts v1.UpdateOptions) (result *v0alpha1.Receiver, err error) {
result = &v0alpha1.Receiver{}
err = c.client.Put().
Namespace(c.ns).
Resource("receivers").
Name(receiver.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(receiver).
Do(ctx).
Into(result)
return
}
// Delete takes name of the receiver and deletes it. Returns an error if one occurs.
func (c *receivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("receivers").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *receivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("receivers").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched receiver.
func (c *receivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v0alpha1.Receiver, err error) {
result = &v0alpha1.Receiver{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("receivers").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied receiver.
func (c *receivers) Apply(ctx context.Context, receiver *alertingnotificationsv0alpha1.ReceiverApplyConfiguration, opts v1.ApplyOptions) (result *v0alpha1.Receiver, err error) {
if receiver == nil {
return nil, fmt.Errorf("receiver provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(receiver)
if err != nil {
return nil, err
}
name := receiver.Name
if name == nil {
return nil, fmt.Errorf("receiver.Name must be provided to Apply")
}
result = &v0alpha1.Receiver{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("receivers").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
@@ -6,9 +6,6 @@ package v0alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v0alpha1 "github.com/grafana/grafana/pkg/apis/alerting_notifications/v0alpha1"
alertingnotificationsv0alpha1 "github.com/grafana/grafana/pkg/generated/applyconfiguration/alerting_notifications/v0alpha1"
@@ -16,7 +13,7 @@ import (
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"
gentype "k8s.io/client-go/gentype"
)
// TimeIntervalsGetter has a method to return a TimeIntervalInterface.
@@ -41,154 +38,18 @@ type TimeIntervalInterface interface {
// timeIntervals implements TimeIntervalInterface
type timeIntervals struct {
client rest.Interface
ns string
*gentype.ClientWithListAndApply[*v0alpha1.TimeInterval, *v0alpha1.TimeIntervalList, *alertingnotificationsv0alpha1.TimeIntervalApplyConfiguration]
}
// newTimeIntervals returns a TimeIntervals
func newTimeIntervals(c *NotificationsV0alpha1Client, namespace string) *timeIntervals {
return &timeIntervals{
client: c.RESTClient(),
ns: namespace,
gentype.NewClientWithListAndApply[*v0alpha1.TimeInterval, *v0alpha1.TimeIntervalList, *alertingnotificationsv0alpha1.TimeIntervalApplyConfiguration](
"timeintervals",
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *v0alpha1.TimeInterval { return &v0alpha1.TimeInterval{} },
func() *v0alpha1.TimeIntervalList { return &v0alpha1.TimeIntervalList{} }),
}
}
// Get takes name of the timeInterval, and returns the corresponding timeInterval object, and an error if there is any.
func (c *timeIntervals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v0alpha1.TimeInterval, err error) {
result = &v0alpha1.TimeInterval{}
err = c.client.Get().
Namespace(c.ns).
Resource("timeintervals").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of TimeIntervals that match those selectors.
func (c *timeIntervals) List(ctx context.Context, opts v1.ListOptions) (result *v0alpha1.TimeIntervalList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v0alpha1.TimeIntervalList{}
err = c.client.Get().
Namespace(c.ns).
Resource("timeintervals").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested timeIntervals.
func (c *timeIntervals) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("timeintervals").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a timeInterval and creates it. Returns the server's representation of the timeInterval, and an error, if there is any.
func (c *timeIntervals) Create(ctx context.Context, timeInterval *v0alpha1.TimeInterval, opts v1.CreateOptions) (result *v0alpha1.TimeInterval, err error) {
result = &v0alpha1.TimeInterval{}
err = c.client.Post().
Namespace(c.ns).
Resource("timeintervals").
VersionedParams(&opts, scheme.ParameterCodec).
Body(timeInterval).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a timeInterval and updates it. Returns the server's representation of the timeInterval, and an error, if there is any.
func (c *timeIntervals) Update(ctx context.Context, timeInterval *v0alpha1.TimeInterval, opts v1.UpdateOptions) (result *v0alpha1.TimeInterval, err error) {
result = &v0alpha1.TimeInterval{}
err = c.client.Put().
Namespace(c.ns).
Resource("timeintervals").
Name(timeInterval.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(timeInterval).
Do(ctx).
Into(result)
return
}
// Delete takes name of the timeInterval and deletes it. Returns an error if one occurs.
func (c *timeIntervals) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("timeintervals").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *timeIntervals) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("timeintervals").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched timeInterval.
func (c *timeIntervals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v0alpha1.TimeInterval, err error) {
result = &v0alpha1.TimeInterval{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("timeintervals").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied timeInterval.
func (c *timeIntervals) Apply(ctx context.Context, timeInterval *alertingnotificationsv0alpha1.TimeIntervalApplyConfiguration, opts v1.ApplyOptions) (result *v0alpha1.TimeInterval, err error) {
if timeInterval == nil {
return nil, fmt.Errorf("timeInterval provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(timeInterval)
if err != nil {
return nil, err
}
name := timeInterval.Name
if name == nil {
return nil, fmt.Errorf("timeInterval.Name must be provided to Apply")
}
result = &v0alpha1.TimeInterval{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("timeintervals").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}