From bf809d7c84393f4c134676900c6208a162ec4e50 Mon Sep 17 00:00:00 2001 From: ZhuBo <41532403+Jeremy-boo@users.noreply.github.com> Date: Wed, 17 Aug 2022 17:23:15 +0800 Subject: [PATCH] fix: add deep copy method for approve_check, envimentspec (#245) Co-authored-by: Jeremy-boo --- apis/data/v1alpha1/zz_generated.deepcopy.go | 2 +- apis/meta/v1alpha1/zz_generated.deepcopy.go | 259 ++++++++++++++++++-- 2 files changed, 244 insertions(+), 17 deletions(-) diff --git a/apis/data/v1alpha1/zz_generated.deepcopy.go b/apis/data/v1alpha1/zz_generated.deepcopy.go index c4210c1d..ff66c0eb 100644 --- a/apis/data/v1alpha1/zz_generated.deepcopy.go +++ b/apis/data/v1alpha1/zz_generated.deepcopy.go @@ -22,7 +22,7 @@ limitations under the License. package v1alpha1 import ( - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" ) diff --git a/apis/meta/v1alpha1/zz_generated.deepcopy.go b/apis/meta/v1alpha1/zz_generated.deepcopy.go index 43da2f7d..6dfb743c 100644 --- a/apis/meta/v1alpha1/zz_generated.deepcopy.go +++ b/apis/meta/v1alpha1/zz_generated.deepcopy.go @@ -23,12 +23,132 @@ package v1alpha1 import ( corev1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/runtime" "knative.dev/pkg/apis" - v1 "knative.dev/pkg/apis/duck/v1" + duckv1 "knative.dev/pkg/apis/duck/v1" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Approval) DeepCopyInto(out *Approval) { + *out = *in + if in.Users != nil { + in, out := &in.Users, &out.Users + *out = make(UserApprovals, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Approval. +func (in *Approval) DeepCopy() *Approval { + if in == nil { + return nil + } + out := new(Approval) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApprovalCheckStatus) DeepCopyInto(out *ApprovalCheckStatus) { + *out = *in + if in.ApprovalStartTime != nil { + in, out := &in.ApprovalStartTime, &out.ApprovalStartTime + *out = (*in).DeepCopy() + } + if in.Approvals != nil { + in, out := &in.Approvals, &out.Approvals + *out = make(ApprovalStatuses, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApprovalCheckStatus. +func (in *ApprovalCheckStatus) DeepCopy() *ApprovalCheckStatus { + if in == nil { + return nil + } + out := new(ApprovalCheckStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApprovalSpec) DeepCopyInto(out *ApprovalSpec) { + *out = *in + if in.Users != nil { + in, out := &in.Users, &out.Users + *out = make([]v1.Subject, len(*in)) + copy(*out, *in) + } + out.Timeout = in.Timeout +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApprovalSpec. +func (in *ApprovalSpec) DeepCopy() *ApprovalSpec { + if in == nil { + return nil + } + out := new(ApprovalSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApprovalStatus) DeepCopyInto(out *ApprovalStatus) { + *out = *in + out.Subject = in.Subject + if in.UserApprovalInput != nil { + in, out := &in.UserApprovalInput, &out.UserApprovalInput + *out = new(UserApprovalInput) + **out = **in + } + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(v1.Subject) + **out = **in + } + if in.ApprovalTime != nil { + in, out := &in.ApprovalTime, &out.ApprovalTime + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApprovalStatus. +func (in *ApprovalStatus) DeepCopy() *ApprovalStatus { + if in == nil { + return nil + } + out := new(ApprovalStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ApprovalStatuses) DeepCopyInto(out *ApprovalStatuses) { + { + in := &in + *out = make(ApprovalStatuses, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApprovalStatuses. +func (in ApprovalStatuses) DeepCopy() ApprovalStatuses { + if in == nil { + return nil + } + out := new(ApprovalStatuses) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Artifact) DeepCopyInto(out *Artifact) { *out = *in @@ -92,12 +212,12 @@ func (in *ArtifactSpec) DeepCopyInto(out *ArtifactSpec) { *out = *in if in.Address != nil { in, out := &in.Address, &out.Address - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } if in.Access != nil { in, out := &in.Access, &out.Access - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } in.UpdatedTime.DeepCopyInto(&out.UpdatedTime) @@ -342,7 +462,7 @@ func (in *BranchSpec) DeepCopyInto(out *BranchSpec) { out.Author = in.Author if in.Address != nil { in, out := &in.Address, &out.Address - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } in.CodeInfo.DeepCopyInto(&out.CodeInfo) @@ -480,6 +600,26 @@ func (in *BuildRunGitStatus) DeepCopy() *BuildRunGitStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Check) DeepCopyInto(out *Check) { + *out = *in + if in.Approval != nil { + in, out := &in.Approval, &out.Approval + *out = new(Approval) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Check. +func (in *Check) DeepCopy() *Check { + if in == nil { + return nil + } + out := new(Check) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CloudEvent) DeepCopyInto(out *CloudEvent) { *out = *in @@ -508,7 +648,7 @@ func (in *CodeInfo) DeepCopyInto(out *CodeInfo) { *out = *in if in.Address != nil { in, out := &in.Address, &out.Address - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } } @@ -1167,7 +1307,7 @@ func (in *CreatedBy) DeepCopyInto(out *CreatedBy) { *out = *in if in.User != nil { in, out := &in.User, &out.User - *out = new(rbacv1.Subject) + *out = new(v1.Subject) **out = **in } } @@ -1212,6 +1352,31 @@ func (in *DownloadURL) DeepCopy() *DownloadURL { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvironmentSpec) DeepCopyInto(out *EnvironmentSpec) { + *out = *in + if in.ClusterRef != nil { + in, out := &in.ClusterRef, &out.ClusterRef + *out = new(corev1.ObjectReference) + **out = **in + } + if in.NamespaceRef != nil { + in, out := &in.NamespaceRef, &out.NamespaceRef + *out = new(corev1.LocalObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvironmentSpec. +func (in *EnvironmentSpec) DeepCopy() *EnvironmentSpec { + if in == nil { + return nil + } + out := new(EnvironmentSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GitBranch) DeepCopyInto(out *GitBranch) { *out = *in @@ -1446,7 +1611,7 @@ func (in *GitCommitInfo) DeepCopyInto(out *GitCommitInfo) { in.CreatedAt.DeepCopyInto(&out.CreatedAt) if in.Address != nil { in, out := &in.Address, &out.Address - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } } @@ -2222,7 +2387,7 @@ func (in *GitRepositoryTagSpec) DeepCopyInto(out *GitRepositoryTagSpec) { in.GitRepositoryTagInfo.DeepCopyInto(&out.GitRepositoryTagInfo) if in.Address != nil { in, out := &in.Address, &out.Address - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } if in.Message != nil { @@ -2390,7 +2555,7 @@ func (in *IssueSpec) DeepCopyInto(out *IssueSpec) { out.Project = in.Project if in.Address != nil { in, out := &in.Address, &out.Address - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } out.Priority = in.Priority @@ -2608,12 +2773,12 @@ func (in *ProjectSpec) DeepCopyInto(out *ProjectSpec) { *out = *in if in.Address != nil { in, out := &in.Address, &out.Address - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } if in.Access != nil { in, out := &in.Access, &out.Access - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } if in.NamespaceRefs != nil { @@ -2643,7 +2808,7 @@ func (in *RelateIssue) DeepCopyInto(out *RelateIssue) { *out = *in if in.Access != nil { in, out := &in.Access, &out.Access - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } } @@ -2720,12 +2885,12 @@ func (in *RepositorySpec) DeepCopyInto(out *RepositorySpec) { *out = *in if in.Address != nil { in, out := &in.Address, &out.Address - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } if in.Access != nil { in, out := &in.Access, &out.Access - *out = new(v1.Addressable) + *out = new(duckv1.Addressable) (*in).DeepCopyInto(*out) } if in.NamespaceRefs != nil { @@ -2821,7 +2986,7 @@ func (in *TriggeredBy) DeepCopyInto(out *TriggeredBy) { *out = *in if in.User != nil { in, out := &in.User, &out.User - *out = new(rbacv1.Subject) + *out = new(v1.Subject) **out = **in } if in.CloudEvent != nil { @@ -2885,6 +3050,68 @@ func (in *User) DeepCopy() *User { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserApproval) DeepCopyInto(out *UserApproval) { + *out = *in + out.Subject = in.Subject + if in.Operator != nil { + in, out := &in.Operator, &out.Operator + *out = new(v1.Subject) + **out = **in + } + if in.Input != nil { + in, out := &in.Input, &out.Input + *out = new(UserApprovalInput) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserApproval. +func (in *UserApproval) DeepCopy() *UserApproval { + if in == nil { + return nil + } + out := new(UserApproval) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserApprovalInput) DeepCopyInto(out *UserApprovalInput) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserApprovalInput. +func (in *UserApprovalInput) DeepCopy() *UserApprovalInput { + if in == nil { + return nil + } + out := new(UserApprovalInput) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in UserApprovals) DeepCopyInto(out *UserApprovals) { + { + in := &in + *out = make(UserApprovals, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserApprovals. +func (in UserApprovals) DeepCopy() UserApprovals { + if in == nil { + return nil + } + out := new(UserApprovals) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UserInfo) DeepCopyInto(out *UserInfo) { *out = *in