Documentation ¶
Index ¶
- Constants
- Variables
- func CheckProjectState(project *dw.Project) (needClone, needRemotes bool, err error)
- func DirExists(dir string) (bool, error)
- func GetAdditionalCerts() (certs *x509.CertPool, warnings []string, err error)
- func GetAuthForHost(repoURLStr string) (gittransport.AuthMethod, error)
- func OpenRepo(repoPath string) (*git.Repository, error)
- func ReadFlattenedDevWorkspace() (*dw.DevWorkspaceTemplateSpec, error)
- func StarterProjectToRegularProject(starterProject *dw.StarterProject) dw.Project
Constants ¶
const ( ProjectSparseCheckout = "sparseCheckout" ProjectSubDir = "subDir" )
Variables ¶
var ( ProjectsRoot string CloneTmpDir string )
Functions ¶
func CheckProjectState ¶
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
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 GetAuthForHost ¶ added in v0.18.0
func GetAuthForHost(repoURLStr string) (gittransport.AuthMethod, error)
func OpenRepo ¶
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.