Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

support diffing final releases. #456

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions app/fissile.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,14 +724,16 @@ func (f *Fissile) GetDiffConfigurationBases(releasePaths []string, cacheDir stri
if len(releasePaths) != 2 {
return nil, fmt.Errorf("expected two release paths, got %d", len(releasePaths))
}
defaultValues := []string{}
releases, err := releaseresolver.LoadReleasesFromDisk(model.ReleaseOptions{
ReleasePaths: releasePaths,
ReleaseNames: defaultValues,
ReleaseVersions: defaultValues,
BOSHCacheDir: cacheDir})
resolver := releaseresolver.NewReleaseResolver(cacheDir)
releases, err := resolver.Load(
model.ReleaseOptions{
ReleasePaths: releasePaths,
ReleaseNames: []string{},
ReleaseVersions: []string{},
BOSHCacheDir: cacheDir},
nil)
if err != nil {
return nil, fmt.Errorf("dev config diff: error loading release information: %s", err)
return nil, fmt.Errorf("config diff: error loading release information: %s", err)
}
return getDiffsFromReleases(releases)
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ func absolutePaths(paths ...*string) error {
}

func absolutePath(path string) (string, error) {
if strings.Contains(path, "://") {
// Special case URLs
return path, nil
}
path, err := filepath.Abs(path)
if err != nil {
return "", fmt.Errorf("Error getting absolute path for path %s: %v", path, err)
Expand Down
4 changes: 3 additions & 1 deletion model/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package loader
// resolvers we want to keep `dep ensure` small

import (
"path/filepath"

"code.cloudfoundry.org/fissile/model"
"code.cloudfoundry.org/fissile/model/releaseresolver"
"code.cloudfoundry.org/fissile/model/resolver"
Expand All @@ -17,6 +19,6 @@ func LoadRoleManifest(manifestFilePath string, options model.LoadRoleManifestOpt
return nil, err
}

r := releaseresolver.NewReleaseResolver(manifestFilePath)
r := releaseresolver.NewReleaseResolver(filepath.Dir(manifestFilePath))
return resolver.NewResolver(roleManifest, r, options).Resolve()
}
Loading