From 0b9cb5dbdad9458f752984e0985a1e2544c1219d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Wed, 3 Jul 2019 16:32:50 +0300 Subject: [PATCH] Autogenerated code --- .../ignite/v1alpha1/zz_generated.deepcopy.go | 6 +- .../meta/v1alpha1/zz_generated.deepcopy.go | 48 ++++++++++ pkg/client/zz_generated.client_image.go | 95 +++++++++++++++++++ pkg/client/zz_generated.client_kernel.go | 95 +++++++++++++++++++ pkg/client/zz_generated.client_vm.go | 95 +++++++++++++++++++ vendor/modules.txt | 8 +- 6 files changed, 340 insertions(+), 7 deletions(-) create mode 100644 pkg/client/zz_generated.client_image.go create mode 100644 pkg/client/zz_generated.client_kernel.go create mode 100644 pkg/client/zz_generated.client_vm.go diff --git a/pkg/apis/ignite/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/ignite/v1alpha1/zz_generated.deepcopy.go index 7488811be..f78fa4dc5 100644 --- a/pkg/apis/ignite/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/ignite/v1alpha1/zz_generated.deepcopy.go @@ -30,7 +30,7 @@ func (in *FileMapping) DeepCopy() *FileMapping { func (in *Image) DeepCopyInto(out *Image) { *out = *in out.TypeMeta = in.TypeMeta - out.ObjectMeta = in.ObjectMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec out.Status = in.Status return @@ -125,7 +125,7 @@ func (in *ImageStatus) DeepCopy() *ImageStatus { func (in *Kernel) DeepCopyInto(out *Kernel) { *out = *in out.TypeMeta = in.TypeMeta - out.ObjectMeta = in.ObjectMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec return } @@ -292,7 +292,7 @@ func (in *SSH) DeepCopy() *SSH { func (in *VM) DeepCopyInto(out *VM) { *out = *in out.TypeMeta = in.TypeMeta - out.ObjectMeta = in.ObjectMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) return diff --git a/pkg/apis/meta/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/meta/v1alpha1/zz_generated.deepcopy.go index 5752980d3..63b08da81 100644 --- a/pkg/apis/meta/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/meta/v1alpha1/zz_generated.deepcopy.go @@ -4,6 +4,50 @@ package v1alpha1 +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIType) DeepCopyInto(out *APIType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIType. +func (in *APIType) DeepCopy() *APIType { + if in == nil { + return nil + } + out := new(APIType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in APITypeList) DeepCopyInto(out *APITypeList) { + { + in := &in + *out = make(APITypeList, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(APIType) + (*in).DeepCopyInto(*out) + } + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APITypeList. +func (in APITypeList) DeepCopy() APITypeList { + if in == nil { + return nil + } + out := new(APITypeList) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DMID) DeepCopyInto(out *DMID) { *out = *in @@ -23,6 +67,10 @@ func (in *DMID) DeepCopy() *DMID { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) { *out = *in + if in.Created != nil { + in, out := &in.Created, &out.Created + *out = (*in).DeepCopy() + } return } diff --git a/pkg/client/zz_generated.client_image.go b/pkg/client/zz_generated.client_image.go new file mode 100644 index 000000000..09186bc2c --- /dev/null +++ b/pkg/client/zz_generated.client_image.go @@ -0,0 +1,95 @@ + +/* + Note: This file is autogenerated! Do not edit it manually! + Edit client_image_template.go instead, and run + hack/generate-client.sh afterwards. +*/ + +package client + +import ( + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1" + "github.com/weaveworks/ignite/pkg/storage" +) + +// ImageClient is an interface for accessing Image-specific API objects +type ImageClient interface { + storage.Cache + + // Get returns a Image object based on a reference string; which can either + // match the Image's Name or UID, or be a prefix of the UID + Get(ref string) (*v1alpha1.Image, error) + // Set saves a Image into the persistent storage + Set(image *v1alpha1.Image) error + // Delete deletes the API object from the storage + Delete(uid string) error + // List returns a list of all Images available + List() ([]*v1alpha1.Image, error) +} + +// Images returns the ImageClient for the Client instance +func (c *Client) Images() ImageClient { + if c.imageClient == nil { + c.imageClient = newImageClient(c.storage) + } + return c.imageClient +} + +// Images is a shorthand for accessing Images using the default client +func Images() ImageClient { + return DefaultClient.Images() +} + +// imageClient is a struct implementing the ImageClient interface +// It uses a shared storage instance passed from the Client +type imageClient struct { + storage.Cache + storage storage.Storage +} + +// newImageClient builds the imageClient struct using the storage implementation +// It automatically fetches all metadata for all API types of the specific kind into the cache +func newImageClient(s storage.Storage) ImageClient { + c, err := s.GetCache(v1alpha1.ImageKind) + if err != nil { + panic(err) + } + return &imageClient{storage: s, Cache: c} +} + +// Get returns a Image object based on a reference string; which can either +// match the Image's Name or UID, or be a prefix of the UID +func (c *imageClient) Get(ref string) (*v1alpha1.Image, error) { + meta, err := c.MatchOne(ref) + if err != nil { + return nil, err + } + image := &v1alpha1.Image{ObjectMeta: meta.ObjectMeta} + if err := c.storage.Get(image); err != nil { + return nil, err + } + return image, nil +} + +// Set saves a Image into the persistent storage +func (c *imageClient) Set(image *v1alpha1.Image) error { + return c.storage.Set(image) +} + +// Delete deletes the API object from the storage +func (c *imageClient) Delete(uid string) error { + return c.storage.Delete(v1alpha1.ImageKind, uid) +} + +// List returns a list of all Images available +func (c *imageClient) List() ([]*v1alpha1.Image, error) { + list, err := c.storage.List(v1alpha1.ImageKind) + if err != nil { + return nil, err + } + result := []*v1alpha1.Image{} + for _, item := range list { + result = append(result, item.(*v1alpha1.Image)) + } + return result, nil +} diff --git a/pkg/client/zz_generated.client_kernel.go b/pkg/client/zz_generated.client_kernel.go new file mode 100644 index 000000000..754027b96 --- /dev/null +++ b/pkg/client/zz_generated.client_kernel.go @@ -0,0 +1,95 @@ + +/* + Note: This file is autogenerated! Do not edit it manually! + Edit client_kernel_template.go instead, and run + hack/generate-client.sh afterwards. +*/ + +package client + +import ( + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1" + "github.com/weaveworks/ignite/pkg/storage" +) + +// KernelClient is an interface for accessing Kernel-specific API objects +type KernelClient interface { + storage.Cache + + // Get returns a Kernel object based on a reference string; which can either + // match the Kernel's Name or UID, or be a prefix of the UID + Get(ref string) (*v1alpha1.Kernel, error) + // Set saves a Kernel into the persistent storage + Set(kernel *v1alpha1.Kernel) error + // Delete deletes the API object from the storage + Delete(uid string) error + // List returns a list of all Kernels available + List() ([]*v1alpha1.Kernel, error) +} + +// Kernels returns the KernelClient for the Client instance +func (c *Client) Kernels() KernelClient { + if c.kernelClient == nil { + c.kernelClient = newKernelClient(c.storage) + } + return c.kernelClient +} + +// Kernels is a shorthand for accessing Kernels using the default client +func Kernels() KernelClient { + return DefaultClient.Kernels() +} + +// kernelClient is a struct implementing the KernelClient interface +// It uses a shared storage instance passed from the Client +type kernelClient struct { + storage.Cache + storage storage.Storage +} + +// newKernelClient builds the kernelClient struct using the storage implementation +// It automatically fetches all metadata for all API types of the specific kind into the cache +func newKernelClient(s storage.Storage) KernelClient { + c, err := s.GetCache(v1alpha1.KernelKind) + if err != nil { + panic(err) + } + return &kernelClient{storage: s, Cache: c} +} + +// Get returns a Kernel object based on a reference string; which can either +// match the Kernel's Name or UID, or be a prefix of the UID +func (c *kernelClient) Get(ref string) (*v1alpha1.Kernel, error) { + meta, err := c.MatchOne(ref) + if err != nil { + return nil, err + } + kernel := &v1alpha1.Kernel{ObjectMeta: meta.ObjectMeta} + if err := c.storage.Get(kernel); err != nil { + return nil, err + } + return kernel, nil +} + +// Set saves a Kernel into the persistent storage +func (c *kernelClient) Set(kernel *v1alpha1.Kernel) error { + return c.storage.Set(kernel) +} + +// Delete deletes the API object from the storage +func (c *kernelClient) Delete(uid string) error { + return c.storage.Delete(v1alpha1.KernelKind, uid) +} + +// List returns a list of all Kernels available +func (c *kernelClient) List() ([]*v1alpha1.Kernel, error) { + list, err := c.storage.List(v1alpha1.KernelKind) + if err != nil { + return nil, err + } + result := []*v1alpha1.Kernel{} + for _, item := range list { + result = append(result, item.(*v1alpha1.Kernel)) + } + return result, nil +} diff --git a/pkg/client/zz_generated.client_vm.go b/pkg/client/zz_generated.client_vm.go new file mode 100644 index 000000000..a52f2e974 --- /dev/null +++ b/pkg/client/zz_generated.client_vm.go @@ -0,0 +1,95 @@ + +/* + Note: This file is autogenerated! Do not edit it manually! + Edit client_vm_template.go instead, and run + hack/generate-client.sh afterwards. +*/ + +package client + +import ( + "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1" + "github.com/weaveworks/ignite/pkg/storage" +) + +// VMClient is an interface for accessing VM-specific API objects +type VMClient interface { + storage.Cache + + // Get returns a VM object based on a reference string; which can either + // match the VM's Name or UID, or be a prefix of the UID + Get(ref string) (*v1alpha1.VM, error) + // Set saves a VM into the persistent storage + Set(vm *v1alpha1.VM) error + // Delete deletes the API object from the storage + Delete(uid string) error + // List returns a list of all VMs available + List() ([]*v1alpha1.VM, error) +} + +// VMs returns the VMClient for the Client instance +func (c *Client) VMs() VMClient { + if c.vmClient == nil { + c.vmClient = newVMClient(c.storage) + } + return c.vmClient +} + +// VMs is a shorthand for accessing VMs using the default client +func VMs() VMClient { + return DefaultClient.VMs() +} + +// vmClient is a struct implementing the VMClient interface +// It uses a shared storage instance passed from the Client +type vmClient struct { + storage.Cache + storage storage.Storage +} + +// newVMClient builds the vmClient struct using the storage implementation +// It automatically fetches all metadata for all API types of the specific kind into the cache +func newVMClient(s storage.Storage) VMClient { + c, err := s.GetCache(v1alpha1.VMKind) + if err != nil { + panic(err) + } + return &vmClient{storage: s, Cache: c} +} + +// Get returns a VM object based on a reference string; which can either +// match the VM's Name or UID, or be a prefix of the UID +func (c *vmClient) Get(ref string) (*v1alpha1.VM, error) { + meta, err := c.MatchOne(ref) + if err != nil { + return nil, err + } + vm := &v1alpha1.VM{ObjectMeta: meta.ObjectMeta} + if err := c.storage.Get(vm); err != nil { + return nil, err + } + return vm, nil +} + +// Set saves a VM into the persistent storage +func (c *vmClient) Set(vm *v1alpha1.VM) error { + return c.storage.Set(vm) +} + +// Delete deletes the API object from the storage +func (c *vmClient) Delete(uid string) error { + return c.storage.Delete(v1alpha1.VMKind, uid) +} + +// List returns a list of all VMs available +func (c *vmClient) List() ([]*v1alpha1.VM, error) { + list, err := c.storage.List(v1alpha1.VMKind) + if err != nil { + return nil, err + } + result := []*v1alpha1.VM{} + for _, item := range list { + result = append(result, item.(*v1alpha1.VM)) + } + return result, nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index e47236adf..9514bcb3c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -189,20 +189,20 @@ gopkg.in/inf.v0 gopkg.in/yaml.v2 # k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 k8s.io/apimachinery/pkg/runtime -k8s.io/apimachinery/pkg/runtime/schema k8s.io/apimachinery/pkg/runtime/serializer k8s.io/apimachinery/pkg/util/runtime k8s.io/apimachinery/pkg/apis/meta/v1 +k8s.io/apimachinery/pkg/runtime/schema k8s.io/apimachinery/pkg/types k8s.io/apimachinery/pkg/util/wait -k8s.io/apimachinery/pkg/util/json +k8s.io/apimachinery/pkg/runtime/serializer/json k8s.io/apimachinery/pkg/util/duration k8s.io/apimachinery/pkg/conversion k8s.io/apimachinery/pkg/conversion/queryparams k8s.io/apimachinery/pkg/util/errors +k8s.io/apimachinery/pkg/util/json k8s.io/apimachinery/pkg/util/naming k8s.io/apimachinery/pkg/util/sets -k8s.io/apimachinery/pkg/runtime/serializer/json k8s.io/apimachinery/pkg/runtime/serializer/protobuf k8s.io/apimachinery/pkg/runtime/serializer/recognizer k8s.io/apimachinery/pkg/runtime/serializer/versioning @@ -212,9 +212,9 @@ k8s.io/apimachinery/pkg/labels k8s.io/apimachinery/pkg/selection k8s.io/apimachinery/pkg/util/intstr k8s.io/apimachinery/pkg/watch -k8s.io/apimachinery/third_party/forked/golang/reflect k8s.io/apimachinery/pkg/util/framer k8s.io/apimachinery/pkg/util/yaml +k8s.io/apimachinery/third_party/forked/golang/reflect k8s.io/apimachinery/pkg/apis/meta/v1/unstructured k8s.io/apimachinery/pkg/util/validation k8s.io/apimachinery/pkg/util/net