K8s: Update from v0.31.3 to v0.32.0 (#98507)
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
fmt "fmt"
|
||||
sync "sync"
|
||||
|
||||
typed "sigs.k8s.io/structured-merge-diff/v4/typed"
|
||||
)
|
||||
|
||||
@@ -33,7 +33,7 @@ func ExternalName(name, namespace string) *ExternalNameApplyConfiguration {
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the Kind field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithKind(value string) *ExternalNameApplyConfiguration {
|
||||
b.Kind = &value
|
||||
b.TypeMetaApplyConfiguration.Kind = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ func (b *ExternalNameApplyConfiguration) WithKind(value string) *ExternalNameApp
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the APIVersion field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithAPIVersion(value string) *ExternalNameApplyConfiguration {
|
||||
b.APIVersion = &value
|
||||
b.TypeMetaApplyConfiguration.APIVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func (b *ExternalNameApplyConfiguration) WithAPIVersion(value string) *ExternalN
|
||||
// If called multiple times, the Name field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithName(value string) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Name = &value
|
||||
b.ObjectMetaApplyConfiguration.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func (b *ExternalNameApplyConfiguration) WithName(value string) *ExternalNameApp
|
||||
// If called multiple times, the GenerateName field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithGenerateName(value string) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.GenerateName = &value
|
||||
b.ObjectMetaApplyConfiguration.GenerateName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ func (b *ExternalNameApplyConfiguration) WithGenerateName(value string) *Externa
|
||||
// If called multiple times, the Namespace field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithNamespace(value string) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Namespace = &value
|
||||
b.ObjectMetaApplyConfiguration.Namespace = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ func (b *ExternalNameApplyConfiguration) WithNamespace(value string) *ExternalNa
|
||||
// If called multiple times, the UID field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithUID(value types.UID) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.UID = &value
|
||||
b.ObjectMetaApplyConfiguration.UID = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ func (b *ExternalNameApplyConfiguration) WithUID(value types.UID) *ExternalNameA
|
||||
// If called multiple times, the ResourceVersion field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithResourceVersion(value string) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.ResourceVersion = &value
|
||||
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ func (b *ExternalNameApplyConfiguration) WithResourceVersion(value string) *Exte
|
||||
// If called multiple times, the Generation field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithGeneration(value int64) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.Generation = &value
|
||||
b.ObjectMetaApplyConfiguration.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ func (b *ExternalNameApplyConfiguration) WithGeneration(value int64) *ExternalNa
|
||||
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.CreationTimestamp = &value
|
||||
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ func (b *ExternalNameApplyConfiguration) WithCreationTimestamp(value metav1.Time
|
||||
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionTimestamp = &value
|
||||
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ func (b *ExternalNameApplyConfiguration) WithDeletionTimestamp(value metav1.Time
|
||||
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
|
||||
func (b *ExternalNameApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
b.DeletionGracePeriodSeconds = &value
|
||||
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -132,11 +132,11 @@ func (b *ExternalNameApplyConfiguration) WithDeletionGracePeriodSeconds(value in
|
||||
// overwriting an existing map entries in Labels field with the same key.
|
||||
func (b *ExternalNameApplyConfiguration) WithLabels(entries map[string]string) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.Labels == nil && len(entries) > 0 {
|
||||
b.Labels = make(map[string]string, len(entries))
|
||||
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
|
||||
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Labels[k] = v
|
||||
b.ObjectMetaApplyConfiguration.Labels[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -147,11 +147,11 @@ func (b *ExternalNameApplyConfiguration) WithLabels(entries map[string]string) *
|
||||
// overwriting an existing map entries in Annotations field with the same key.
|
||||
func (b *ExternalNameApplyConfiguration) WithAnnotations(entries map[string]string) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
if b.Annotations == nil && len(entries) > 0 {
|
||||
b.Annotations = make(map[string]string, len(entries))
|
||||
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
|
||||
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Annotations[k] = v
|
||||
b.ObjectMetaApplyConfiguration.Annotations[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -165,7 +165,7 @@ func (b *ExternalNameApplyConfiguration) WithOwnerReferences(values ...*v1.Owner
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithOwnerReferences")
|
||||
}
|
||||
b.OwnerReferences = append(b.OwnerReferences, *values[i])
|
||||
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -176,7 +176,7 @@ func (b *ExternalNameApplyConfiguration) WithOwnerReferences(values ...*v1.Owner
|
||||
func (b *ExternalNameApplyConfiguration) WithFinalizers(values ...string) *ExternalNameApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.Finalizers = append(b.Finalizers, values[i])
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -198,5 +198,5 @@ func (b *ExternalNameApplyConfiguration) WithSpec(value *ExternalNameSpecApplyCo
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *ExternalNameApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.Name
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package versioned
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
fmt "fmt"
|
||||
http "net/http"
|
||||
|
||||
servicev0alpha1 "github.com/grafana/grafana/pkg/generated/clientset/versioned/typed/service/v0alpha1"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
|
||||
v0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
servicev0alpha1 "github.com/grafana/grafana/pkg/generated/applyconfiguration/service/v0alpha1"
|
||||
servicev0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
applyconfigurationservicev0alpha1 "github.com/grafana/grafana/pkg/generated/applyconfiguration/service/v0alpha1"
|
||||
scheme "github.com/grafana/grafana/pkg/generated/clientset/versioned/scheme"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
@@ -24,32 +24,33 @@ type ExternalNamesGetter interface {
|
||||
|
||||
// ExternalNameInterface has methods to work with ExternalName resources.
|
||||
type ExternalNameInterface interface {
|
||||
Create(ctx context.Context, externalName *v0alpha1.ExternalName, opts v1.CreateOptions) (*v0alpha1.ExternalName, error)
|
||||
Update(ctx context.Context, externalName *v0alpha1.ExternalName, opts v1.UpdateOptions) (*v0alpha1.ExternalName, error)
|
||||
Create(ctx context.Context, externalName *servicev0alpha1.ExternalName, opts v1.CreateOptions) (*servicev0alpha1.ExternalName, error)
|
||||
Update(ctx context.Context, externalName *servicev0alpha1.ExternalName, opts v1.UpdateOptions) (*servicev0alpha1.ExternalName, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v0alpha1.ExternalName, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v0alpha1.ExternalNameList, error)
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*servicev0alpha1.ExternalName, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*servicev0alpha1.ExternalNameList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v0alpha1.ExternalName, err error)
|
||||
Apply(ctx context.Context, externalName *servicev0alpha1.ExternalNameApplyConfiguration, opts v1.ApplyOptions) (result *v0alpha1.ExternalName, err error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *servicev0alpha1.ExternalName, err error)
|
||||
Apply(ctx context.Context, externalName *applyconfigurationservicev0alpha1.ExternalNameApplyConfiguration, opts v1.ApplyOptions) (result *servicev0alpha1.ExternalName, err error)
|
||||
ExternalNameExpansion
|
||||
}
|
||||
|
||||
// externalNames implements ExternalNameInterface
|
||||
type externalNames struct {
|
||||
*gentype.ClientWithListAndApply[*v0alpha1.ExternalName, *v0alpha1.ExternalNameList, *servicev0alpha1.ExternalNameApplyConfiguration]
|
||||
*gentype.ClientWithListAndApply[*servicev0alpha1.ExternalName, *servicev0alpha1.ExternalNameList, *applyconfigurationservicev0alpha1.ExternalNameApplyConfiguration]
|
||||
}
|
||||
|
||||
// newExternalNames returns a ExternalNames
|
||||
func newExternalNames(c *ServiceV0alpha1Client, namespace string) *externalNames {
|
||||
return &externalNames{
|
||||
gentype.NewClientWithListAndApply[*v0alpha1.ExternalName, *v0alpha1.ExternalNameList, *servicev0alpha1.ExternalNameApplyConfiguration](
|
||||
gentype.NewClientWithListAndApply[*servicev0alpha1.ExternalName, *servicev0alpha1.ExternalNameList, *applyconfigurationservicev0alpha1.ExternalNameApplyConfiguration](
|
||||
"externalnames",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v0alpha1.ExternalName { return &v0alpha1.ExternalName{} },
|
||||
func() *v0alpha1.ExternalNameList { return &v0alpha1.ExternalNameList{} }),
|
||||
func() *servicev0alpha1.ExternalName { return &servicev0alpha1.ExternalName{} },
|
||||
func() *servicev0alpha1.ExternalNameList { return &servicev0alpha1.ExternalNameList{} },
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
+23
-130
@@ -5,142 +5,35 @@
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
|
||||
v0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
servicev0alpha1 "github.com/grafana/grafana/pkg/generated/applyconfiguration/service/v0alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
typedservicev0alpha1 "github.com/grafana/grafana/pkg/generated/clientset/versioned/typed/service/v0alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FakeExternalNames implements ExternalNameInterface
|
||||
type FakeExternalNames struct {
|
||||
// fakeExternalNames implements ExternalNameInterface
|
||||
type fakeExternalNames struct {
|
||||
*gentype.FakeClientWithListAndApply[*v0alpha1.ExternalName, *v0alpha1.ExternalNameList, *servicev0alpha1.ExternalNameApplyConfiguration]
|
||||
Fake *FakeServiceV0alpha1
|
||||
ns string
|
||||
}
|
||||
|
||||
var externalnamesResource = v0alpha1.SchemeGroupVersion.WithResource("externalnames")
|
||||
|
||||
var externalnamesKind = v0alpha1.SchemeGroupVersion.WithKind("ExternalName")
|
||||
|
||||
// Get takes name of the externalName, and returns the corresponding externalName object, and an error if there is any.
|
||||
func (c *FakeExternalNames) Get(ctx context.Context, name string, options v1.GetOptions) (result *v0alpha1.ExternalName, err error) {
|
||||
emptyResult := &v0alpha1.ExternalName{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(externalnamesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
func newFakeExternalNames(fake *FakeServiceV0alpha1, namespace string) typedservicev0alpha1.ExternalNameInterface {
|
||||
return &fakeExternalNames{
|
||||
gentype.NewFakeClientWithListAndApply[*v0alpha1.ExternalName, *v0alpha1.ExternalNameList, *servicev0alpha1.ExternalNameApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v0alpha1.SchemeGroupVersion.WithResource("externalnames"),
|
||||
v0alpha1.SchemeGroupVersion.WithKind("ExternalName"),
|
||||
func() *v0alpha1.ExternalName { return &v0alpha1.ExternalName{} },
|
||||
func() *v0alpha1.ExternalNameList { return &v0alpha1.ExternalNameList{} },
|
||||
func(dst, src *v0alpha1.ExternalNameList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v0alpha1.ExternalNameList) []*v0alpha1.ExternalName {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v0alpha1.ExternalNameList, items []*v0alpha1.ExternalName) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
}
|
||||
return obj.(*v0alpha1.ExternalName), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ExternalNames that match those selectors.
|
||||
func (c *FakeExternalNames) List(ctx context.Context, opts v1.ListOptions) (result *v0alpha1.ExternalNameList, err error) {
|
||||
emptyResult := &v0alpha1.ExternalNameList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(externalnamesResource, externalnamesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v0alpha1.ExternalNameList{ListMeta: obj.(*v0alpha1.ExternalNameList).ListMeta}
|
||||
for _, item := range obj.(*v0alpha1.ExternalNameList).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 externalNames.
|
||||
func (c *FakeExternalNames) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(externalnamesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a externalName and creates it. Returns the server's representation of the externalName, and an error, if there is any.
|
||||
func (c *FakeExternalNames) Create(ctx context.Context, externalName *v0alpha1.ExternalName, opts v1.CreateOptions) (result *v0alpha1.ExternalName, err error) {
|
||||
emptyResult := &v0alpha1.ExternalName{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(externalnamesResource, c.ns, externalName, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v0alpha1.ExternalName), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a externalName and updates it. Returns the server's representation of the externalName, and an error, if there is any.
|
||||
func (c *FakeExternalNames) Update(ctx context.Context, externalName *v0alpha1.ExternalName, opts v1.UpdateOptions) (result *v0alpha1.ExternalName, err error) {
|
||||
emptyResult := &v0alpha1.ExternalName{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(externalnamesResource, c.ns, externalName, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v0alpha1.ExternalName), err
|
||||
}
|
||||
|
||||
// Delete takes name of the externalName and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeExternalNames) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(externalnamesResource, c.ns, name, opts), &v0alpha1.ExternalName{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeExternalNames) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(externalnamesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v0alpha1.ExternalNameList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched externalName.
|
||||
func (c *FakeExternalNames) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v0alpha1.ExternalName, err error) {
|
||||
emptyResult := &v0alpha1.ExternalName{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(externalnamesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v0alpha1.ExternalName), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied externalName.
|
||||
func (c *FakeExternalNames) Apply(ctx context.Context, externalName *servicev0alpha1.ExternalNameApplyConfiguration, opts v1.ApplyOptions) (result *v0alpha1.ExternalName, err error) {
|
||||
if externalName == nil {
|
||||
return nil, fmt.Errorf("externalName provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(externalName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := externalName.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("externalName.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v0alpha1.ExternalName{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(externalnamesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v0alpha1.ExternalName), err
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ type FakeServiceV0alpha1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeServiceV0alpha1) ExternalNames(namespace string) v0alpha1.ExternalNameInterface {
|
||||
return &FakeExternalNames{c, namespace}
|
||||
return newFakeExternalNames(c, namespace)
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
http "net/http"
|
||||
|
||||
v0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
"github.com/grafana/grafana/pkg/generated/clientset/versioned/scheme"
|
||||
servicev0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
scheme "github.com/grafana/grafana/pkg/generated/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
@@ -71,10 +71,10 @@ func New(c rest.Interface) *ServiceV0alpha1Client {
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v0alpha1.SchemeGroupVersion
|
||||
gv := servicev0alpha1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package externalversions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
fmt "fmt"
|
||||
|
||||
v0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
servicev0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
apisservicev0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
versioned "github.com/grafana/grafana/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/grafana/grafana/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v0alpha1 "github.com/grafana/grafana/pkg/generated/listers/service/v0alpha1"
|
||||
servicev0alpha1 "github.com/grafana/grafana/pkg/generated/listers/service/v0alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
// ExternalNames.
|
||||
type ExternalNameInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v0alpha1.ExternalNameLister
|
||||
Lister() servicev0alpha1.ExternalNameLister
|
||||
}
|
||||
|
||||
type externalNameInformer struct {
|
||||
@@ -57,7 +57,7 @@ func NewFilteredExternalNameInformer(client versioned.Interface, namespace strin
|
||||
return client.ServiceV0alpha1().ExternalNames(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&servicev0alpha1.ExternalName{},
|
||||
&apisservicev0alpha1.ExternalName{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -68,9 +68,9 @@ func (f *externalNameInformer) defaultInformer(client versioned.Interface, resyn
|
||||
}
|
||||
|
||||
func (f *externalNameInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&servicev0alpha1.ExternalName{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apisservicev0alpha1.ExternalName{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *externalNameInformer) Lister() v0alpha1.ExternalNameLister {
|
||||
return v0alpha1.NewExternalNameLister(f.Informer().GetIndexer())
|
||||
func (f *externalNameInformer) Lister() servicev0alpha1.ExternalNameLister {
|
||||
return servicev0alpha1.NewExternalNameLister(f.Informer().GetIndexer())
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
v0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/listers"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
servicev0alpha1 "github.com/grafana/grafana/pkg/apis/service/v0alpha1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
listers "k8s.io/client-go/listers"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ExternalNameLister helps list ExternalNames.
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
type ExternalNameLister interface {
|
||||
// List lists all ExternalNames in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v0alpha1.ExternalName, err error)
|
||||
List(selector labels.Selector) (ret []*servicev0alpha1.ExternalName, err error)
|
||||
// ExternalNames returns an object that can list and get ExternalNames.
|
||||
ExternalNames(namespace string) ExternalNameNamespaceLister
|
||||
ExternalNameListerExpansion
|
||||
@@ -24,17 +24,17 @@ type ExternalNameLister interface {
|
||||
|
||||
// externalNameLister implements the ExternalNameLister interface.
|
||||
type externalNameLister struct {
|
||||
listers.ResourceIndexer[*v0alpha1.ExternalName]
|
||||
listers.ResourceIndexer[*servicev0alpha1.ExternalName]
|
||||
}
|
||||
|
||||
// NewExternalNameLister returns a new ExternalNameLister.
|
||||
func NewExternalNameLister(indexer cache.Indexer) ExternalNameLister {
|
||||
return &externalNameLister{listers.New[*v0alpha1.ExternalName](indexer, v0alpha1.Resource("externalname"))}
|
||||
return &externalNameLister{listers.New[*servicev0alpha1.ExternalName](indexer, servicev0alpha1.Resource("externalname"))}
|
||||
}
|
||||
|
||||
// ExternalNames returns an object that can list and get ExternalNames.
|
||||
func (s *externalNameLister) ExternalNames(namespace string) ExternalNameNamespaceLister {
|
||||
return externalNameNamespaceLister{listers.NewNamespaced[*v0alpha1.ExternalName](s.ResourceIndexer, namespace)}
|
||||
return externalNameNamespaceLister{listers.NewNamespaced[*servicev0alpha1.ExternalName](s.ResourceIndexer, namespace)}
|
||||
}
|
||||
|
||||
// ExternalNameNamespaceLister helps list and get ExternalNames.
|
||||
@@ -42,15 +42,15 @@ func (s *externalNameLister) ExternalNames(namespace string) ExternalNameNamespa
|
||||
type ExternalNameNamespaceLister interface {
|
||||
// List lists all ExternalNames in the indexer for a given namespace.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v0alpha1.ExternalName, err error)
|
||||
List(selector labels.Selector) (ret []*servicev0alpha1.ExternalName, err error)
|
||||
// Get retrieves the ExternalName from the indexer for a given namespace and name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v0alpha1.ExternalName, error)
|
||||
Get(name string) (*servicev0alpha1.ExternalName, error)
|
||||
ExternalNameNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// externalNameNamespaceLister implements the ExternalNameNamespaceLister
|
||||
// interface.
|
||||
type externalNameNamespaceLister struct {
|
||||
listers.ResourceIndexer[*v0alpha1.ExternalName]
|
||||
listers.ResourceIndexer[*servicev0alpha1.ExternalName]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user