Documentation ¶
Index ¶
- func StartPeanutSync(clientConfig *rest.Config, config PeanutConfig, peanutRepo GitRepository, ...) error
- type GitConfig
- type GitRepository
- type PeanutConfig
- type PeanutRepository
- func (p *PeanutRepository) Clone(repoPath string) error
- func (p *PeanutRepository) GCMark(key kube.ResourceKey) (string, error)
- func (p *PeanutRepository) HeadHash() (plumbing.Hash, error)
- func (p *PeanutRepository) IsManaged(r *cache.Resource) bool
- func (p *PeanutRepository) Open(openPath string) error
- func (p *PeanutRepository) ParseManifests() ([]*unstructured.Unstructured, error)
- func (p *PeanutRepository) Sync() (plumbing.Hash, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartPeanutSync ¶
func StartPeanutSync(clientConfig *rest.Config, config PeanutConfig, peanutRepo GitRepository, met metrics.Interface, syncs *recent.RecentSynchronisations, resync chan bool, done <-chan struct{}) error
StartPeanutSync starts watching the configured Git repository, and synchronising the resources.
Types ¶
type GitRepository ¶
type GitRepository interface { Clone(string) error Open(string) error HeadHash() (plumbing.Hash, error) Sync() (plumbing.Hash, error) ParseManifests() ([]*unstructured.Unstructured, error) IsManaged(r *cache.Resource) bool }
GitRepository represents the operations that the engine needs to perform.
type PeanutConfig ¶
PeanutConfig configures the engine synchronisation.
type PeanutRepository ¶
type PeanutRepository struct {
// contains filtered or unexported fields
}
PeanutRepository wraps git.Repository with some high-level functionality.
func NewRepository ¶
func NewRepository(cfg GitConfig, p parser.ManifestParser) *PeanutRepository
NewRepository creates and returns a new PeanutRepository.
func (*PeanutRepository) Clone ¶
func (p *PeanutRepository) Clone(repoPath string) error
Clone clones the configured repository to the provided path.
func (*PeanutRepository) GCMark ¶
func (p *PeanutRepository) GCMark(key kube.ResourceKey) (string, error)
GCMark calculates a signature for the resource from the repo URL and path along with the GVK.
func (*PeanutRepository) HeadHash ¶
func (p *PeanutRepository) HeadHash() (plumbing.Hash, error)
HeadHash returns the hash of the head commit of the repository.
func (*PeanutRepository) IsManaged ¶
func (p *PeanutRepository) IsManaged(r *cache.Resource) bool
IsManaged is used by the cache to determine whether or not a resource is a managed resource. TODO: is this appropriate for the Repository?
func (*PeanutRepository) Open ¶
func (p *PeanutRepository) Open(openPath string) error
Open assumes that the provided path contains a valid Git clone with the correct branch.
func (*PeanutRepository) ParseManifests ¶
func (p *PeanutRepository) ParseManifests() ([]*unstructured.Unstructured, error)
ParseManifests parses this repository's path, and returns the parsed resources. TODO: should this take a path? Is there