Documentation ¶
Index ¶
- Constants
- Variables
- func IsFileNotFoundInProjectDirectoryError(err error) bool
- type FileNotAcceptedError
- type FileNotFoundInProjectDirectoryError
- type FileNotFoundInProjectRepositoryError
- type FileReader
- func (r FileReader) CheckCommitFileExistenceAndLocalChanges(ctx context.Context, relPath string) (err error)
- func (r FileReader) CheckConfigurationFileExistenceAndAcceptance(ctx context.Context, relPath string, ...) (err error)
- func (r FileReader) CheckFileExistenceAndAcceptance(ctx context.Context, relPath string, ...) (err error)
- func (r FileReader) ConfigGoTemplateFilesGet(ctx context.Context, relPath string) ([]byte, error)
- func (r FileReader) ConfigGoTemplateFilesGlob(ctx context.Context, glob string) (map[string]interface{}, error)
- func (r FileReader) HandleValidateStatusResultError(err error) error
- func (r FileReader) IsCommitFileExist(ctx context.Context, relPath string) (bool, error)
- func (r FileReader) IsCommitTreeEntryDirectory(ctx context.Context, relPath string) (bool, error)
- func (r FileReader) IsCommitTreeEntryExist(ctx context.Context, relPath string) (bool, error)
- func (r FileReader) IsConfigExistAnywhere(ctx context.Context, customRelPath string) (exist bool, err error)
- func (r FileReader) IsConfigurationFileExist(ctx context.Context, relPath string, ...) (exist bool, err error)
- func (r FileReader) IsConfigurationFileExistAnywhere(ctx context.Context, relPath string) (exist bool, err error)
- func (r FileReader) IsDirectoryExist(ctx context.Context, relPath string) (exist bool, err error)
- func (r FileReader) IsDockerignoreExistAnywhere(ctx context.Context, relPath string) (exist bool, err error)
- func (r FileReader) IsFileModifiedLocally(ctx context.Context, relPath string) (modified bool, err error)
- func (r FileReader) IsGiterminismConfigExistAnywhere(ctx context.Context) (exist bool, err error)
- func (r FileReader) IsRegularFileExist(ctx context.Context, relPath string) (exist bool, err error)
- func (r FileReader) ListCommitFilesWithGlob(ctx context.Context, dir string, pattern string) (files []string, err error)
- func (r FileReader) ListFilesWithGlob(ctx context.Context, relDir, glob string, ...) (files []string, err error)
- func (r FileReader) LoadChartDir(ctx context.Context, chartDir string) ([]*chart.ChartExtenderBufferedFile, error)
- func (r FileReader) LocateChart(ctx context.Context, chartDir string, settings *cli.EnvSettings) (string, error)
- func (r FileReader) NewFileNotFoundInProjectDirectoryError(relPath string) error
- func (r FileReader) NewFileNotFoundInProjectRepositoryError(relPath string) error
- func (r FileReader) NewSubmoduleAddedAndNotCommittedError(submodulePath string) error
- func (r FileReader) NewSubmoduleCommitChangedError(submodulePath string) error
- func (r FileReader) NewSubmoduleDeletedError(submodulePath string) error
- func (r FileReader) NewSubmoduleHasUncommittedChangesError(submodulePath string) error
- func (r FileReader) NewSubmoduleHasUntrackedChangesError(submodulePath string) error
- func (r FileReader) NewUncommittedFilesError(relPaths ...string) error
- func (r FileReader) NewUntrackedFilesError(relPaths ...string) error
- func (r FileReader) PrepareConfigNotFoundError(ctx context.Context, configPathsToCheck []string) (err error)
- func (r FileReader) ReadAndCheckConfigurationFile(ctx context.Context, relPath string, ...) (data []byte, err error)
- func (r FileReader) ReadChartFile(ctx context.Context, path string) ([]byte, error)
- func (r FileReader) ReadCommitFile(ctx context.Context, relPath string) ([]byte, error)
- func (r FileReader) ReadCommitTreeEntryContent(ctx context.Context, relPath string) ([]byte, error)
- func (r FileReader) ReadConfig(ctx context.Context, customRelPath string) (data []byte, err error)
- func (r FileReader) ReadConfigTemplateFiles(ctx context.Context, customDirRelPath string, ...) (err error)
- func (r FileReader) ReadConfigurationFile(ctx context.Context, relPath string, ...) (data []byte, err error)
- func (r FileReader) ReadDockerfile(ctx context.Context, relPath string) (data []byte, err error)
- func (r FileReader) ReadDockerignore(ctx context.Context, relPath string) (data []byte, err error)
- func (r FileReader) ReadFile(ctx context.Context, relPath string) (data []byte, err error)
- func (r FileReader) ReadGiterminismConfig(ctx context.Context) (data []byte, err error)
- func (r FileReader) ResolveAndCheckCommitFilePath(ctx context.Context, relPath string, ...) (string, error)
- func (r FileReader) ResolveAndCheckFilePath(ctx context.Context, relPath string, checkFunc func(resolvedPath string) error) (resolvedPath string, err error)
- func (r FileReader) ResolveFilePath(ctx context.Context, relPath string) (resolvedPath string, err error)
- func (r *FileReader) SetGiterminismConfig(giterminismConfig giterminismConfig)
- func (r FileReader) ShouldFileBeRead(ctx context.Context, relPath string, ...) (should bool, err error)
- func (r FileReader) SkipFileFunc(acceptedFilePathMatcher path_matcher.PathMatcher) func(ctx context.Context, r FileReader, existingRelPath string) (bool, error)
- func (r FileReader) StatusPathList(ctx context.Context, pathMatcher path_matcher.PathMatcher) (list []string, err error)
- func (r FileReader) ValidateFileByStatusResult(ctx context.Context, relPath string) error
- func (r FileReader) ValidateStatusResult(ctx context.Context, pathMatcher path_matcher.PathMatcher) (err error)
- func (r FileReader) WalkConfigurationFilesWithGlob(ctx context.Context, dir, glob string, ...) (err error)
- type FileReaderError
- type UncommittedFilesError
- type UntrackedFilesError
Constants ¶
const GiterminismConfigName = "werf-giterminism.yaml"
Variables ¶
var DefaultWerfConfigNames = []string{"werf.yaml", "werf.yml"}
var DefaultWerfConfigTemplatesDirName = ".werf"
Functions ¶
Types ¶
type FileNotAcceptedError ¶
type FileNotAcceptedError FileReaderError
type FileNotFoundInProjectDirectoryError ¶
type FileNotFoundInProjectDirectoryError FileReaderError
type FileNotFoundInProjectRepositoryError ¶
type FileNotFoundInProjectRepositoryError FileReaderError
type FileReader ¶
type FileReader struct {
// contains filtered or unexported fields
}
func NewFileReader ¶
func NewFileReader(sharedOptions sharedOptions) FileReader
func (FileReader) CheckCommitFileExistenceAndLocalChanges ¶
func (r FileReader) CheckCommitFileExistenceAndLocalChanges(ctx context.Context, relPath string) (err error)
CheckCommitFileExistenceAndLocalChanges returns nil if the file exists and does not have any uncommitted changes locally (each symlink target).
func (FileReader) CheckConfigurationFileExistenceAndAcceptance ¶
func (r FileReader) CheckConfigurationFileExistenceAndAcceptance(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) bool) (err error)
CheckConfigurationFileExistenceAndAcceptance does CheckFileExistenceAndAcceptance or CheckCommitFileExistenceAndLocalChanges depending on the giterminism config.
func (FileReader) CheckFileExistenceAndAcceptance ¶
func (r FileReader) CheckFileExistenceAndAcceptance(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) bool) (err error)
CheckFileExistenceAndAcceptance returns nil if the resolved file exists and is fully accepted by the giterminism config (each symlink target must be accepted if the file path accepted)
func (FileReader) ConfigGoTemplateFilesGet ¶
func (FileReader) ConfigGoTemplateFilesGlob ¶
func (FileReader) HandleValidateStatusResultError ¶ added in v1.2.10
func (r FileReader) HandleValidateStatusResultError(err error) error
func (FileReader) IsCommitFileExist ¶
func (FileReader) IsCommitTreeEntryDirectory ¶ added in v1.2.7
func (FileReader) IsCommitTreeEntryExist ¶
func (FileReader) IsConfigExistAnywhere ¶
func (FileReader) IsConfigurationFileExist ¶
func (r FileReader) IsConfigurationFileExist(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) bool) (exist bool, err error)
IsConfigurationFileExist checks the configuration file existence taking into account the giterminism config. The method does not check acceptance for each symlink target if the configuration file is symlink.
func (FileReader) IsConfigurationFileExistAnywhere ¶
func (r FileReader) IsConfigurationFileExistAnywhere(ctx context.Context, relPath string) (exist bool, err error)
IsConfigurationFileExistAnywhere returns true if the configuration file exists in the project directory or in the project repository.
func (FileReader) IsDirectoryExist ¶
IsDirectoryExist resolves symlinks and returns true if the resolved file is a directory.
func (FileReader) IsDockerignoreExistAnywhere ¶
func (FileReader) IsFileModifiedLocally ¶ added in v1.2.7
func (r FileReader) IsFileModifiedLocally(ctx context.Context, relPath string) (modified bool, err error)
IsFileModifiedLocally checks for the file changes in worktree or index.
func (FileReader) IsGiterminismConfigExistAnywhere ¶
func (r FileReader) IsGiterminismConfigExistAnywhere(ctx context.Context) (exist bool, err error)
func (FileReader) IsRegularFileExist ¶
IsRegularFileExist resolves symlinks and returns true if the resolved file is a regular file.
func (FileReader) ListCommitFilesWithGlob ¶
func (FileReader) ListFilesWithGlob ¶
func (r FileReader) ListFilesWithGlob(ctx context.Context, relDir, glob string, skipFileFunc func(ctx context.Context, r FileReader, existingRelPath string) (bool, error)) (files []string, err error)
ListFilesWithGlob returns the list of files by the glob, follows symlinks. The result paths are relative to the passed directory, the method does reverse resolving for symlinks.
func (FileReader) LoadChartDir ¶
func (r FileReader) LoadChartDir(ctx context.Context, chartDir string) ([]*chart.ChartExtenderBufferedFile, error)
func (FileReader) LocateChart ¶
func (r FileReader) LocateChart(ctx context.Context, chartDir string, settings *cli.EnvSettings) (string, error)
func (FileReader) NewFileNotFoundInProjectDirectoryError ¶
func (r FileReader) NewFileNotFoundInProjectDirectoryError(relPath string) error
func (FileReader) NewFileNotFoundInProjectRepositoryError ¶
func (r FileReader) NewFileNotFoundInProjectRepositoryError(relPath string) error
func (FileReader) NewSubmoduleAddedAndNotCommittedError ¶ added in v1.2.8
func (r FileReader) NewSubmoduleAddedAndNotCommittedError(submodulePath string) error
func (FileReader) NewSubmoduleCommitChangedError ¶ added in v1.2.8
func (r FileReader) NewSubmoduleCommitChangedError(submodulePath string) error
func (FileReader) NewSubmoduleDeletedError ¶ added in v1.2.8
func (r FileReader) NewSubmoduleDeletedError(submodulePath string) error
func (FileReader) NewSubmoduleHasUncommittedChangesError ¶ added in v1.2.8
func (r FileReader) NewSubmoduleHasUncommittedChangesError(submodulePath string) error
func (FileReader) NewSubmoduleHasUntrackedChangesError ¶ added in v1.2.8
func (r FileReader) NewSubmoduleHasUntrackedChangesError(submodulePath string) error
func (FileReader) NewUncommittedFilesError ¶
func (r FileReader) NewUncommittedFilesError(relPaths ...string) error
func (FileReader) NewUntrackedFilesError ¶ added in v1.2.10
func (r FileReader) NewUntrackedFilesError(relPaths ...string) error
func (FileReader) PrepareConfigNotFoundError ¶
func (r FileReader) PrepareConfigNotFoundError(ctx context.Context, configPathsToCheck []string) (err error)
func (FileReader) ReadAndCheckConfigurationFile ¶
func (r FileReader) ReadAndCheckConfigurationFile(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) bool) (data []byte, err error)
ReadAndCheckConfigurationFile does CheckConfigurationFileExistenceAndAcceptance and ReadConfigurationFile.
func (FileReader) ReadChartFile ¶
func (FileReader) ReadCommitFile ¶
func (FileReader) ReadCommitTreeEntryContent ¶
func (FileReader) ReadConfig ¶
func (FileReader) ReadConfigTemplateFiles ¶
func (FileReader) ReadConfigurationFile ¶
func (r FileReader) ReadConfigurationFile(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) bool) (data []byte, err error)
ReadConfigurationFile does ReadFile or ReadCommitFile depending on the giterminism config.
func (FileReader) ReadDockerfile ¶
func (FileReader) ReadDockerignore ¶
func (FileReader) ReadGiterminismConfig ¶
func (r FileReader) ReadGiterminismConfig(ctx context.Context) (data []byte, err error)
func (FileReader) ResolveAndCheckCommitFilePath ¶
func (FileReader) ResolveAndCheckFilePath ¶
func (r FileReader) ResolveAndCheckFilePath(ctx context.Context, relPath string, checkFunc func(resolvedPath string) error) (resolvedPath string, err error)
ResolveAndCheckFilePath resolves the path and run checkFunc for every file path resolve.
func (FileReader) ResolveFilePath ¶
func (*FileReader) SetGiterminismConfig ¶
func (r *FileReader) SetGiterminismConfig(giterminismConfig giterminismConfig)
func (FileReader) ShouldFileBeRead ¶
func (r FileReader) ShouldFileBeRead(ctx context.Context, relPath string, isFileAcceptedCheckFunc func(relPath string) bool) (should bool, err error)
ShouldFileBeRead return true if not resolved path accepted by giterminism config.
func (FileReader) SkipFileFunc ¶ added in v1.2.7
func (r FileReader) SkipFileFunc(acceptedFilePathMatcher path_matcher.PathMatcher) func(ctx context.Context, r FileReader, existingRelPath string) (bool, error)
func (FileReader) StatusPathList ¶ added in v1.2.8
func (r FileReader) StatusPathList(ctx context.Context, pathMatcher path_matcher.PathMatcher) (list []string, err error)
func (FileReader) ValidateFileByStatusResult ¶ added in v1.2.10
func (r FileReader) ValidateFileByStatusResult(ctx context.Context, relPath string) error
func (FileReader) ValidateStatusResult ¶ added in v1.2.10
func (r FileReader) ValidateStatusResult(ctx context.Context, pathMatcher path_matcher.PathMatcher) (err error)
func (FileReader) WalkConfigurationFilesWithGlob ¶
func (r FileReader) WalkConfigurationFilesWithGlob(ctx context.Context, dir, glob string, acceptedFilePathMatcher path_matcher.PathMatcher, handleFileFunc func(relativeToDirNotResolvedPath string, data []byte, err error) error) (err error)
WalkConfigurationFilesWithGlob reads the configuration files taking into account the giterminism config. The result paths are relative to the passed directory, the method does reverse resolving for symlinks.
type FileReaderError ¶ added in v1.2.10
type FileReaderError struct {
// contains filtered or unexported fields
}
type UncommittedFilesError ¶
type UncommittedFilesError FileReaderError
type UntrackedFilesError ¶ added in v1.2.10
type UntrackedFilesError FileReaderError