This repository has been archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pr/duffle-outputs
- Loading branch information
Showing
101 changed files
with
85 additions
and
21,400 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
"imageType": "azure-image", | ||
"image": "duffle-dev/duffle-vm-example-0.1.1" | ||
} | ||
] | ||
} | ||
], | ||
"schemaVersion": "v1.0.0-WD" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,6 @@ | |
} | ||
}, | ||
"parameters": null, | ||
"credentials": null | ||
} | ||
"credentials": null, | ||
"schemaVersion": "v1.0.0-WD" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,27 @@ | ||
package manifest | ||
|
||
import ( | ||
"fmt" | ||
"encoding/json" | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/spf13/viper" | ||
|
||
"github.com/deislabs/duffle/pkg/duffle" | ||
) | ||
|
||
// Load opens the named file for reading. If successful, the manifest is returned. | ||
// Load parses the named file into a manifest. | ||
func Load(name, dir string) (*Manifest, error) { | ||
v := viper.New() | ||
if name == "" { | ||
v.SetConfigName(duffle.DuffleFilename) | ||
} else { | ||
v.SetConfigFile(filepath.Join(dir, name)) | ||
name = duffle.DuffleFilename + ".json" | ||
} | ||
v.AddConfigPath(dir) | ||
err := v.ReadInConfig() | ||
f, err := os.Open(filepath.Join(dir, name)) | ||
if err != nil { | ||
return nil, fmt.Errorf("Error finding duffle config file: %s", err) | ||
return nil, err | ||
} | ||
|
||
m := New() | ||
err = v.Unmarshal(m) | ||
if err != nil { | ||
manifest := New() | ||
if err := json.NewDecoder(f).Decode(&manifest); err != nil { | ||
return nil, err | ||
} | ||
return m, nil | ||
|
||
return manifest, nil | ||
} |
Oops, something went wrong.