WIP: Trying to implement diff
This commit is contained in:
@ -18,10 +18,18 @@ type LockEntry struct {
|
||||
Namespace string
|
||||
RepoUrl string
|
||||
RepoName string
|
||||
GitCommit string
|
||||
Values []string
|
||||
Secrets []string
|
||||
}
|
||||
|
||||
type HashPerRelease struct {
|
||||
Release string
|
||||
Namespace string
|
||||
CommitHash string
|
||||
}
|
||||
type HashesPerReleases []*HashPerRelease
|
||||
|
||||
type LockRepository struct {
|
||||
URL string
|
||||
Name string
|
||||
@ -77,6 +85,16 @@ func (lockfile LockFile) ReposFromLockfile() (repository.Repositories, error) {
|
||||
return dedupedRepositories, nil
|
||||
}
|
||||
|
||||
func (lf LockFile) AddHashes(hashes HashesPerReleases) {
|
||||
for _, lockEntry := range lf {
|
||||
for _, hash := range hashes {
|
||||
if lockEntry.Namespace == hash.Namespace && lockEntry.Release == hash.Release {
|
||||
lockEntry.GitCommit = hash.CommitHash
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (lf LockFile) WriteToFile(dir string) error {
|
||||
lockfilePath := fmt.Sprintf("%s/%s", dir, LOCKFILE_NAME)
|
||||
lockfileContent, err := yaml.Marshal(lf)
|
||||
|
Reference in New Issue
Block a user