Documentation ¶
Overview ¶
Package source maintains local copies of (remote) repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sources ¶
type Sources struct { // RootPath is the root of "workspace" and "repo" directories. // Workspaces have paths like "<RootPath>/workspace/namespace/name/_infra_" "work/namespace/name/clustername" // Repo directory are in "<RootPath>/repo/" RootPath string Log logr.Logger // contains filtered or unexported fields }
Sources keeps a list of workspaces and associated the source repositories. Sources are added with Register().
func (*Sources) FetchAll ¶
FetchAll fetches all remote repo's or filesystems into a local repo directory. The fetch rate is limited to at most once per N minutes.
func (*Sources) Get ¶
Get copies the source content to a workspace and returns true if the workspace has changed.
func (*Sources) Register ¶
func (ss *Sources) Register(nsn types.NamespacedName, name string, spec v1.SourceSpec) error
Register nsn + name as requiring a workspace with spec content.
type Workspace ¶
type Workspace struct { // Path of the work directory. Path string // Spec of the required repo. Spec v1.SourceSpec // Hash of the content (limited to area). Hash string // Synced is true if the repo content is copied to the workspace. // Synced is false as long as a repo hasn't been fetched or Get() isn't called or Get() has been called but new repo // content is fetched. Synced bool }
Workspace is a copy of a repo dedicated to a consumer.
Click to show internal directories.
Click to hide internal directories.