internal

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProjectSparseCheckout = "sparseCheckout"
	ProjectSubDir         = "subDir"
)

Variables

View Source
var (
	ProjectsRoot string
	CloneTmpDir  string
)

Functions

func CheckProjectState

func CheckProjectState(project *dw.Project) (needClone, needRemotes bool, err error)

CheckProjectState Checks that a project's configuration is reflected in an on-disk git repository. - Returns needClone == true if the project has not yet been cloned - Returns needRemotes == true if the remotes configured in the project are not available in the on-disk repo

Remotes in provided project are checked against what is configured in the git repo, but only in one direction. The git repo can have additional remotes -- they will be ignored here. If both the project and git repo have remote A configured, but the corresponding remote URL is different, needRemotes will be true.

func DirExists added in v0.7.0

func DirExists(dir string) (bool, error)

DirExists returns true if the path at dir exists and is a directory. Returns an error if the path exists in the filesystem but does not refer to a directory.

func GetAdditionalCerts added in v0.23.0

func GetAdditionalCerts() (certs *x509.CertPool, warnings []string, err error)

func GetAuthForHost added in v0.18.0

func GetAuthForHost(repoURLStr string) (gittransport.AuthMethod, error)

func OpenRepo

func OpenRepo(repoPath string) (*git.Repository, error)

OpenRepo returns the git repo on disk described by the devworkspace Project. If the repo does not currently exist, returns nil. Returns an error if an unexpected error occurs opening the git repo.

func ReadFlattenedDevWorkspace added in v0.7.0

func ReadFlattenedDevWorkspace() (*dw.DevWorkspaceTemplateSpec, error)

ReadFlattenedDevWorkspace reads the flattened DevWorkspaceTemplateSpec from disk. The location of the flattened yaml is determined from the DevWorkspace Operator-provisioned environment variable.

func StarterProjectToRegularProject added in v0.22.0

func StarterProjectToRegularProject(starterProject *dw.StarterProject) dw.Project

StarterProjectToRegularProject converts a starter project defined in a DevWorkspace to a standard Project for easier handling

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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