diff --git a/pkg/apis/ark/v1/zz_generated.deepcopy.go b/pkg/apis/ark/v1/zz_generated.deepcopy.go new file mode 100644 index 000000000..1eb67a306 --- /dev/null +++ b/pkg/apis/ark/v1/zz_generated.deepcopy.go @@ -0,0 +1,1062 @@ +// +build !ignore_autogenerated + +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + +// This file was autogenerated by deepcopy-gen. Do not edit it manually! + +package v1 + +import ( + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + reflect "reflect" +) + +// GetGeneratedDeepCopyFuncs returns the generated funcs, since we aren't registering them. +// +// Deprecated: deepcopy registration will go away when static deepcopy is fully implemented. +func GetGeneratedDeepCopyFuncs() []conversion.GeneratedDeepCopyFunc { + return []conversion.GeneratedDeepCopyFunc{ + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*AWSConfig).DeepCopyInto(out.(*AWSConfig)) + return nil + }, InType: reflect.TypeOf(&AWSConfig{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*AzureConfig).DeepCopyInto(out.(*AzureConfig)) + return nil + }, InType: reflect.TypeOf(&AzureConfig{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*Backup).DeepCopyInto(out.(*Backup)) + return nil + }, InType: reflect.TypeOf(&Backup{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*BackupHooks).DeepCopyInto(out.(*BackupHooks)) + return nil + }, InType: reflect.TypeOf(&BackupHooks{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*BackupList).DeepCopyInto(out.(*BackupList)) + return nil + }, InType: reflect.TypeOf(&BackupList{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*BackupResourceHook).DeepCopyInto(out.(*BackupResourceHook)) + return nil + }, InType: reflect.TypeOf(&BackupResourceHook{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*BackupResourceHookSpec).DeepCopyInto(out.(*BackupResourceHookSpec)) + return nil + }, InType: reflect.TypeOf(&BackupResourceHookSpec{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*BackupSpec).DeepCopyInto(out.(*BackupSpec)) + return nil + }, InType: reflect.TypeOf(&BackupSpec{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*BackupStatus).DeepCopyInto(out.(*BackupStatus)) + return nil + }, InType: reflect.TypeOf(&BackupStatus{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*CloudProviderConfig).DeepCopyInto(out.(*CloudProviderConfig)) + return nil + }, InType: reflect.TypeOf(&CloudProviderConfig{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*Config).DeepCopyInto(out.(*Config)) + return nil + }, InType: reflect.TypeOf(&Config{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ConfigList).DeepCopyInto(out.(*ConfigList)) + return nil + }, InType: reflect.TypeOf(&ConfigList{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*DownloadRequest).DeepCopyInto(out.(*DownloadRequest)) + return nil + }, InType: reflect.TypeOf(&DownloadRequest{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*DownloadRequestList).DeepCopyInto(out.(*DownloadRequestList)) + return nil + }, InType: reflect.TypeOf(&DownloadRequestList{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*DownloadRequestSpec).DeepCopyInto(out.(*DownloadRequestSpec)) + return nil + }, InType: reflect.TypeOf(&DownloadRequestSpec{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*DownloadRequestStatus).DeepCopyInto(out.(*DownloadRequestStatus)) + return nil + }, InType: reflect.TypeOf(&DownloadRequestStatus{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*DownloadTarget).DeepCopyInto(out.(*DownloadTarget)) + return nil + }, InType: reflect.TypeOf(&DownloadTarget{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ExecHook).DeepCopyInto(out.(*ExecHook)) + return nil + }, InType: reflect.TypeOf(&ExecHook{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*GCPConfig).DeepCopyInto(out.(*GCPConfig)) + return nil + }, InType: reflect.TypeOf(&GCPConfig{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ObjectStorageProviderConfig).DeepCopyInto(out.(*ObjectStorageProviderConfig)) + return nil + }, InType: reflect.TypeOf(&ObjectStorageProviderConfig{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*Restore).DeepCopyInto(out.(*Restore)) + return nil + }, InType: reflect.TypeOf(&Restore{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*RestoreList).DeepCopyInto(out.(*RestoreList)) + return nil + }, InType: reflect.TypeOf(&RestoreList{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*RestoreResult).DeepCopyInto(out.(*RestoreResult)) + return nil + }, InType: reflect.TypeOf(&RestoreResult{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*RestoreSpec).DeepCopyInto(out.(*RestoreSpec)) + return nil + }, InType: reflect.TypeOf(&RestoreSpec{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*RestoreStatus).DeepCopyInto(out.(*RestoreStatus)) + return nil + }, InType: reflect.TypeOf(&RestoreStatus{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*Schedule).DeepCopyInto(out.(*Schedule)) + return nil + }, InType: reflect.TypeOf(&Schedule{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ScheduleList).DeepCopyInto(out.(*ScheduleList)) + return nil + }, InType: reflect.TypeOf(&ScheduleList{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ScheduleSpec).DeepCopyInto(out.(*ScheduleSpec)) + return nil + }, InType: reflect.TypeOf(&ScheduleSpec{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ScheduleStatus).DeepCopyInto(out.(*ScheduleStatus)) + return nil + }, InType: reflect.TypeOf(&ScheduleStatus{})}, + {Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*VolumeBackupInfo).DeepCopyInto(out.(*VolumeBackupInfo)) + return nil + }, InType: reflect.TypeOf(&VolumeBackupInfo{})}, + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSConfig) DeepCopyInto(out *AWSConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSConfig. +func (in *AWSConfig) DeepCopy() *AWSConfig { + if in == nil { + return nil + } + out := new(AWSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AzureConfig) DeepCopyInto(out *AzureConfig) { + *out = *in + out.APITimeout = in.APITimeout + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureConfig. +func (in *AzureConfig) DeepCopy() *AzureConfig { + if in == nil { + return nil + } + out := new(AzureConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Backup) DeepCopyInto(out *Backup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backup. +func (in *Backup) DeepCopy() *Backup { + if in == nil { + return nil + } + out := new(Backup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Backup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupHooks) DeepCopyInto(out *BackupHooks) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]BackupResourceHookSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupHooks. +func (in *BackupHooks) DeepCopy() *BackupHooks { + if in == nil { + return nil + } + out := new(BackupHooks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupList) DeepCopyInto(out *BackupList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Backup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupList. +func (in *BackupList) DeepCopy() *BackupList { + if in == nil { + return nil + } + out := new(BackupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupResourceHook) DeepCopyInto(out *BackupResourceHook) { + *out = *in + if in.Exec != nil { + in, out := &in.Exec, &out.Exec + if *in == nil { + *out = nil + } else { + *out = new(ExecHook) + (*in).DeepCopyInto(*out) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupResourceHook. +func (in *BackupResourceHook) DeepCopy() *BackupResourceHook { + if in == nil { + return nil + } + out := new(BackupResourceHook) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupResourceHookSpec) DeepCopyInto(out *BackupResourceHookSpec) { + *out = *in + if in.IncludedNamespaces != nil { + in, out := &in.IncludedNamespaces, &out.IncludedNamespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludedNamespaces != nil { + in, out := &in.ExcludedNamespaces, &out.ExcludedNamespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IncludedResources != nil { + in, out := &in.IncludedResources, &out.IncludedResources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludedResources != nil { + in, out := &in.ExcludedResources, &out.ExcludedResources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.LabelSelector != nil { + in, out := &in.LabelSelector, &out.LabelSelector + if *in == nil { + *out = nil + } else { + *out = new(meta_v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + } + if in.Hooks != nil { + in, out := &in.Hooks, &out.Hooks + *out = make([]BackupResourceHook, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupResourceHookSpec. +func (in *BackupResourceHookSpec) DeepCopy() *BackupResourceHookSpec { + if in == nil { + return nil + } + out := new(BackupResourceHookSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupSpec) DeepCopyInto(out *BackupSpec) { + *out = *in + if in.IncludedNamespaces != nil { + in, out := &in.IncludedNamespaces, &out.IncludedNamespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludedNamespaces != nil { + in, out := &in.ExcludedNamespaces, &out.ExcludedNamespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IncludedResources != nil { + in, out := &in.IncludedResources, &out.IncludedResources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludedResources != nil { + in, out := &in.ExcludedResources, &out.ExcludedResources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.LabelSelector != nil { + in, out := &in.LabelSelector, &out.LabelSelector + if *in == nil { + *out = nil + } else { + *out = new(meta_v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + } + if in.SnapshotVolumes != nil { + in, out := &in.SnapshotVolumes, &out.SnapshotVolumes + if *in == nil { + *out = nil + } else { + *out = new(bool) + **out = **in + } + } + out.TTL = in.TTL + if in.IncludeClusterResources != nil { + in, out := &in.IncludeClusterResources, &out.IncludeClusterResources + if *in == nil { + *out = nil + } else { + *out = new(bool) + **out = **in + } + } + in.Hooks.DeepCopyInto(&out.Hooks) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupSpec. +func (in *BackupSpec) DeepCopy() *BackupSpec { + if in == nil { + return nil + } + out := new(BackupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupStatus) DeepCopyInto(out *BackupStatus) { + *out = *in + in.Expiration.DeepCopyInto(&out.Expiration) + if in.VolumeBackups != nil { + in, out := &in.VolumeBackups, &out.VolumeBackups + *out = make(map[string]*VolumeBackupInfo, len(*in)) + for key, val := range *in { + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = new(VolumeBackupInfo) + val.DeepCopyInto((*out)[key]) + } + } + } + if in.ValidationErrors != nil { + in, out := &in.ValidationErrors, &out.ValidationErrors + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupStatus. +func (in *BackupStatus) DeepCopy() *BackupStatus { + if in == nil { + return nil + } + out := new(BackupStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudProviderConfig) DeepCopyInto(out *CloudProviderConfig) { + *out = *in + if in.AWS != nil { + in, out := &in.AWS, &out.AWS + if *in == nil { + *out = nil + } else { + *out = new(AWSConfig) + **out = **in + } + } + if in.GCP != nil { + in, out := &in.GCP, &out.GCP + if *in == nil { + *out = nil + } else { + *out = new(GCPConfig) + **out = **in + } + } + if in.Azure != nil { + in, out := &in.Azure, &out.Azure + if *in == nil { + *out = nil + } else { + *out = new(AzureConfig) + **out = **in + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfig. +func (in *CloudProviderConfig) DeepCopy() *CloudProviderConfig { + if in == nil { + return nil + } + out := new(CloudProviderConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Config) DeepCopyInto(out *Config) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.PersistentVolumeProvider != nil { + in, out := &in.PersistentVolumeProvider, &out.PersistentVolumeProvider + if *in == nil { + *out = nil + } else { + *out = new(CloudProviderConfig) + (*in).DeepCopyInto(*out) + } + } + in.BackupStorageProvider.DeepCopyInto(&out.BackupStorageProvider) + out.BackupSyncPeriod = in.BackupSyncPeriod + out.GCSyncPeriod = in.GCSyncPeriod + out.ScheduleSyncPeriod = in.ScheduleSyncPeriod + if in.ResourcePriorities != nil { + in, out := &in.ResourcePriorities, &out.ResourcePriorities + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config. +func (in *Config) DeepCopy() *Config { + if in == nil { + return nil + } + out := new(Config) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Config) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigList) DeepCopyInto(out *ConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Config, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigList. +func (in *ConfigList) DeepCopy() *ConfigList { + if in == nil { + return nil + } + out := new(ConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DownloadRequest) DeepCopyInto(out *DownloadRequest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DownloadRequest. +func (in *DownloadRequest) DeepCopy() *DownloadRequest { + if in == nil { + return nil + } + out := new(DownloadRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DownloadRequest) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DownloadRequestList) DeepCopyInto(out *DownloadRequestList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DownloadRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DownloadRequestList. +func (in *DownloadRequestList) DeepCopy() *DownloadRequestList { + if in == nil { + return nil + } + out := new(DownloadRequestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DownloadRequestList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DownloadRequestSpec) DeepCopyInto(out *DownloadRequestSpec) { + *out = *in + out.Target = in.Target + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DownloadRequestSpec. +func (in *DownloadRequestSpec) DeepCopy() *DownloadRequestSpec { + if in == nil { + return nil + } + out := new(DownloadRequestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DownloadRequestStatus) DeepCopyInto(out *DownloadRequestStatus) { + *out = *in + in.Expiration.DeepCopyInto(&out.Expiration) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DownloadRequestStatus. +func (in *DownloadRequestStatus) DeepCopy() *DownloadRequestStatus { + if in == nil { + return nil + } + out := new(DownloadRequestStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DownloadTarget) DeepCopyInto(out *DownloadTarget) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DownloadTarget. +func (in *DownloadTarget) DeepCopy() *DownloadTarget { + if in == nil { + return nil + } + out := new(DownloadTarget) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExecHook) DeepCopyInto(out *ExecHook) { + *out = *in + if in.Command != nil { + in, out := &in.Command, &out.Command + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.Timeout = in.Timeout + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecHook. +func (in *ExecHook) DeepCopy() *ExecHook { + if in == nil { + return nil + } + out := new(ExecHook) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPConfig) DeepCopyInto(out *GCPConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPConfig. +func (in *GCPConfig) DeepCopy() *GCPConfig { + if in == nil { + return nil + } + out := new(GCPConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectStorageProviderConfig) DeepCopyInto(out *ObjectStorageProviderConfig) { + *out = *in + in.CloudProviderConfig.DeepCopyInto(&out.CloudProviderConfig) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStorageProviderConfig. +func (in *ObjectStorageProviderConfig) DeepCopy() *ObjectStorageProviderConfig { + if in == nil { + return nil + } + out := new(ObjectStorageProviderConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Restore) DeepCopyInto(out *Restore) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Restore. +func (in *Restore) DeepCopy() *Restore { + if in == nil { + return nil + } + out := new(Restore) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Restore) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestoreList) DeepCopyInto(out *RestoreList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Restore, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreList. +func (in *RestoreList) DeepCopy() *RestoreList { + if in == nil { + return nil + } + out := new(RestoreList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RestoreList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestoreResult) DeepCopyInto(out *RestoreResult) { + *out = *in + if in.Ark != nil { + in, out := &in.Ark, &out.Ark + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Cluster != nil { + in, out := &in.Cluster, &out.Cluster + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Namespaces != nil { + in, out := &in.Namespaces, &out.Namespaces + *out = make(map[string][]string, len(*in)) + for key, val := range *in { + if val == nil { + (*out)[key] = nil + } else { + (*out)[key] = make([]string, len(val)) + copy((*out)[key], val) + } + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreResult. +func (in *RestoreResult) DeepCopy() *RestoreResult { + if in == nil { + return nil + } + out := new(RestoreResult) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec) { + *out = *in + if in.IncludedNamespaces != nil { + in, out := &in.IncludedNamespaces, &out.IncludedNamespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludedNamespaces != nil { + in, out := &in.ExcludedNamespaces, &out.ExcludedNamespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IncludedResources != nil { + in, out := &in.IncludedResources, &out.IncludedResources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludedResources != nil { + in, out := &in.ExcludedResources, &out.ExcludedResources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.NamespaceMapping != nil { + in, out := &in.NamespaceMapping, &out.NamespaceMapping + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.LabelSelector != nil { + in, out := &in.LabelSelector, &out.LabelSelector + if *in == nil { + *out = nil + } else { + *out = new(meta_v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + } + if in.RestorePVs != nil { + in, out := &in.RestorePVs, &out.RestorePVs + if *in == nil { + *out = nil + } else { + *out = new(bool) + **out = **in + } + } + if in.IncludeClusterResources != nil { + in, out := &in.IncludeClusterResources, &out.IncludeClusterResources + if *in == nil { + *out = nil + } else { + *out = new(bool) + **out = **in + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreSpec. +func (in *RestoreSpec) DeepCopy() *RestoreSpec { + if in == nil { + return nil + } + out := new(RestoreSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RestoreStatus) DeepCopyInto(out *RestoreStatus) { + *out = *in + if in.ValidationErrors != nil { + in, out := &in.ValidationErrors, &out.ValidationErrors + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.Warnings.DeepCopyInto(&out.Warnings) + in.Errors.DeepCopyInto(&out.Errors) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreStatus. +func (in *RestoreStatus) DeepCopy() *RestoreStatus { + if in == nil { + return nil + } + out := new(RestoreStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Schedule) DeepCopyInto(out *Schedule) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Schedule. +func (in *Schedule) DeepCopy() *Schedule { + if in == nil { + return nil + } + out := new(Schedule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Schedule) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduleList) DeepCopyInto(out *ScheduleList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Schedule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleList. +func (in *ScheduleList) DeepCopy() *ScheduleList { + if in == nil { + return nil + } + out := new(ScheduleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ScheduleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduleSpec) DeepCopyInto(out *ScheduleSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleSpec. +func (in *ScheduleSpec) DeepCopy() *ScheduleSpec { + if in == nil { + return nil + } + out := new(ScheduleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ScheduleStatus) DeepCopyInto(out *ScheduleStatus) { + *out = *in + in.LastBackup.DeepCopyInto(&out.LastBackup) + if in.ValidationErrors != nil { + in, out := &in.ValidationErrors, &out.ValidationErrors + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleStatus. +func (in *ScheduleStatus) DeepCopy() *ScheduleStatus { + if in == nil { + return nil + } + out := new(ScheduleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VolumeBackupInfo) DeepCopyInto(out *VolumeBackupInfo) { + *out = *in + if in.Iops != nil { + in, out := &in.Iops, &out.Iops + if *in == nil { + *out = nil + } else { + *out = new(int64) + **out = **in + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeBackupInfo. +func (in *VolumeBackupInfo) DeepCopy() *VolumeBackupInfo { + if in == nil { + return nil + } + out := new(VolumeBackupInfo) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/generated/clientset/doc.go b/pkg/generated/clientset/doc.go deleted file mode 100644 index 99fa56f54..000000000 --- a/pkg/generated/clientset/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// This package is generated by client-gen with custom arguments. - -// This package has the automatically generated clientset. -package clientset diff --git a/pkg/generated/clientset/fake/doc.go b/pkg/generated/clientset/fake/doc.go deleted file mode 100644 index 760aaa825..000000000 --- a/pkg/generated/clientset/fake/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// This package is generated by client-gen with custom arguments. - -// This package has the automatically generated fake clientset. -package fake diff --git a/pkg/generated/clientset/scheme/doc.go b/pkg/generated/clientset/scheme/doc.go deleted file mode 100644 index d1c53d03b..000000000 --- a/pkg/generated/clientset/scheme/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// This package is generated by client-gen with custom arguments. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/pkg/generated/clientset/typed/ark/v1/doc.go b/pkg/generated/clientset/typed/ark/v1/doc.go deleted file mode 100644 index 0e93c2c5e..000000000 --- a/pkg/generated/clientset/typed/ark/v1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// This package is generated by client-gen with custom arguments. - -// This package has the automatically generated typed clients. -package v1 diff --git a/pkg/generated/clientset/typed/ark/v1/fake/doc.go b/pkg/generated/clientset/typed/ark/v1/fake/doc.go deleted file mode 100644 index e3bbd12a2..000000000 --- a/pkg/generated/clientset/typed/ark/v1/fake/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// This package is generated by client-gen with custom arguments. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/generated/clientset/typed/ark/v1/fake/fake_backup.go b/pkg/generated/clientset/typed/ark/v1/fake/fake_backup.go deleted file mode 100644 index 9eb939ac7..000000000 --- a/pkg/generated/clientset/typed/ark/v1/fake/fake_backup.go +++ /dev/null @@ -1,114 +0,0 @@ -package fake - -import ( - v1 "github.com/heptio/ark/pkg/apis/ark/v1" - meta_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" -) - -// FakeBackups implements BackupInterface -type FakeBackups struct { - Fake *FakeArkV1 - ns string -} - -var backupsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "backups"} - -var backupsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Backup"} - -func (c *FakeBackups) Create(backup *v1.Backup) (result *v1.Backup, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(backupsResource, c.ns, backup), &v1.Backup{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Backup), err -} - -func (c *FakeBackups) Update(backup *v1.Backup) (result *v1.Backup, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(backupsResource, c.ns, backup), &v1.Backup{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Backup), err -} - -func (c *FakeBackups) UpdateStatus(backup *v1.Backup) (*v1.Backup, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(backupsResource, "status", c.ns, backup), &v1.Backup{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Backup), err -} - -func (c *FakeBackups) Delete(name string, options *meta_v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(backupsResource, c.ns, name), &v1.Backup{}) - - return err -} - -func (c *FakeBackups) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(backupsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1.BackupList{}) - return err -} - -func (c *FakeBackups) Get(name string, options meta_v1.GetOptions) (result *v1.Backup, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(backupsResource, c.ns, name), &v1.Backup{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Backup), err -} - -func (c *FakeBackups) List(opts meta_v1.ListOptions) (result *v1.BackupList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(backupsResource, backupsKind, c.ns, opts), &v1.BackupList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.BackupList{} - for _, item := range obj.(*v1.BackupList).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 backups. -func (c *FakeBackups) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(backupsResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched backup. -func (c *FakeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Backup, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, data, subresources...), &v1.Backup{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Backup), err -} diff --git a/pkg/generated/clientset/typed/ark/v1/fake/fake_config.go b/pkg/generated/clientset/typed/ark/v1/fake/fake_config.go deleted file mode 100644 index 6b9906264..000000000 --- a/pkg/generated/clientset/typed/ark/v1/fake/fake_config.go +++ /dev/null @@ -1,104 +0,0 @@ -package fake - -import ( - v1 "github.com/heptio/ark/pkg/apis/ark/v1" - meta_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" -) - -// FakeConfigs implements ConfigInterface -type FakeConfigs struct { - Fake *FakeArkV1 - ns string -} - -var configsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "configs"} - -var configsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Config"} - -func (c *FakeConfigs) Create(config *v1.Config) (result *v1.Config, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(configsResource, c.ns, config), &v1.Config{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Config), err -} - -func (c *FakeConfigs) Update(config *v1.Config) (result *v1.Config, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(configsResource, c.ns, config), &v1.Config{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Config), err -} - -func (c *FakeConfigs) Delete(name string, options *meta_v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(configsResource, c.ns, name), &v1.Config{}) - - return err -} - -func (c *FakeConfigs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(configsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1.ConfigList{}) - return err -} - -func (c *FakeConfigs) Get(name string, options meta_v1.GetOptions) (result *v1.Config, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(configsResource, c.ns, name), &v1.Config{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Config), err -} - -func (c *FakeConfigs) List(opts meta_v1.ListOptions) (result *v1.ConfigList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(configsResource, configsKind, c.ns, opts), &v1.ConfigList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ConfigList{} - for _, item := range obj.(*v1.ConfigList).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 configs. -func (c *FakeConfigs) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(configsResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched config. -func (c *FakeConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Config, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(configsResource, c.ns, name, data, subresources...), &v1.Config{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Config), err -} diff --git a/pkg/generated/clientset/typed/ark/v1/fake/fake_downloadrequest.go b/pkg/generated/clientset/typed/ark/v1/fake/fake_downloadrequest.go deleted file mode 100644 index cbad32dca..000000000 --- a/pkg/generated/clientset/typed/ark/v1/fake/fake_downloadrequest.go +++ /dev/null @@ -1,114 +0,0 @@ -package fake - -import ( - v1 "github.com/heptio/ark/pkg/apis/ark/v1" - meta_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" -) - -// FakeDownloadRequests implements DownloadRequestInterface -type FakeDownloadRequests struct { - Fake *FakeArkV1 - ns string -} - -var downloadrequestsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "downloadrequests"} - -var downloadrequestsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "DownloadRequest"} - -func (c *FakeDownloadRequests) Create(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(downloadrequestsResource, c.ns, downloadRequest), &v1.DownloadRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.DownloadRequest), err -} - -func (c *FakeDownloadRequests) Update(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(downloadrequestsResource, c.ns, downloadRequest), &v1.DownloadRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.DownloadRequest), err -} - -func (c *FakeDownloadRequests) UpdateStatus(downloadRequest *v1.DownloadRequest) (*v1.DownloadRequest, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(downloadrequestsResource, "status", c.ns, downloadRequest), &v1.DownloadRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.DownloadRequest), err -} - -func (c *FakeDownloadRequests) Delete(name string, options *meta_v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(downloadrequestsResource, c.ns, name), &v1.DownloadRequest{}) - - return err -} - -func (c *FakeDownloadRequests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(downloadrequestsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1.DownloadRequestList{}) - return err -} - -func (c *FakeDownloadRequests) Get(name string, options meta_v1.GetOptions) (result *v1.DownloadRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(downloadrequestsResource, c.ns, name), &v1.DownloadRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.DownloadRequest), err -} - -func (c *FakeDownloadRequests) List(opts meta_v1.ListOptions) (result *v1.DownloadRequestList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(downloadrequestsResource, downloadrequestsKind, c.ns, opts), &v1.DownloadRequestList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.DownloadRequestList{} - for _, item := range obj.(*v1.DownloadRequestList).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 downloadRequests. -func (c *FakeDownloadRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(downloadrequestsResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched downloadRequest. -func (c *FakeDownloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DownloadRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, data, subresources...), &v1.DownloadRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.DownloadRequest), err -} diff --git a/pkg/generated/clientset/typed/ark/v1/fake/fake_restore.go b/pkg/generated/clientset/typed/ark/v1/fake/fake_restore.go deleted file mode 100644 index 0b09a0876..000000000 --- a/pkg/generated/clientset/typed/ark/v1/fake/fake_restore.go +++ /dev/null @@ -1,114 +0,0 @@ -package fake - -import ( - v1 "github.com/heptio/ark/pkg/apis/ark/v1" - meta_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" -) - -// FakeRestores implements RestoreInterface -type FakeRestores struct { - Fake *FakeArkV1 - ns string -} - -var restoresResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "restores"} - -var restoresKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Restore"} - -func (c *FakeRestores) Create(restore *v1.Restore) (result *v1.Restore, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(restoresResource, c.ns, restore), &v1.Restore{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Restore), err -} - -func (c *FakeRestores) Update(restore *v1.Restore) (result *v1.Restore, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(restoresResource, c.ns, restore), &v1.Restore{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Restore), err -} - -func (c *FakeRestores) UpdateStatus(restore *v1.Restore) (*v1.Restore, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(restoresResource, "status", c.ns, restore), &v1.Restore{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Restore), err -} - -func (c *FakeRestores) Delete(name string, options *meta_v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(restoresResource, c.ns, name), &v1.Restore{}) - - return err -} - -func (c *FakeRestores) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(restoresResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1.RestoreList{}) - return err -} - -func (c *FakeRestores) Get(name string, options meta_v1.GetOptions) (result *v1.Restore, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(restoresResource, c.ns, name), &v1.Restore{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Restore), err -} - -func (c *FakeRestores) List(opts meta_v1.ListOptions) (result *v1.RestoreList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(restoresResource, restoresKind, c.ns, opts), &v1.RestoreList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.RestoreList{} - for _, item := range obj.(*v1.RestoreList).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 restores. -func (c *FakeRestores) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(restoresResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched restore. -func (c *FakeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Restore, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, data, subresources...), &v1.Restore{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Restore), err -} diff --git a/pkg/generated/clientset/typed/ark/v1/fake/fake_schedule.go b/pkg/generated/clientset/typed/ark/v1/fake/fake_schedule.go deleted file mode 100644 index 55f7e5c38..000000000 --- a/pkg/generated/clientset/typed/ark/v1/fake/fake_schedule.go +++ /dev/null @@ -1,114 +0,0 @@ -package fake - -import ( - v1 "github.com/heptio/ark/pkg/apis/ark/v1" - meta_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" -) - -// FakeSchedules implements ScheduleInterface -type FakeSchedules struct { - Fake *FakeArkV1 - ns string -} - -var schedulesResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "schedules"} - -var schedulesKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Schedule"} - -func (c *FakeSchedules) Create(schedule *v1.Schedule) (result *v1.Schedule, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(schedulesResource, c.ns, schedule), &v1.Schedule{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Schedule), err -} - -func (c *FakeSchedules) Update(schedule *v1.Schedule) (result *v1.Schedule, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(schedulesResource, c.ns, schedule), &v1.Schedule{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Schedule), err -} - -func (c *FakeSchedules) UpdateStatus(schedule *v1.Schedule) (*v1.Schedule, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(schedulesResource, "status", c.ns, schedule), &v1.Schedule{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Schedule), err -} - -func (c *FakeSchedules) Delete(name string, options *meta_v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(schedulesResource, c.ns, name), &v1.Schedule{}) - - return err -} - -func (c *FakeSchedules) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(schedulesResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &v1.ScheduleList{}) - return err -} - -func (c *FakeSchedules) Get(name string, options meta_v1.GetOptions) (result *v1.Schedule, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(schedulesResource, c.ns, name), &v1.Schedule{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Schedule), err -} - -func (c *FakeSchedules) List(opts meta_v1.ListOptions) (result *v1.ScheduleList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(schedulesResource, schedulesKind, c.ns, opts), &v1.ScheduleList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ScheduleList{} - for _, item := range obj.(*v1.ScheduleList).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 schedules. -func (c *FakeSchedules) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(schedulesResource, c.ns, opts)) - -} - -// Patch applies the patch and returns the patched schedule. -func (c *FakeSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Schedule, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(schedulesResource, c.ns, name, data, subresources...), &v1.Schedule{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.Schedule), err -} diff --git a/pkg/generated/clientset/typed/ark/v1/generated_expansion.go b/pkg/generated/clientset/typed/ark/v1/generated_expansion.go deleted file mode 100644 index 7ba58630d..000000000 --- a/pkg/generated/clientset/typed/ark/v1/generated_expansion.go +++ /dev/null @@ -1,11 +0,0 @@ -package v1 - -type BackupExpansion interface{} - -type ConfigExpansion interface{} - -type DownloadRequestExpansion interface{} - -type RestoreExpansion interface{} - -type ScheduleExpansion interface{} diff --git a/pkg/generated/clientset/clientset.go b/pkg/generated/clientset/versioned/clientset.go similarity index 70% rename from pkg/generated/clientset/clientset.go rename to pkg/generated/clientset/versioned/clientset.go index be00f9ce1..30dc35cdf 100644 --- a/pkg/generated/clientset/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -1,8 +1,23 @@ -package clientset +/* +Copyright 2017 the Heptio Ark contributors. + +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 versioned import ( glog "github.com/golang/glog" - arkv1 "github.com/heptio/ark/pkg/generated/clientset/typed/ark/v1" + arkv1 "github.com/heptio/ark/pkg/generated/clientset/versioned/typed/ark/v1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -19,24 +34,18 @@ type Interface interface { // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - *arkv1.ArkV1Client + arkV1 *arkv1.ArkV1Client } // ArkV1 retrieves the ArkV1Client func (c *Clientset) ArkV1() arkv1.ArkV1Interface { - if c == nil { - return nil - } - return c.ArkV1Client + return c.arkV1 } // Deprecated: Ark retrieves the default version of ArkClient. // Please explicitly pick a version. func (c *Clientset) Ark() arkv1.ArkV1Interface { - if c == nil { - return nil - } - return c.ArkV1Client + return c.arkV1 } // Discovery retrieves the DiscoveryClient @@ -55,7 +64,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.ArkV1Client, err = arkv1.NewForConfig(&configShallowCopy) + cs.arkV1, err = arkv1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -72,7 +81,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.ArkV1Client = arkv1.NewForConfigOrDie(c) + cs.arkV1 = arkv1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -81,7 +90,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.ArkV1Client = arkv1.New(c) + cs.arkV1 = arkv1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/generated/clientset/versioned/doc.go b/pkg/generated/clientset/versioned/doc.go new file mode 100644 index 000000000..7cc6b7720 --- /dev/null +++ b/pkg/generated/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + +// This package is generated by client-gen with custom arguments. + +// This package has the automatically generated clientset. +package versioned diff --git a/pkg/generated/clientset/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go similarity index 61% rename from pkg/generated/clientset/fake/clientset_generated.go rename to pkg/generated/clientset/versioned/fake/clientset_generated.go index 7c61575e5..8dbca18df 100644 --- a/pkg/generated/clientset/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -1,9 +1,24 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 fake import ( - clientset "github.com/heptio/ark/pkg/generated/clientset" - arkv1 "github.com/heptio/ark/pkg/generated/clientset/typed/ark/v1" - fakearkv1 "github.com/heptio/ark/pkg/generated/clientset/typed/ark/v1/fake" + clientset "github.com/heptio/ark/pkg/generated/clientset/versioned" + arkv1 "github.com/heptio/ark/pkg/generated/clientset/versioned/typed/ark/v1" + fakearkv1 "github.com/heptio/ark/pkg/generated/clientset/versioned/typed/ark/v1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -25,10 +40,9 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { fakePtr := testing.Fake{} fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) - return &Clientset{fakePtr} + return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} } // Clientset implements clientset.Interface. Meant to be embedded into a @@ -36,10 +50,11 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { // you want to test easier. type Clientset struct { testing.Fake + discovery *fakediscovery.FakeDiscovery } func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return &fakediscovery.FakeDiscovery{Fake: &c.Fake} + return c.discovery } var _ clientset.Interface = &Clientset{} diff --git a/pkg/generated/clientset/versioned/fake/doc.go b/pkg/generated/clientset/versioned/fake/doc.go new file mode 100644 index 000000000..33eb08ee7 --- /dev/null +++ b/pkg/generated/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + +// This package is generated by client-gen with custom arguments. + +// This package has the automatically generated fake clientset. +package fake diff --git a/pkg/generated/clientset/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go similarity index 66% rename from pkg/generated/clientset/fake/register.go rename to pkg/generated/clientset/versioned/fake/register.go index bc7fc98c3..13ceb3279 100644 --- a/pkg/generated/clientset/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -1,3 +1,18 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 fake import ( diff --git a/pkg/generated/clientset/versioned/scheme/doc.go b/pkg/generated/clientset/versioned/scheme/doc.go new file mode 100644 index 000000000..d3561443f --- /dev/null +++ b/pkg/generated/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + +// This package is generated by client-gen with custom arguments. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/pkg/generated/clientset/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go similarity index 66% rename from pkg/generated/clientset/scheme/register.go rename to pkg/generated/clientset/versioned/scheme/register.go index 481ea8c96..cf2feada6 100644 --- a/pkg/generated/clientset/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -1,3 +1,18 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 scheme import ( diff --git a/pkg/generated/clientset/typed/ark/v1/ark_client.go b/pkg/generated/clientset/versioned/typed/ark/v1/ark_client.go similarity index 77% rename from pkg/generated/clientset/typed/ark/v1/ark_client.go rename to pkg/generated/clientset/versioned/typed/ark/v1/ark_client.go index b66b79e60..c42bedf32 100644 --- a/pkg/generated/clientset/typed/ark/v1/ark_client.go +++ b/pkg/generated/clientset/versioned/typed/ark/v1/ark_client.go @@ -1,8 +1,23 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 v1 import ( v1 "github.com/heptio/ark/pkg/apis/ark/v1" - "github.com/heptio/ark/pkg/generated/clientset/scheme" + "github.com/heptio/ark/pkg/generated/clientset/versioned/scheme" serializer "k8s.io/apimachinery/pkg/runtime/serializer" rest "k8s.io/client-go/rest" ) diff --git a/pkg/generated/clientset/typed/ark/v1/backup.go b/pkg/generated/clientset/versioned/typed/ark/v1/backup.go similarity index 85% rename from pkg/generated/clientset/typed/ark/v1/backup.go rename to pkg/generated/clientset/versioned/typed/ark/v1/backup.go index 8097c2a10..a6019c0a2 100644 --- a/pkg/generated/clientset/typed/ark/v1/backup.go +++ b/pkg/generated/clientset/versioned/typed/ark/v1/backup.go @@ -1,8 +1,23 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 v1 import ( v1 "github.com/heptio/ark/pkg/apis/ark/v1" - scheme "github.com/heptio/ark/pkg/generated/clientset/scheme" + scheme "github.com/heptio/ark/pkg/generated/clientset/versioned/scheme" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -43,6 +58,41 @@ func newBackups(c *ArkV1Client, namespace string) *backups { } } +// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any. +func (c *backups) Get(name string, options meta_v1.GetOptions) (result *v1.Backup, err error) { + result = &v1.Backup{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Backups that match those selectors. +func (c *backups) List(opts meta_v1.ListOptions) (result *v1.BackupList, err error) { + result = &v1.BackupList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backups"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backups. +func (c *backups) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("backups"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + // Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any. func (c *backups) Create(backup *v1.Backup) (result *v1.Backup, err error) { result = &v1.Backup{} @@ -69,7 +119,7 @@ func (c *backups) Update(backup *v1.Backup) (result *v1.Backup, err error) { } // UpdateStatus was generated because the type contains a Status member. -// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus(). +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *backups) UpdateStatus(backup *v1.Backup) (result *v1.Backup, err error) { result = &v1.Backup{} @@ -106,41 +156,6 @@ func (c *backups) DeleteCollection(options *meta_v1.DeleteOptions, listOptions m Error() } -// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any. -func (c *backups) Get(name string, options meta_v1.GetOptions) (result *v1.Backup, err error) { - result = &v1.Backup{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backups"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Backups that match those selectors. -func (c *backups) List(opts meta_v1.ListOptions) (result *v1.BackupList, err error) { - result = &v1.BackupList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("backups"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested backups. -func (c *backups) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("backups"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - // Patch applies the patch and returns the patched backup. func (c *backups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Backup, err error) { result = &v1.Backup{} diff --git a/pkg/generated/clientset/typed/ark/v1/config.go b/pkg/generated/clientset/versioned/typed/ark/v1/config.go similarity index 86% rename from pkg/generated/clientset/typed/ark/v1/config.go rename to pkg/generated/clientset/versioned/typed/ark/v1/config.go index 0dc43ff55..fdecee2de 100644 --- a/pkg/generated/clientset/typed/ark/v1/config.go +++ b/pkg/generated/clientset/versioned/typed/ark/v1/config.go @@ -1,8 +1,23 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 v1 import ( v1 "github.com/heptio/ark/pkg/apis/ark/v1" - scheme "github.com/heptio/ark/pkg/generated/clientset/scheme" + scheme "github.com/heptio/ark/pkg/generated/clientset/versioned/scheme" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -42,6 +57,41 @@ func newConfigs(c *ArkV1Client, namespace string) *configs { } } +// Get takes name of the config, and returns the corresponding config object, and an error if there is any. +func (c *configs) Get(name string, options meta_v1.GetOptions) (result *v1.Config, err error) { + result = &v1.Config{} + err = c.client.Get(). + Namespace(c.ns). + Resource("configs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Configs that match those selectors. +func (c *configs) List(opts meta_v1.ListOptions) (result *v1.ConfigList, err error) { + result = &v1.ConfigList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("configs"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested configs. +func (c *configs) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("configs"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + // Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any. func (c *configs) Create(config *v1.Config) (result *v1.Config, err error) { result = &v1.Config{} @@ -89,41 +139,6 @@ func (c *configs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions m Error() } -// Get takes name of the config, and returns the corresponding config object, and an error if there is any. -func (c *configs) Get(name string, options meta_v1.GetOptions) (result *v1.Config, err error) { - result = &v1.Config{} - err = c.client.Get(). - Namespace(c.ns). - Resource("configs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Configs that match those selectors. -func (c *configs) List(opts meta_v1.ListOptions) (result *v1.ConfigList, err error) { - result = &v1.ConfigList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested configs. -func (c *configs) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("configs"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - // Patch applies the patch and returns the patched config. func (c *configs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Config, err error) { result = &v1.Config{} diff --git a/pkg/generated/clientset/versioned/typed/ark/v1/doc.go b/pkg/generated/clientset/versioned/typed/ark/v1/doc.go new file mode 100644 index 000000000..1efdad2d6 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/ark/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + +// This package is generated by client-gen with custom arguments. + +// This package has the automatically generated typed clients. +package v1 diff --git a/pkg/generated/clientset/typed/ark/v1/downloadrequest.go b/pkg/generated/clientset/versioned/typed/ark/v1/downloadrequest.go similarity index 87% rename from pkg/generated/clientset/typed/ark/v1/downloadrequest.go rename to pkg/generated/clientset/versioned/typed/ark/v1/downloadrequest.go index 7b0c4fcf5..d228b30bc 100644 --- a/pkg/generated/clientset/typed/ark/v1/downloadrequest.go +++ b/pkg/generated/clientset/versioned/typed/ark/v1/downloadrequest.go @@ -1,8 +1,23 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 v1 import ( v1 "github.com/heptio/ark/pkg/apis/ark/v1" - scheme "github.com/heptio/ark/pkg/generated/clientset/scheme" + scheme "github.com/heptio/ark/pkg/generated/clientset/versioned/scheme" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -43,6 +58,41 @@ func newDownloadRequests(c *ArkV1Client, namespace string) *downloadRequests { } } +// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any. +func (c *downloadRequests) Get(name string, options meta_v1.GetOptions) (result *v1.DownloadRequest, err error) { + result = &v1.DownloadRequest{} + err = c.client.Get(). + Namespace(c.ns). + Resource("downloadrequests"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors. +func (c *downloadRequests) List(opts meta_v1.ListOptions) (result *v1.DownloadRequestList, err error) { + result = &v1.DownloadRequestList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("downloadrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested downloadRequests. +func (c *downloadRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("downloadrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + // Create takes the representation of a downloadRequest and creates it. Returns the server's representation of the downloadRequest, and an error, if there is any. func (c *downloadRequests) Create(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) { result = &v1.DownloadRequest{} @@ -69,7 +119,7 @@ func (c *downloadRequests) Update(downloadRequest *v1.DownloadRequest) (result * } // UpdateStatus was generated because the type contains a Status member. -// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus(). +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *downloadRequests) UpdateStatus(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) { result = &v1.DownloadRequest{} @@ -106,41 +156,6 @@ func (c *downloadRequests) DeleteCollection(options *meta_v1.DeleteOptions, list Error() } -// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any. -func (c *downloadRequests) Get(name string, options meta_v1.GetOptions) (result *v1.DownloadRequest, err error) { - result = &v1.DownloadRequest{} - err = c.client.Get(). - Namespace(c.ns). - Resource("downloadrequests"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors. -func (c *downloadRequests) List(opts meta_v1.ListOptions) (result *v1.DownloadRequestList, err error) { - result = &v1.DownloadRequestList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("downloadrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested downloadRequests. -func (c *downloadRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("downloadrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - // Patch applies the patch and returns the patched downloadRequest. func (c *downloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DownloadRequest, err error) { result = &v1.DownloadRequest{} diff --git a/pkg/generated/clientset/versioned/typed/ark/v1/fake/doc.go b/pkg/generated/clientset/versioned/typed/ark/v1/fake/doc.go new file mode 100644 index 000000000..ec0e8d66d --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/ark/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + +// This package is generated by client-gen with custom arguments. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/clientset/typed/ark/v1/fake/fake_ark_client.go b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_ark_client.go similarity index 58% rename from pkg/generated/clientset/typed/ark/v1/fake/fake_ark_client.go rename to pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_ark_client.go index 6868c42f4..2cdb40e7d 100644 --- a/pkg/generated/clientset/typed/ark/v1/fake/fake_ark_client.go +++ b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_ark_client.go @@ -1,7 +1,22 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 fake import ( - v1 "github.com/heptio/ark/pkg/generated/clientset/typed/ark/v1" + v1 "github.com/heptio/ark/pkg/generated/clientset/versioned/typed/ark/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) diff --git a/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_backup.go b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_backup.go new file mode 100644 index 000000000..73fb49e8f --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_backup.go @@ -0,0 +1,137 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 fake + +import ( + ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" + 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" +) + +// FakeBackups implements BackupInterface +type FakeBackups struct { + Fake *FakeArkV1 + ns string +} + +var backupsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "backups"} + +var backupsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Backup"} + +// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any. +func (c *FakeBackups) Get(name string, options v1.GetOptions) (result *ark_v1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backupsResource, c.ns, name), &ark_v1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Backup), err +} + +// List takes label and field selectors, and returns the list of Backups that match those selectors. +func (c *FakeBackups) List(opts v1.ListOptions) (result *ark_v1.BackupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backupsResource, backupsKind, c.ns, opts), &ark_v1.BackupList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &ark_v1.BackupList{} + for _, item := range obj.(*ark_v1.BackupList).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 backups. +func (c *FakeBackups) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backupsResource, c.ns, opts)) + +} + +// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *FakeBackups) Create(backup *ark_v1.Backup) (result *ark_v1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backupsResource, c.ns, backup), &ark_v1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Backup), err +} + +// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *FakeBackups) Update(backup *ark_v1.Backup) (result *ark_v1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backupsResource, c.ns, backup), &ark_v1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Backup), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBackups) UpdateStatus(backup *ark_v1.Backup) (*ark_v1.Backup, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(backupsResource, "status", c.ns, backup), &ark_v1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Backup), err +} + +// Delete takes name of the backup and deletes it. Returns an error if one occurs. +func (c *FakeBackups) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(backupsResource, c.ns, name), &ark_v1.Backup{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backupsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &ark_v1.BackupList{}) + return err +} + +// Patch applies the patch and returns the patched backup. +func (c *FakeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, data, subresources...), &ark_v1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Backup), err +} diff --git a/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_config.go b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_config.go new file mode 100644 index 000000000..7f67ff2af --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_config.go @@ -0,0 +1,125 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 fake + +import ( + ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" + 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" +) + +// FakeConfigs implements ConfigInterface +type FakeConfigs struct { + Fake *FakeArkV1 + ns string +} + +var configsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "configs"} + +var configsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Config"} + +// Get takes name of the config, and returns the corresponding config object, and an error if there is any. +func (c *FakeConfigs) Get(name string, options v1.GetOptions) (result *ark_v1.Config, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(configsResource, c.ns, name), &ark_v1.Config{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Config), err +} + +// List takes label and field selectors, and returns the list of Configs that match those selectors. +func (c *FakeConfigs) List(opts v1.ListOptions) (result *ark_v1.ConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(configsResource, configsKind, c.ns, opts), &ark_v1.ConfigList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &ark_v1.ConfigList{} + for _, item := range obj.(*ark_v1.ConfigList).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 configs. +func (c *FakeConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(configsResource, c.ns, opts)) + +} + +// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any. +func (c *FakeConfigs) Create(config *ark_v1.Config) (result *ark_v1.Config, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(configsResource, c.ns, config), &ark_v1.Config{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Config), err +} + +// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any. +func (c *FakeConfigs) Update(config *ark_v1.Config) (result *ark_v1.Config, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(configsResource, c.ns, config), &ark_v1.Config{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Config), err +} + +// Delete takes name of the config and deletes it. Returns an error if one occurs. +func (c *FakeConfigs) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(configsResource, c.ns, name), &ark_v1.Config{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(configsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &ark_v1.ConfigList{}) + return err +} + +// Patch applies the patch and returns the patched config. +func (c *FakeConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.Config, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(configsResource, c.ns, name, data, subresources...), &ark_v1.Config{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Config), err +} diff --git a/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_downloadrequest.go b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_downloadrequest.go new file mode 100644 index 000000000..d087af3f2 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_downloadrequest.go @@ -0,0 +1,137 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 fake + +import ( + ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" + 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" +) + +// FakeDownloadRequests implements DownloadRequestInterface +type FakeDownloadRequests struct { + Fake *FakeArkV1 + ns string +} + +var downloadrequestsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "downloadrequests"} + +var downloadrequestsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "DownloadRequest"} + +// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any. +func (c *FakeDownloadRequests) Get(name string, options v1.GetOptions) (result *ark_v1.DownloadRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(downloadrequestsResource, c.ns, name), &ark_v1.DownloadRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.DownloadRequest), err +} + +// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors. +func (c *FakeDownloadRequests) List(opts v1.ListOptions) (result *ark_v1.DownloadRequestList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(downloadrequestsResource, downloadrequestsKind, c.ns, opts), &ark_v1.DownloadRequestList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &ark_v1.DownloadRequestList{} + for _, item := range obj.(*ark_v1.DownloadRequestList).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 downloadRequests. +func (c *FakeDownloadRequests) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(downloadrequestsResource, c.ns, opts)) + +} + +// Create takes the representation of a downloadRequest and creates it. Returns the server's representation of the downloadRequest, and an error, if there is any. +func (c *FakeDownloadRequests) Create(downloadRequest *ark_v1.DownloadRequest) (result *ark_v1.DownloadRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(downloadrequestsResource, c.ns, downloadRequest), &ark_v1.DownloadRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.DownloadRequest), err +} + +// Update takes the representation of a downloadRequest and updates it. Returns the server's representation of the downloadRequest, and an error, if there is any. +func (c *FakeDownloadRequests) Update(downloadRequest *ark_v1.DownloadRequest) (result *ark_v1.DownloadRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(downloadrequestsResource, c.ns, downloadRequest), &ark_v1.DownloadRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.DownloadRequest), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeDownloadRequests) UpdateStatus(downloadRequest *ark_v1.DownloadRequest) (*ark_v1.DownloadRequest, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(downloadrequestsResource, "status", c.ns, downloadRequest), &ark_v1.DownloadRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.DownloadRequest), err +} + +// Delete takes name of the downloadRequest and deletes it. Returns an error if one occurs. +func (c *FakeDownloadRequests) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(downloadrequestsResource, c.ns, name), &ark_v1.DownloadRequest{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDownloadRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(downloadrequestsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &ark_v1.DownloadRequestList{}) + return err +} + +// Patch applies the patch and returns the patched downloadRequest. +func (c *FakeDownloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.DownloadRequest, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, data, subresources...), &ark_v1.DownloadRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.DownloadRequest), err +} diff --git a/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_restore.go b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_restore.go new file mode 100644 index 000000000..f5d2cfe35 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_restore.go @@ -0,0 +1,137 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 fake + +import ( + ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" + 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" +) + +// FakeRestores implements RestoreInterface +type FakeRestores struct { + Fake *FakeArkV1 + ns string +} + +var restoresResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "restores"} + +var restoresKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Restore"} + +// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any. +func (c *FakeRestores) Get(name string, options v1.GetOptions) (result *ark_v1.Restore, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(restoresResource, c.ns, name), &ark_v1.Restore{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Restore), err +} + +// List takes label and field selectors, and returns the list of Restores that match those selectors. +func (c *FakeRestores) List(opts v1.ListOptions) (result *ark_v1.RestoreList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(restoresResource, restoresKind, c.ns, opts), &ark_v1.RestoreList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &ark_v1.RestoreList{} + for _, item := range obj.(*ark_v1.RestoreList).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 restores. +func (c *FakeRestores) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(restoresResource, c.ns, opts)) + +} + +// Create takes the representation of a restore and creates it. Returns the server's representation of the restore, and an error, if there is any. +func (c *FakeRestores) Create(restore *ark_v1.Restore) (result *ark_v1.Restore, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(restoresResource, c.ns, restore), &ark_v1.Restore{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Restore), err +} + +// Update takes the representation of a restore and updates it. Returns the server's representation of the restore, and an error, if there is any. +func (c *FakeRestores) Update(restore *ark_v1.Restore) (result *ark_v1.Restore, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(restoresResource, c.ns, restore), &ark_v1.Restore{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Restore), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeRestores) UpdateStatus(restore *ark_v1.Restore) (*ark_v1.Restore, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(restoresResource, "status", c.ns, restore), &ark_v1.Restore{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Restore), err +} + +// Delete takes name of the restore and deletes it. Returns an error if one occurs. +func (c *FakeRestores) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(restoresResource, c.ns, name), &ark_v1.Restore{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(restoresResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &ark_v1.RestoreList{}) + return err +} + +// Patch applies the patch and returns the patched restore. +func (c *FakeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.Restore, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, data, subresources...), &ark_v1.Restore{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Restore), err +} diff --git a/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_schedule.go b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_schedule.go new file mode 100644 index 000000000..ea8f93848 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/ark/v1/fake/fake_schedule.go @@ -0,0 +1,137 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 fake + +import ( + ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" + 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" +) + +// FakeSchedules implements ScheduleInterface +type FakeSchedules struct { + Fake *FakeArkV1 + ns string +} + +var schedulesResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "schedules"} + +var schedulesKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Schedule"} + +// Get takes name of the schedule, and returns the corresponding schedule object, and an error if there is any. +func (c *FakeSchedules) Get(name string, options v1.GetOptions) (result *ark_v1.Schedule, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(schedulesResource, c.ns, name), &ark_v1.Schedule{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Schedule), err +} + +// List takes label and field selectors, and returns the list of Schedules that match those selectors. +func (c *FakeSchedules) List(opts v1.ListOptions) (result *ark_v1.ScheduleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(schedulesResource, schedulesKind, c.ns, opts), &ark_v1.ScheduleList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &ark_v1.ScheduleList{} + for _, item := range obj.(*ark_v1.ScheduleList).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 schedules. +func (c *FakeSchedules) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(schedulesResource, c.ns, opts)) + +} + +// Create takes the representation of a schedule and creates it. Returns the server's representation of the schedule, and an error, if there is any. +func (c *FakeSchedules) Create(schedule *ark_v1.Schedule) (result *ark_v1.Schedule, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(schedulesResource, c.ns, schedule), &ark_v1.Schedule{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Schedule), err +} + +// Update takes the representation of a schedule and updates it. Returns the server's representation of the schedule, and an error, if there is any. +func (c *FakeSchedules) Update(schedule *ark_v1.Schedule) (result *ark_v1.Schedule, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(schedulesResource, c.ns, schedule), &ark_v1.Schedule{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Schedule), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeSchedules) UpdateStatus(schedule *ark_v1.Schedule) (*ark_v1.Schedule, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(schedulesResource, "status", c.ns, schedule), &ark_v1.Schedule{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Schedule), err +} + +// Delete takes name of the schedule and deletes it. Returns an error if one occurs. +func (c *FakeSchedules) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(schedulesResource, c.ns, name), &ark_v1.Schedule{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSchedules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(schedulesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &ark_v1.ScheduleList{}) + return err +} + +// Patch applies the patch and returns the patched schedule. +func (c *FakeSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.Schedule, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(schedulesResource, c.ns, name, data, subresources...), &ark_v1.Schedule{}) + + if obj == nil { + return nil, err + } + return obj.(*ark_v1.Schedule), err +} diff --git a/pkg/generated/clientset/versioned/typed/ark/v1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/ark/v1/generated_expansion.go new file mode 100644 index 000000000..a0ac4091a --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/ark/v1/generated_expansion.go @@ -0,0 +1,26 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 v1 + +type BackupExpansion interface{} + +type ConfigExpansion interface{} + +type DownloadRequestExpansion interface{} + +type RestoreExpansion interface{} + +type ScheduleExpansion interface{} diff --git a/pkg/generated/clientset/typed/ark/v1/restore.go b/pkg/generated/clientset/versioned/typed/ark/v1/restore.go similarity index 86% rename from pkg/generated/clientset/typed/ark/v1/restore.go rename to pkg/generated/clientset/versioned/typed/ark/v1/restore.go index a211ccec5..b7fe763c1 100644 --- a/pkg/generated/clientset/typed/ark/v1/restore.go +++ b/pkg/generated/clientset/versioned/typed/ark/v1/restore.go @@ -1,8 +1,23 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 v1 import ( v1 "github.com/heptio/ark/pkg/apis/ark/v1" - scheme "github.com/heptio/ark/pkg/generated/clientset/scheme" + scheme "github.com/heptio/ark/pkg/generated/clientset/versioned/scheme" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -43,6 +58,41 @@ func newRestores(c *ArkV1Client, namespace string) *restores { } } +// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any. +func (c *restores) Get(name string, options meta_v1.GetOptions) (result *v1.Restore, err error) { + result = &v1.Restore{} + err = c.client.Get(). + Namespace(c.ns). + Resource("restores"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Restores that match those selectors. +func (c *restores) List(opts meta_v1.ListOptions) (result *v1.RestoreList, err error) { + result = &v1.RestoreList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("restores"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested restores. +func (c *restores) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("restores"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + // Create takes the representation of a restore and creates it. Returns the server's representation of the restore, and an error, if there is any. func (c *restores) Create(restore *v1.Restore) (result *v1.Restore, err error) { result = &v1.Restore{} @@ -69,7 +119,7 @@ func (c *restores) Update(restore *v1.Restore) (result *v1.Restore, err error) { } // UpdateStatus was generated because the type contains a Status member. -// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus(). +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *restores) UpdateStatus(restore *v1.Restore) (result *v1.Restore, err error) { result = &v1.Restore{} @@ -106,41 +156,6 @@ func (c *restores) DeleteCollection(options *meta_v1.DeleteOptions, listOptions Error() } -// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any. -func (c *restores) Get(name string, options meta_v1.GetOptions) (result *v1.Restore, err error) { - result = &v1.Restore{} - err = c.client.Get(). - Namespace(c.ns). - Resource("restores"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Restores that match those selectors. -func (c *restores) List(opts meta_v1.ListOptions) (result *v1.RestoreList, err error) { - result = &v1.RestoreList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("restores"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested restores. -func (c *restores) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("restores"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - // Patch applies the patch and returns the patched restore. func (c *restores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Restore, err error) { result = &v1.Restore{} diff --git a/pkg/generated/clientset/typed/ark/v1/schedule.go b/pkg/generated/clientset/versioned/typed/ark/v1/schedule.go similarity index 86% rename from pkg/generated/clientset/typed/ark/v1/schedule.go rename to pkg/generated/clientset/versioned/typed/ark/v1/schedule.go index 72699316f..f7563f7a5 100644 --- a/pkg/generated/clientset/typed/ark/v1/schedule.go +++ b/pkg/generated/clientset/versioned/typed/ark/v1/schedule.go @@ -1,8 +1,23 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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 v1 import ( v1 "github.com/heptio/ark/pkg/apis/ark/v1" - scheme "github.com/heptio/ark/pkg/generated/clientset/scheme" + scheme "github.com/heptio/ark/pkg/generated/clientset/versioned/scheme" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -43,6 +58,41 @@ func newSchedules(c *ArkV1Client, namespace string) *schedules { } } +// Get takes name of the schedule, and returns the corresponding schedule object, and an error if there is any. +func (c *schedules) Get(name string, options meta_v1.GetOptions) (result *v1.Schedule, err error) { + result = &v1.Schedule{} + err = c.client.Get(). + Namespace(c.ns). + Resource("schedules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Schedules that match those selectors. +func (c *schedules) List(opts meta_v1.ListOptions) (result *v1.ScheduleList, err error) { + result = &v1.ScheduleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("schedules"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested schedules. +func (c *schedules) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("schedules"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + // Create takes the representation of a schedule and creates it. Returns the server's representation of the schedule, and an error, if there is any. func (c *schedules) Create(schedule *v1.Schedule) (result *v1.Schedule, err error) { result = &v1.Schedule{} @@ -69,7 +119,7 @@ func (c *schedules) Update(schedule *v1.Schedule) (result *v1.Schedule, err erro } // UpdateStatus was generated because the type contains a Status member. -// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus(). +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). func (c *schedules) UpdateStatus(schedule *v1.Schedule) (result *v1.Schedule, err error) { result = &v1.Schedule{} @@ -106,41 +156,6 @@ func (c *schedules) DeleteCollection(options *meta_v1.DeleteOptions, listOptions Error() } -// Get takes name of the schedule, and returns the corresponding schedule object, and an error if there is any. -func (c *schedules) Get(name string, options meta_v1.GetOptions) (result *v1.Schedule, err error) { - result = &v1.Schedule{} - err = c.client.Get(). - Namespace(c.ns). - Resource("schedules"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Schedules that match those selectors. -func (c *schedules) List(opts meta_v1.ListOptions) (result *v1.ScheduleList, err error) { - result = &v1.ScheduleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("schedules"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested schedules. -func (c *schedules) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("schedules"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - // Patch applies the patch and returns the patched schedule. func (c *schedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Schedule, err error) { result = &v1.Schedule{} diff --git a/pkg/generated/informers/externalversions/ark/interface.go b/pkg/generated/informers/externalversions/ark/interface.go index 914212aeb..1b01e7674 100644 --- a/pkg/generated/informers/externalversions/ark/interface.go +++ b/pkg/generated/informers/externalversions/ark/interface.go @@ -1,3 +1,19 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package ark diff --git a/pkg/generated/informers/externalversions/ark/v1/backup.go b/pkg/generated/informers/externalversions/ark/v1/backup.go index 5852f2ce6..8f35ba2d6 100644 --- a/pkg/generated/informers/externalversions/ark/v1/backup.go +++ b/pkg/generated/informers/externalversions/ark/v1/backup.go @@ -1,10 +1,26 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package v1 import ( ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" - clientset "github.com/heptio/ark/pkg/generated/clientset" + versioned "github.com/heptio/ark/pkg/generated/clientset/versioned" internalinterfaces "github.com/heptio/ark/pkg/generated/informers/externalversions/internalinterfaces" v1 "github.com/heptio/ark/pkg/generated/listers/ark/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,26 +41,31 @@ type backupInformer struct { factory internalinterfaces.SharedInformerFactory } -func newBackupInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - sharedIndexInformer := cache.NewSharedIndexInformer( +// NewBackupInformer constructs a new informer for Backup 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 NewBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { - return client.ArkV1().Backups(meta_v1.NamespaceAll).List(options) + return client.ArkV1().Backups(namespace).List(options) }, WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { - return client.ArkV1().Backups(meta_v1.NamespaceAll).Watch(options) + return client.ArkV1().Backups(namespace).Watch(options) }, }, &ark_v1.Backup{}, resyncPeriod, - cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, + indexers, ) +} - return sharedIndexInformer +func defaultBackupInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewBackupInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}) } func (f *backupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ark_v1.Backup{}, newBackupInformer) + return f.factory.InformerFor(&ark_v1.Backup{}, defaultBackupInformer) } func (f *backupInformer) Lister() v1.BackupLister { diff --git a/pkg/generated/informers/externalversions/ark/v1/config.go b/pkg/generated/informers/externalversions/ark/v1/config.go index c6eb3a0bc..1863e3a35 100644 --- a/pkg/generated/informers/externalversions/ark/v1/config.go +++ b/pkg/generated/informers/externalversions/ark/v1/config.go @@ -1,10 +1,26 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package v1 import ( ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" - clientset "github.com/heptio/ark/pkg/generated/clientset" + versioned "github.com/heptio/ark/pkg/generated/clientset/versioned" internalinterfaces "github.com/heptio/ark/pkg/generated/informers/externalversions/internalinterfaces" v1 "github.com/heptio/ark/pkg/generated/listers/ark/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,26 +41,31 @@ type configInformer struct { factory internalinterfaces.SharedInformerFactory } -func newConfigInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - sharedIndexInformer := cache.NewSharedIndexInformer( +// NewConfigInformer constructs a new informer for Config 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 NewConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { - return client.ArkV1().Configs(meta_v1.NamespaceAll).List(options) + return client.ArkV1().Configs(namespace).List(options) }, WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { - return client.ArkV1().Configs(meta_v1.NamespaceAll).Watch(options) + return client.ArkV1().Configs(namespace).Watch(options) }, }, &ark_v1.Config{}, resyncPeriod, - cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, + indexers, ) +} - return sharedIndexInformer +func defaultConfigInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewConfigInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}) } func (f *configInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ark_v1.Config{}, newConfigInformer) + return f.factory.InformerFor(&ark_v1.Config{}, defaultConfigInformer) } func (f *configInformer) Lister() v1.ConfigLister { diff --git a/pkg/generated/informers/externalversions/ark/v1/downloadrequest.go b/pkg/generated/informers/externalversions/ark/v1/downloadrequest.go index c57a717b4..397f4104e 100644 --- a/pkg/generated/informers/externalversions/ark/v1/downloadrequest.go +++ b/pkg/generated/informers/externalversions/ark/v1/downloadrequest.go @@ -1,10 +1,26 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package v1 import ( ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" - clientset "github.com/heptio/ark/pkg/generated/clientset" + versioned "github.com/heptio/ark/pkg/generated/clientset/versioned" internalinterfaces "github.com/heptio/ark/pkg/generated/informers/externalversions/internalinterfaces" v1 "github.com/heptio/ark/pkg/generated/listers/ark/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,26 +41,31 @@ type downloadRequestInformer struct { factory internalinterfaces.SharedInformerFactory } -func newDownloadRequestInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - sharedIndexInformer := cache.NewSharedIndexInformer( +// NewDownloadRequestInformer constructs a new informer for DownloadRequest 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 NewDownloadRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { - return client.ArkV1().DownloadRequests(meta_v1.NamespaceAll).List(options) + return client.ArkV1().DownloadRequests(namespace).List(options) }, WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { - return client.ArkV1().DownloadRequests(meta_v1.NamespaceAll).Watch(options) + return client.ArkV1().DownloadRequests(namespace).Watch(options) }, }, &ark_v1.DownloadRequest{}, resyncPeriod, - cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, + indexers, ) +} - return sharedIndexInformer +func defaultDownloadRequestInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewDownloadRequestInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}) } func (f *downloadRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ark_v1.DownloadRequest{}, newDownloadRequestInformer) + return f.factory.InformerFor(&ark_v1.DownloadRequest{}, defaultDownloadRequestInformer) } func (f *downloadRequestInformer) Lister() v1.DownloadRequestLister { diff --git a/pkg/generated/informers/externalversions/ark/v1/interface.go b/pkg/generated/informers/externalversions/ark/v1/interface.go index f9eff9e76..b381854e8 100644 --- a/pkg/generated/informers/externalversions/ark/v1/interface.go +++ b/pkg/generated/informers/externalversions/ark/v1/interface.go @@ -1,3 +1,19 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package v1 diff --git a/pkg/generated/informers/externalversions/ark/v1/restore.go b/pkg/generated/informers/externalversions/ark/v1/restore.go index b2d437067..61669010b 100644 --- a/pkg/generated/informers/externalversions/ark/v1/restore.go +++ b/pkg/generated/informers/externalversions/ark/v1/restore.go @@ -1,10 +1,26 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package v1 import ( ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" - clientset "github.com/heptio/ark/pkg/generated/clientset" + versioned "github.com/heptio/ark/pkg/generated/clientset/versioned" internalinterfaces "github.com/heptio/ark/pkg/generated/informers/externalversions/internalinterfaces" v1 "github.com/heptio/ark/pkg/generated/listers/ark/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,26 +41,31 @@ type restoreInformer struct { factory internalinterfaces.SharedInformerFactory } -func newRestoreInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - sharedIndexInformer := cache.NewSharedIndexInformer( +// NewRestoreInformer constructs a new informer for Restore 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 NewRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { - return client.ArkV1().Restores(meta_v1.NamespaceAll).List(options) + return client.ArkV1().Restores(namespace).List(options) }, WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { - return client.ArkV1().Restores(meta_v1.NamespaceAll).Watch(options) + return client.ArkV1().Restores(namespace).Watch(options) }, }, &ark_v1.Restore{}, resyncPeriod, - cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, + indexers, ) +} - return sharedIndexInformer +func defaultRestoreInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewRestoreInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}) } func (f *restoreInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ark_v1.Restore{}, newRestoreInformer) + return f.factory.InformerFor(&ark_v1.Restore{}, defaultRestoreInformer) } func (f *restoreInformer) Lister() v1.RestoreLister { diff --git a/pkg/generated/informers/externalversions/ark/v1/schedule.go b/pkg/generated/informers/externalversions/ark/v1/schedule.go index c88c08f2f..be9fba1a5 100644 --- a/pkg/generated/informers/externalversions/ark/v1/schedule.go +++ b/pkg/generated/informers/externalversions/ark/v1/schedule.go @@ -1,10 +1,26 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package v1 import ( ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1" - clientset "github.com/heptio/ark/pkg/generated/clientset" + versioned "github.com/heptio/ark/pkg/generated/clientset/versioned" internalinterfaces "github.com/heptio/ark/pkg/generated/informers/externalversions/internalinterfaces" v1 "github.com/heptio/ark/pkg/generated/listers/ark/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,26 +41,31 @@ type scheduleInformer struct { factory internalinterfaces.SharedInformerFactory } -func newScheduleInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - sharedIndexInformer := cache.NewSharedIndexInformer( +// NewScheduleInformer constructs a new informer for Schedule 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 NewScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { - return client.ArkV1().Schedules(meta_v1.NamespaceAll).List(options) + return client.ArkV1().Schedules(namespace).List(options) }, WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { - return client.ArkV1().Schedules(meta_v1.NamespaceAll).Watch(options) + return client.ArkV1().Schedules(namespace).Watch(options) }, }, &ark_v1.Schedule{}, resyncPeriod, - cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, + indexers, ) +} - return sharedIndexInformer +func defaultScheduleInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewScheduleInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}) } func (f *scheduleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ark_v1.Schedule{}, newScheduleInformer) + return f.factory.InformerFor(&ark_v1.Schedule{}, defaultScheduleInformer) } func (f *scheduleInformer) Lister() v1.ScheduleLister { diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index 2f905ff15..a7f1c1838 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -1,9 +1,25 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package externalversions import ( - clientset "github.com/heptio/ark/pkg/generated/clientset" + versioned "github.com/heptio/ark/pkg/generated/clientset/versioned" ark "github.com/heptio/ark/pkg/generated/informers/externalversions/ark" internalinterfaces "github.com/heptio/ark/pkg/generated/informers/externalversions/internalinterfaces" runtime "k8s.io/apimachinery/pkg/runtime" @@ -15,7 +31,7 @@ import ( ) type sharedInformerFactory struct { - client clientset.Interface + client versioned.Interface lock sync.Mutex defaultResync time.Duration @@ -26,7 +42,7 @@ type sharedInformerFactory struct { } // NewSharedInformerFactory constructs a new instance of sharedInformerFactory -func NewSharedInformerFactory(client clientset.Interface, defaultResync time.Duration) SharedInformerFactory { +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { return &sharedInformerFactory{ client: client, defaultResync: defaultResync, diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index bd932781e..a670b1069 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -1,3 +1,19 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package externalversions diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go index b5b7f7b94..d9edf6db7 100644 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,15 +1,31 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by informer-gen package internalinterfaces import ( - clientset "github.com/heptio/ark/pkg/generated/clientset" + versioned "github.com/heptio/ark/pkg/generated/clientset/versioned" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" time "time" ) -type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer // SharedInformerFactory a small interface to allow for adding an informer without an import cycle type SharedInformerFactory interface { diff --git a/pkg/generated/informers/internalversion/factory.go b/pkg/generated/informers/internalversion/factory.go deleted file mode 100644 index 7aff13c07..000000000 --- a/pkg/generated/informers/internalversion/factory.go +++ /dev/null @@ -1,95 +0,0 @@ -// This file was automatically generated by informer-gen - -package internalversion - -import ( - clientset "github.com/heptio/ark/pkg/generated/clientset" - internalinterfaces "github.com/heptio/ark/pkg/generated/informers/internalversion/internalinterfaces" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" - reflect "reflect" - sync "sync" - time "time" -) - -type sharedInformerFactory struct { - client clientset.Interface - lock sync.Mutex - defaultResync time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory -func NewSharedInformerFactory(client clientset.Interface, defaultResync time.Duration) SharedInformerFactory { - return &sharedInformerFactory{ - client: client, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - } -} - -// Start initializes all requested informers. -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - go informer.Run(stopCh) - f.startedInformers[informerType] = true - } - } -} - -// WaitForCacheSync waits for all started informers' cache were synced. -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InternalInformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - informer = newFunc(f.client, f.defaultResync) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool -} diff --git a/pkg/generated/informers/internalversion/generic.go b/pkg/generated/informers/internalversion/generic.go deleted file mode 100644 index 764fd788c..000000000 --- a/pkg/generated/informers/internalversion/generic.go +++ /dev/null @@ -1,40 +0,0 @@ -// This file was automatically generated by informer-gen - -package internalversion - -import ( - "fmt" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/pkg/generated/informers/internalversion/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/internalversion/internalinterfaces/factory_interfaces.go deleted file mode 100644 index b5b7f7b94..000000000 --- a/pkg/generated/informers/internalversion/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,18 +0,0 @@ -// This file was automatically generated by informer-gen - -package internalinterfaces - -import ( - clientset "github.com/heptio/ark/pkg/generated/clientset" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" - time "time" -) - -type NewInformerFunc func(clientset.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} diff --git a/pkg/generated/listers/ark/v1/backup.go b/pkg/generated/listers/ark/v1/backup.go index e51f70123..30c836662 100644 --- a/pkg/generated/listers/ark/v1/backup.go +++ b/pkg/generated/listers/ark/v1/backup.go @@ -1,3 +1,19 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by lister-gen package v1 diff --git a/pkg/generated/listers/ark/v1/config.go b/pkg/generated/listers/ark/v1/config.go index bc851fddf..8e3b2e230 100644 --- a/pkg/generated/listers/ark/v1/config.go +++ b/pkg/generated/listers/ark/v1/config.go @@ -1,3 +1,19 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by lister-gen package v1 diff --git a/pkg/generated/listers/ark/v1/downloadrequest.go b/pkg/generated/listers/ark/v1/downloadrequest.go index 60aeb29ff..2d402a0b9 100644 --- a/pkg/generated/listers/ark/v1/downloadrequest.go +++ b/pkg/generated/listers/ark/v1/downloadrequest.go @@ -1,3 +1,19 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by lister-gen package v1 diff --git a/pkg/generated/listers/ark/v1/expansion_generated.go b/pkg/generated/listers/ark/v1/expansion_generated.go index 5f03a85fe..92f5e2b5a 100644 --- a/pkg/generated/listers/ark/v1/expansion_generated.go +++ b/pkg/generated/listers/ark/v1/expansion_generated.go @@ -1,3 +1,19 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by lister-gen package v1 diff --git a/pkg/generated/listers/ark/v1/restore.go b/pkg/generated/listers/ark/v1/restore.go index 5f461dee0..1926d3a1c 100644 --- a/pkg/generated/listers/ark/v1/restore.go +++ b/pkg/generated/listers/ark/v1/restore.go @@ -1,3 +1,19 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by lister-gen package v1 diff --git a/pkg/generated/listers/ark/v1/schedule.go b/pkg/generated/listers/ark/v1/schedule.go index 9f9fc31bd..c9a7550b7 100644 --- a/pkg/generated/listers/ark/v1/schedule.go +++ b/pkg/generated/listers/ark/v1/schedule.go @@ -1,3 +1,19 @@ +/* +Copyright 2017 the Heptio Ark contributors. + +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. +*/ + // This file was automatically generated by lister-gen package v1