internal

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 GetAuthForHost added in v0.18.0

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

func GetClonePath

func GetClonePath(project *dw.Project) string

GetClonePath gets the correct clonePath for a project, given the semantics in devfile/api

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.

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