packer: Default cache is just to os temporary dir
This commit is contained in:
parent
edaf19199f
commit
f2c8b994a0
|
@ -104,6 +104,11 @@ func NewEnvironment(config *EnvironmentConfig) (resultEnv Environment, err error
|
||||||
env.components.Provisioner = func(string) (Provisioner, error) { return nil, nil }
|
env.components.Provisioner = func(string) (Provisioner, error) { return nil, nil }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The default cache is just the system temporary directory
|
||||||
|
if env.cache == nil {
|
||||||
|
env.cache = &FileCache{CacheDir: os.TempDir()}
|
||||||
|
}
|
||||||
|
|
||||||
resultEnv = env
|
resultEnv = env
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,6 +111,14 @@ func TestEnvironment_Builder_Error(t *testing.T) {
|
||||||
assert.Nil(returnedBuilder, "should be no builder")
|
assert.Nil(returnedBuilder, "should be no builder")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestEnvironment_Cache(t *testing.T) {
|
||||||
|
config := DefaultEnvironmentConfig()
|
||||||
|
env, _ := NewEnvironment(config)
|
||||||
|
if env.Cache() == nil {
|
||||||
|
t.Fatal("cache should not be nil")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestEnvironment_Cli_Error(t *testing.T) {
|
func TestEnvironment_Cli_Error(t *testing.T) {
|
||||||
assert := asserts.NewTestingAsserts(t, true)
|
assert := asserts.NewTestingAsserts(t, true)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue