git

package
v1.5.10-test Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2026 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Git Repository Adapter

This component implements integration of git into package orchestration. A local clone of a registered git repository is created in a cache, and periodically refreshed. All package operations happen on the local copy; on completion of an operation (create, update, delete package revision or its resources) any new changes (in one or more commits) are pushed to the remote repository.

Branching Strategy

Porch doesn't create tracking branches for remotes. This indirection would add a layer of complexity where branches can become out of sync and in need of reconciliation and conflict resolution. Instead, Porch analyzes the remote references (refs/remotes/origin/branch...) to discover packages. These refs are never directly updated by Porch other than by push or fetch to/from remote. Any intermediate commits Porch makes are either in 'detached HEAD' mode, or using temporary branches (these will become relevant if/when Porch implements repository garbage collection).

Porch uses the default convention for naming remote branches (refs/remotes/origin/branch...) in order to make direct introspection of the repositories aligned with traditional git repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendRetryableErrors

func AppendRetryableErrors(patterns []string)

AppendRetryableErrors adds additional error patterns to the retryable errors list. Patterns can be specified multiple times or as comma-separated values.

Types

type GitRepoFactory

type GitRepoFactory struct {
}

func (*GitRepoFactory) CheckRepositoryConnection

func (f *GitRepoFactory) CheckRepositoryConnection(ctx context.Context, repositorySpec *configapi.Repository, options externalrepotypes.ExternalRepoOptions) error

func (*GitRepoFactory) NewRepositoryImpl

func (f *GitRepoFactory) NewRepositoryImpl(ctx context.Context, repositorySpec *configapi.Repository, options externalrepotypes.ExternalRepoOptions) (repository.Repository, error)

type GitRepository

type GitRepository interface {
	repository.Repository
	GetPackageRevision(ctx context.Context, ref, path string) (repository.PackageRevision, kptfilev1.GitLock, error)
	UpdateDeletionProposedCache(ctx context.Context) error
}

func OpenRepository

func OpenRepository(ctx context.Context, name, namespace string, spec *configapi.GitRepository, deployment bool, root string, opts GitRepositoryOptions) (GitRepository, error)

type GitRepositoryOptions

type GitRepositoryOptions struct {
	externalrepotypes.ExternalRepoOptions
	MainBranchStrategy MainBranchStrategy
}

type MainBranchStrategy

type MainBranchStrategy int
const (
	ErrorIfMissing   MainBranchStrategy = iota // ErrorIsMissing
	CreateIfMissing                            // CreateIfMissing
	SkipVerification                           // SkipVerification
)

func (MainBranchStrategy) String

func (i MainBranchStrategy) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL