Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Commit

Permalink
Generate and add deepcopy functions for snapshot, now required by CRD…
Browse files Browse the repository at this point in the history
… API
  • Loading branch information
wongma7 committed Oct 28, 2017
1 parent b7e5520 commit 615eb28
Show file tree
Hide file tree
Showing 4 changed files with 626 additions and 2 deletions.
62 changes: 62 additions & 0 deletions snapshot/pkg/apis/crd/v1/deepcopy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
Copyright 2017 The Kubernetes Authors.
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 (
core_v1 "k8s.io/api/core/v1"
)

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeSnapshotCondition) DeepCopyInto(out *VolumeSnapshotCondition) {
*out = *in
out.Status = in.Status
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
return
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeSnapshotDataCondition) DeepCopyInto(out *VolumeSnapshotDataCondition) {
*out = *in
out.Status = in.Status
in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime)
return
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeSnapshotDataSpec) DeepCopyInto(out *VolumeSnapshotDataSpec) {
*out = *in
in.VolumeSnapshotDataSource.DeepCopyInto(&out.VolumeSnapshotDataSource)
if in.VolumeSnapshotRef != nil {
in, out := &in.VolumeSnapshotRef, &out.VolumeSnapshotRef
if *in == nil {
*out = nil
} else {
*out = new(core_v1.ObjectReference)
(*in).DeepCopyInto(*out)
}
}
if in.PersistentVolumeRef != nil {
in, out := &in.PersistentVolumeRef, &out.PersistentVolumeRef
if *in == nil {
*out = nil
} else {
*out = new(core_v1.ObjectReference)
(*in).DeepCopyInto(*out)
}
}
return
}
19 changes: 19 additions & 0 deletions snapshot/pkg/apis/crd/v1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright 2017 The Kubernetes Authors.
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.
*/

// +k8s:deepcopy-gen=package

package v1
10 changes: 8 additions & 2 deletions snapshot/pkg/apis/crd/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type VolumeSnapshotCondition struct {
}

// +genclient=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// VolumeSnapshot is the volume snapshot object accessible to the user. Upon succesful creation of the actual
// snapshot by the volume provider it is bound to the corresponding VolumeSnapshotData through
Expand All @@ -93,6 +94,8 @@ type VolumeSnapshot struct {
Status VolumeSnapshotStatus `json:"status" protobuf:"bytes,3,opt,name=status"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// VolumeSnapshotList is a list of VolumeSnapshot objects
type VolumeSnapshotList struct {
metav1.TypeMeta `json:",inline"`
Expand Down Expand Up @@ -121,6 +124,8 @@ type VolumeSnapshotDataStatus struct {
Conditions []VolumeSnapshotDataCondition `json:"conditions" protobuf:"bytes,2,rep,name=conditions"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// VolumeSnapshotDataList is a list of VolumeSnapshotData objects
type VolumeSnapshotDataList struct {
metav1.TypeMeta `json:",inline"`
Expand Down Expand Up @@ -160,6 +165,7 @@ type VolumeSnapshotDataCondition struct {

// +genclient=true
// +nonNamespaced=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// VolumeSnapshotData represents the actual "on-disk" snapshot object
type VolumeSnapshotData struct {
Expand Down Expand Up @@ -288,7 +294,7 @@ func (vd *VolumeSnapshotDataList) GetObjectKind() schema.ObjectKind {
}

// GetListMeta is required to satisfy ListMetaAccessor interface
func (vd *VolumeSnapshotDataList) GetListMeta() metav1.List {
func (vd *VolumeSnapshotDataList) GetListMeta() metav1.ListInterface {
return &vd.Metadata
}

Expand All @@ -308,7 +314,7 @@ func (vd *VolumeSnapshotList) GetObjectKind() schema.ObjectKind {
}

// GetListMeta is required to satisfy ListMetaAccessor interface
func (vd *VolumeSnapshotList) GetListMeta() metav1.List {
func (vd *VolumeSnapshotList) GetListMeta() metav1.ListInterface {
return &vd.Metadata
}

Expand Down
Loading

0 comments on commit 615eb28

Please sign in to comment.