mirror of
https://github.com/imjasonh/git-k8s
synced 2026-07-17 06:23:00 +00:00
Implement Git-as-K8s control plane with Knative controllers
Build a complete Kubernetes control plane for Git operations using Knative's pkg framework, go-git for in-memory Git operations, and ko for builds. Architecture: - 4 CRDs: GitRepository, GitBranch, GitPushTransaction, GitRepoSync - Push controller: atomic Git push via go-git with CAS (compare-and-swap) - Sync controller: two-way sync with in-memory merge base calculation - Resolver controller: automated 3-way merge for conflicted syncs - In-cluster Gitea server for backing storage - Full RBAC, ko-based deployments, and code-gen scaffolding Note: go.sum needs generation via `go mod tidy` in an environment with full internet access (knative.dev/pkg v0.0.0-20250520014526-44579e9ce5ed). https://claude.ai/code/session_01QfFzqKQUsxxBsiZUhuJ3pG
This commit is contained in:
commit
8e65104201
27 changed files with 3198 additions and 0 deletions
34
pkg/apis/git/v1alpha1/defaults.go
Normal file
34
pkg/apis/git/v1alpha1/defaults.go
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package v1alpha1
|
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
// SetDefaults_GitRepository sets default values for GitRepository.
|
||||
func SetDefaults_GitRepository(r *GitRepository) {
|
||||
if r.Spec.DefaultBranch == "" {
|
||||
r.Spec.DefaultBranch = "main"
|
||||
}
|
||||
}
|
||||
|
||||
// SetDefaults_GitPushTransaction sets default values for GitPushTransaction.
|
||||
func SetDefaults_GitPushTransaction(t *GitPushTransaction) {
|
||||
if t.Status.Phase == "" {
|
||||
t.Status.Phase = TransactionPhasePending
|
||||
}
|
||||
}
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
return RegisterDefaults(scheme)
|
||||
}
|
||||
|
||||
// RegisterDefaults adds default functions to the given scheme.
|
||||
// This is a placeholder that will be populated by code generation.
|
||||
// For now we register defaults manually.
|
||||
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||
scheme.AddTypeDefaultingFunc(&GitRepository{}, func(obj interface{}) {
|
||||
SetDefaults_GitRepository(obj.(*GitRepository))
|
||||
})
|
||||
scheme.AddTypeDefaultingFunc(&GitPushTransaction{}, func(obj interface{}) {
|
||||
SetDefaults_GitPushTransaction(obj.(*GitPushTransaction))
|
||||
})
|
||||
return nil
|
||||
}
|
||||
5
pkg/apis/git/v1alpha1/doc.go
Normal file
5
pkg/apis/git/v1alpha1/doc.go
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// Package v1alpha1 contains API Schema definitions for the git v1alpha1 API group.
|
||||
//
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +groupName=git.k8s.io
|
||||
package v1alpha1
|
||||
50
pkg/apis/git/v1alpha1/groupversion_info.go
Normal file
50
pkg/apis/git/v1alpha1/groupversion_info.go
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
const (
|
||||
// GroupName is the name of the API group.
|
||||
GroupName = "git.k8s.io"
|
||||
|
||||
// Version is the version of the API group.
|
||||
Version = "v1alpha1"
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is the group version used to register these objects.
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
|
||||
|
||||
// Kind takes an unqualified kind and returns a Group-qualified GroupKind.
|
||||
func Kind(kind string) schema.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group-qualified GroupResource.
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
// SchemeBuilder adds types to the scheme.
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
// AddToScheme applies the SchemeBuilder functions to a scheme.
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&GitRepository{},
|
||||
&GitRepositoryList{},
|
||||
&GitBranch{},
|
||||
&GitBranchList{},
|
||||
&GitPushTransaction{},
|
||||
&GitPushTransactionList{},
|
||||
&GitRepoSync{},
|
||||
&GitRepoSyncList{},
|
||||
)
|
||||
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
}
|
||||
268
pkg/apis/git/v1alpha1/types.go
Normal file
268
pkg/apis/git/v1alpha1/types.go
Normal file
|
|
@ -0,0 +1,268 @@
|
|||
package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"knative.dev/pkg/apis/duck/v1"
|
||||
)
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// GitRepository represents a Git repository managed by the control plane.
|
||||
type GitRepository struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec GitRepositorySpec `json:"spec"`
|
||||
Status GitRepositoryStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// GitRepositorySpec defines the desired state of a GitRepository.
|
||||
type GitRepositorySpec struct {
|
||||
// URL is the clone URL of the Git repository.
|
||||
URL string `json:"url"`
|
||||
|
||||
// DefaultBranch is the default branch name (e.g., "main").
|
||||
// +optional
|
||||
DefaultBranch string `json:"defaultBranch,omitempty"`
|
||||
|
||||
// Auth contains authentication configuration for the repository.
|
||||
// +optional
|
||||
Auth *GitAuth `json:"auth,omitempty"`
|
||||
}
|
||||
|
||||
// GitAuth contains authentication details for accessing a Git repository.
|
||||
type GitAuth struct {
|
||||
// SecretRef references a Secret containing credentials.
|
||||
// The Secret should have keys "username" and "password" or "ssh-privatekey".
|
||||
// +optional
|
||||
SecretRef *SecretRef `json:"secretRef,omitempty"`
|
||||
}
|
||||
|
||||
// SecretRef is a reference to a Kubernetes Secret.
|
||||
type SecretRef struct {
|
||||
// Name is the name of the Secret.
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// GitRepositoryStatus defines the observed state of a GitRepository.
|
||||
type GitRepositoryStatus struct {
|
||||
v1.Status `json:",inline"`
|
||||
|
||||
// LastFetchTime is the timestamp of the last successful fetch.
|
||||
// +optional
|
||||
LastFetchTime *metav1.Time `json:"lastFetchTime,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// GitRepositoryList is a list of GitRepository resources.
|
||||
type GitRepositoryList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []GitRepository `json:"items"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// GitBranch represents a branch within a GitRepository.
|
||||
type GitBranch struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec GitBranchSpec `json:"spec"`
|
||||
Status GitBranchStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// GitBranchSpec defines the desired state of a GitBranch.
|
||||
type GitBranchSpec struct {
|
||||
// RepositoryRef references the parent GitRepository.
|
||||
RepositoryRef string `json:"repositoryRef"`
|
||||
|
||||
// BranchName is the name of the branch (e.g., "main", "feature/foo").
|
||||
BranchName string `json:"branchName"`
|
||||
}
|
||||
|
||||
// GitBranchStatus defines the observed state of a GitBranch.
|
||||
type GitBranchStatus struct {
|
||||
v1.Status `json:",inline"`
|
||||
|
||||
// HeadCommit is the SHA of the current HEAD commit on this branch.
|
||||
// +optional
|
||||
HeadCommit string `json:"headCommit,omitempty"`
|
||||
|
||||
// LastUpdated is the timestamp when the branch was last updated.
|
||||
// +optional
|
||||
LastUpdated *metav1.Time `json:"lastUpdated,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// GitBranchList is a list of GitBranch resources.
|
||||
type GitBranchList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []GitBranch `json:"items"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// GitPushTransaction represents an atomic push operation to a Git repository.
|
||||
type GitPushTransaction struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec GitPushTransactionSpec `json:"spec"`
|
||||
Status GitPushTransactionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// GitPushTransactionSpec defines the desired state of a GitPushTransaction.
|
||||
type GitPushTransactionSpec struct {
|
||||
// RepositoryRef references the target GitRepository.
|
||||
RepositoryRef string `json:"repositoryRef"`
|
||||
|
||||
// RefSpecs defines the Git refspecs for this push.
|
||||
RefSpecs []PushRefSpec `json:"refSpecs"`
|
||||
|
||||
// Atomic indicates whether the push should be atomic.
|
||||
// +optional
|
||||
Atomic bool `json:"atomic,omitempty"`
|
||||
}
|
||||
|
||||
// PushRefSpec defines a single refspec for a push operation.
|
||||
type PushRefSpec struct {
|
||||
// Source is the local ref (commit SHA or branch name).
|
||||
Source string `json:"source"`
|
||||
|
||||
// Destination is the remote ref to update.
|
||||
Destination string `json:"destination"`
|
||||
|
||||
// ExpectedOldCommit is the expected current commit SHA of the destination.
|
||||
// Used for compare-and-swap (CAS) to prevent races.
|
||||
// +optional
|
||||
ExpectedOldCommit string `json:"expectedOldCommit,omitempty"`
|
||||
}
|
||||
|
||||
// TransactionPhase represents the current phase of a push transaction.
|
||||
type TransactionPhase string
|
||||
|
||||
const (
|
||||
TransactionPhasePending TransactionPhase = "Pending"
|
||||
TransactionPhaseInProgress TransactionPhase = "InProgress"
|
||||
TransactionPhaseSucceeded TransactionPhase = "Succeeded"
|
||||
TransactionPhaseFailed TransactionPhase = "Failed"
|
||||
)
|
||||
|
||||
// GitPushTransactionStatus defines the observed state of a GitPushTransaction.
|
||||
type GitPushTransactionStatus struct {
|
||||
v1.Status `json:",inline"`
|
||||
|
||||
// Phase indicates the current phase of the transaction.
|
||||
// +optional
|
||||
Phase TransactionPhase `json:"phase,omitempty"`
|
||||
|
||||
// ResultCommit is the SHA of the resulting commit after a successful push.
|
||||
// +optional
|
||||
ResultCommit string `json:"resultCommit,omitempty"`
|
||||
|
||||
// StartTime is when the push operation started.
|
||||
// +optional
|
||||
StartTime *metav1.Time `json:"startTime,omitempty"`
|
||||
|
||||
// CompletionTime is when the push operation completed.
|
||||
// +optional
|
||||
CompletionTime *metav1.Time `json:"completionTime,omitempty"`
|
||||
|
||||
// Message provides additional details about the current state.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// GitPushTransactionList is a list of GitPushTransaction resources.
|
||||
type GitPushTransactionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []GitPushTransaction `json:"items"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// GitRepoSync defines a two-way sync relationship between two GitRepositories.
|
||||
type GitRepoSync struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec GitRepoSyncSpec `json:"spec"`
|
||||
Status GitRepoSyncStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// GitRepoSyncSpec defines the desired state of a GitRepoSync.
|
||||
type GitRepoSyncSpec struct {
|
||||
// RepoA references the first GitRepository.
|
||||
RepoA SyncRepoRef `json:"repoA"`
|
||||
|
||||
// RepoB references the second GitRepository.
|
||||
RepoB SyncRepoRef `json:"repoB"`
|
||||
|
||||
// BranchName is the branch to keep in sync between the two repos.
|
||||
BranchName string `json:"branchName"`
|
||||
}
|
||||
|
||||
// SyncRepoRef references a GitRepository and optional branch override.
|
||||
type SyncRepoRef struct {
|
||||
// Name is the name of the GitRepository resource.
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// SyncPhase represents the current phase of a repo sync.
|
||||
type SyncPhase string
|
||||
|
||||
const (
|
||||
SyncPhaseInSync SyncPhase = "InSync"
|
||||
SyncPhaseSyncing SyncPhase = "Syncing"
|
||||
SyncPhaseConflicted SyncPhase = "Conflicted"
|
||||
SyncPhaseRequiresManualIntervention SyncPhase = "RequiresManualIntervention"
|
||||
)
|
||||
|
||||
// GitRepoSyncStatus defines the observed state of a GitRepoSync.
|
||||
type GitRepoSyncStatus struct {
|
||||
v1.Status `json:",inline"`
|
||||
|
||||
// Phase indicates the current phase of the sync.
|
||||
// +optional
|
||||
Phase SyncPhase `json:"phase,omitempty"`
|
||||
|
||||
// LastSyncTime is the timestamp of the last successful sync.
|
||||
// +optional
|
||||
LastSyncTime *metav1.Time `json:"lastSyncTime,omitempty"`
|
||||
|
||||
// RepoACommit is the last known commit SHA of repo A.
|
||||
// +optional
|
||||
RepoACommit string `json:"repoACommit,omitempty"`
|
||||
|
||||
// RepoBCommit is the last known commit SHA of repo B.
|
||||
// +optional
|
||||
RepoBCommit string `json:"repoBCommit,omitempty"`
|
||||
|
||||
// MergeBase is the common ancestor commit SHA.
|
||||
// +optional
|
||||
MergeBase string `json:"mergeBase,omitempty"`
|
||||
|
||||
// Message provides additional details about the current state.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// GitRepoSyncList is a list of GitRepoSync resources.
|
||||
type GitRepoSyncList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []GitRepoSync `json:"items"`
|
||||
}
|
||||
467
pkg/apis/git/v1alpha1/zz_generated.deepcopy.go
Normal file
467
pkg/apis/git/v1alpha1/zz_generated.deepcopy.go
Normal file
|
|
@ -0,0 +1,467 @@
|
|||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
// Code generated by deepcopy-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitAuth) DeepCopyInto(out *GitAuth) {
|
||||
*out = *in
|
||||
if in.SecretRef != nil {
|
||||
in, out := &in.SecretRef, &out.SecretRef
|
||||
*out = new(SecretRef)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitAuth.
|
||||
func (in *GitAuth) DeepCopy() *GitAuth {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitAuth)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SecretRef) DeepCopyInto(out *SecretRef) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRef.
|
||||
func (in *SecretRef) DeepCopy() *SecretRef {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SecretRef)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitRepository) DeepCopyInto(out *GitRepository) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepository.
|
||||
func (in *GitRepository) DeepCopy() *GitRepository {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitRepository)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GitRepository) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitRepositorySpec) DeepCopyInto(out *GitRepositorySpec) {
|
||||
*out = *in
|
||||
if in.Auth != nil {
|
||||
in, out := &in.Auth, &out.Auth
|
||||
*out = new(GitAuth)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepositorySpec.
|
||||
func (in *GitRepositorySpec) DeepCopy() *GitRepositorySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitRepositorySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitRepositoryStatus) DeepCopyInto(out *GitRepositoryStatus) {
|
||||
*out = *in
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
if in.LastFetchTime != nil {
|
||||
in, out := &in.LastFetchTime, &out.LastFetchTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepositoryStatus.
|
||||
func (in *GitRepositoryStatus) DeepCopy() *GitRepositoryStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitRepositoryStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitRepositoryList) DeepCopyInto(out *GitRepositoryList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]GitRepository, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepositoryList.
|
||||
func (in *GitRepositoryList) DeepCopy() *GitRepositoryList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitRepositoryList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GitRepositoryList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 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
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitBranch.
|
||||
func (in *GitBranch) DeepCopy() *GitBranch {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitBranch)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GitBranch) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitBranchSpec) DeepCopyInto(out *GitBranchSpec) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitBranchSpec.
|
||||
func (in *GitBranchSpec) DeepCopy() *GitBranchSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitBranchSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitBranchStatus) DeepCopyInto(out *GitBranchStatus) {
|
||||
*out = *in
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
if in.LastUpdated != nil {
|
||||
in, out := &in.LastUpdated, &out.LastUpdated
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitBranchStatus.
|
||||
func (in *GitBranchStatus) DeepCopy() *GitBranchStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitBranchStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitBranchList) DeepCopyInto(out *GitBranchList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]GitBranch, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitBranchList.
|
||||
func (in *GitBranchList) DeepCopy() *GitBranchList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitBranchList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GitBranchList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitPushTransaction) DeepCopyInto(out *GitPushTransaction) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitPushTransaction.
|
||||
func (in *GitPushTransaction) DeepCopy() *GitPushTransaction {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitPushTransaction)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GitPushTransaction) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitPushTransactionSpec) DeepCopyInto(out *GitPushTransactionSpec) {
|
||||
*out = *in
|
||||
if in.RefSpecs != nil {
|
||||
in, out := &in.RefSpecs, &out.RefSpecs
|
||||
*out = make([]PushRefSpec, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitPushTransactionSpec.
|
||||
func (in *GitPushTransactionSpec) DeepCopy() *GitPushTransactionSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitPushTransactionSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitPushTransactionStatus) DeepCopyInto(out *GitPushTransactionStatus) {
|
||||
*out = *in
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
if in.StartTime != nil {
|
||||
in, out := &in.StartTime, &out.StartTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
if in.CompletionTime != nil {
|
||||
in, out := &in.CompletionTime, &out.CompletionTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitPushTransactionStatus.
|
||||
func (in *GitPushTransactionStatus) DeepCopy() *GitPushTransactionStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitPushTransactionStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitPushTransactionList) DeepCopyInto(out *GitPushTransactionList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]GitPushTransaction, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitPushTransactionList.
|
||||
func (in *GitPushTransactionList) DeepCopy() *GitPushTransactionList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitPushTransactionList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GitPushTransactionList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PushRefSpec) DeepCopyInto(out *PushRefSpec) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PushRefSpec.
|
||||
func (in *PushRefSpec) DeepCopy() *PushRefSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PushRefSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitRepoSync) DeepCopyInto(out *GitRepoSync) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepoSync.
|
||||
func (in *GitRepoSync) DeepCopy() *GitRepoSync {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitRepoSync)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GitRepoSync) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitRepoSyncSpec) DeepCopyInto(out *GitRepoSyncSpec) {
|
||||
*out = *in
|
||||
out.RepoA = in.RepoA
|
||||
out.RepoB = in.RepoB
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepoSyncSpec.
|
||||
func (in *GitRepoSyncSpec) DeepCopy() *GitRepoSyncSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitRepoSyncSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitRepoSyncStatus) DeepCopyInto(out *GitRepoSyncStatus) {
|
||||
*out = *in
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
if in.LastSyncTime != nil {
|
||||
in, out := &in.LastSyncTime, &out.LastSyncTime
|
||||
*out = (*in).DeepCopy()
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepoSyncStatus.
|
||||
func (in *GitRepoSyncStatus) DeepCopy() *GitRepoSyncStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitRepoSyncStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *GitRepoSyncList) DeepCopyInto(out *GitRepoSyncList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]GitRepoSync, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepoSyncList.
|
||||
func (in *GitRepoSyncList) DeepCopy() *GitRepoSyncList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(GitRepoSyncList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *GitRepoSyncList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SyncRepoRef) DeepCopyInto(out *SyncRepoRef) {
|
||||
*out = *in
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyncRepoRef.
|
||||
func (in *SyncRepoRef) DeepCopy() *SyncRepoRef {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SyncRepoRef)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue