Commit a019cf82 authored by Oren Shomron's avatar Oren Shomron
Browse files

Rename EnvironmentSpec[s] -> EnvironmentConfig[s]


Signed-off-by: default avatarOren Shomron <shomron@gmail.com>
parent d44b841c
...@@ -28,7 +28,7 @@ func TestEnvDescribe(t *testing.T) { ...@@ -28,7 +28,7 @@ func TestEnvDescribe(t *testing.T) {
withApp(t, func(appMock *amocks.App) { withApp(t, func(appMock *amocks.App) {
envName := "default" envName := "default"
env := &app.EnvironmentSpec{ env := &app.EnvironmentConfig{
KubernetesVersion: "v1.7.0", KubernetesVersion: "v1.7.0",
} }
......
...@@ -29,14 +29,14 @@ import ( ...@@ -29,14 +29,14 @@ import (
func TestEnvList(t *testing.T) { func TestEnvList(t *testing.T) {
withApp(t, func(appMock *amocks.App) { withApp(t, func(appMock *amocks.App) {
env := &app.EnvironmentSpec{ env := &app.EnvironmentConfig{
KubernetesVersion: "v1.7.0", KubernetesVersion: "v1.7.0",
Destination: &app.EnvironmentDestinationSpec{ Destination: &app.EnvironmentDestinationSpec{
Namespace: "default", Namespace: "default",
Server: "http://example.com", Server: "http://example.com",
}, },
} }
envs := app.EnvironmentSpecs{ envs := app.EnvironmentConfigs{
"default": env, "default": env,
} }
......
...@@ -50,7 +50,7 @@ func RunEnvSet(m map[string]interface{}) error { ...@@ -50,7 +50,7 @@ func RunEnvSet(m map[string]interface{}) error {
// func types for renaming and updating environments // func types for renaming and updating environments
type envRenameFn func(a app.App, from, to string, override bool) error type envRenameFn func(a app.App, from, to string, override bool) error
type updateEnvFn func(a app.App, envName, k8sAPISpec string, spec *app.EnvironmentSpec, override bool) error type updateEnvFn func(a app.App, envName, k8sAPISpec string, spec *app.EnvironmentConfig, override bool) error
// EnvSet sets targets for an environment. // EnvSet sets targets for an environment.
type EnvSet struct { type EnvSet struct {
...@@ -99,7 +99,7 @@ func (es *EnvSet) Run() error { ...@@ -99,7 +99,7 @@ func (es *EnvSet) Run() error {
return err return err
} }
if err := es.updateEnvSpec(env); err != nil { if err := es.updateEnvConfig(env); err != nil {
return err return err
} }
...@@ -118,7 +118,7 @@ func (es *EnvSet) updateName(isOverride bool) error { ...@@ -118,7 +118,7 @@ func (es *EnvSet) updateName(isOverride bool) error {
return nil return nil
} }
func (es *EnvSet) updateEnvSpec(env *app.EnvironmentSpec) error { func (es *EnvSet) updateEnvConfig(env *app.EnvironmentConfig) error {
if es.newNsName == "" && es.newServer == "" && es.newAPISpec == "" { if es.newNsName == "" && es.newServer == "" && es.newAPISpec == "" {
return nil return nil
} }
...@@ -134,6 +134,6 @@ func (es *EnvSet) updateEnvSpec(env *app.EnvironmentSpec) error { ...@@ -134,6 +134,6 @@ func (es *EnvSet) updateEnvSpec(env *app.EnvironmentSpec) error {
return es.updateEnvFn(es.app, es.envName, es.newAPISpec, env, env.IsOverride()) return es.updateEnvFn(es.app, es.envName, es.newAPISpec, env, env.IsOverride())
} }
func updateEnv(a app.App, envName, k8sAPISpec string, spec *app.EnvironmentSpec, override bool) error { func updateEnv(a app.App, envName, k8sAPISpec string, env *app.EnvironmentConfig, override bool) error {
return a.AddEnvironment(envName, k8sAPISpec, spec, override) return a.AddEnvironment(envName, k8sAPISpec, env, override)
} }
...@@ -33,8 +33,8 @@ func TestEnvSet(t *testing.T) { ...@@ -33,8 +33,8 @@ func TestEnvSet(t *testing.T) {
server := "new_server" server := "new_server"
newk8sAPISpec := "version:new_api_spec" newk8sAPISpec := "version:new_api_spec"
environmentMockFn := func(name string) *app.EnvironmentSpec { environmentMockFn := func(name string) *app.EnvironmentConfig {
return &app.EnvironmentSpec{ return &app.EnvironmentConfig{
Destination: &app.EnvironmentDestinationSpec{ Destination: &app.EnvironmentDestinationSpec{
Namespace: oldNamespace, Namespace: oldNamespace,
Server: oldServer, Server: oldServer,
...@@ -46,7 +46,7 @@ func TestEnvSet(t *testing.T) { ...@@ -46,7 +46,7 @@ func TestEnvSet(t *testing.T) {
cases := []struct { cases := []struct {
name string name string
in map[string]interface{} in map[string]interface{}
spec *app.EnvironmentSpec spec *app.EnvironmentConfig
envRenameFn func(t *testing.T) envRenameFn envRenameFn func(t *testing.T) envRenameFn
updateEnvFn func(t *testing.T) updateEnvFn updateEnvFn func(t *testing.T) updateEnvFn
}{ }{
...@@ -75,8 +75,8 @@ func TestEnvSet(t *testing.T) { ...@@ -75,8 +75,8 @@ func TestEnvSet(t *testing.T) {
OptionNamespace: namespace, OptionNamespace: namespace,
}, },
updateEnvFn: func(t *testing.T) updateEnvFn { updateEnvFn: func(t *testing.T) updateEnvFn {
return func(a app.App, envName, k8sAPISpec string, spec *app.EnvironmentSpec, override bool) error { return func(a app.App, envName, k8sAPISpec string, spec *app.EnvironmentConfig, override bool) error {
assert.Equal(t, spec, &app.EnvironmentSpec{ assert.Equal(t, spec, &app.EnvironmentConfig{
Destination: &app.EnvironmentDestinationSpec{ Destination: &app.EnvironmentDestinationSpec{
Namespace: namespace, Namespace: namespace,
Server: oldServer, Server: oldServer,
...@@ -94,8 +94,8 @@ func TestEnvSet(t *testing.T) { ...@@ -94,8 +94,8 @@ func TestEnvSet(t *testing.T) {
OptionServer: server, OptionServer: server,
}, },
updateEnvFn: func(t *testing.T) updateEnvFn { updateEnvFn: func(t *testing.T) updateEnvFn {
return func(a app.App, envName, k8sAPISpec string, spec *app.EnvironmentSpec, override bool) error { return func(a app.App, envName, k8sAPISpec string, spec *app.EnvironmentConfig, override bool) error {
assert.Equal(t, spec, &app.EnvironmentSpec{ assert.Equal(t, spec, &app.EnvironmentConfig{
Destination: &app.EnvironmentDestinationSpec{ Destination: &app.EnvironmentDestinationSpec{
Namespace: oldNamespace, Namespace: oldNamespace,
Server: server, Server: server,
...@@ -113,7 +113,7 @@ func TestEnvSet(t *testing.T) { ...@@ -113,7 +113,7 @@ func TestEnvSet(t *testing.T) {
OptionSpecFlag: newk8sAPISpec, OptionSpecFlag: newk8sAPISpec,
}, },
updateEnvFn: func(t *testing.T) updateEnvFn { updateEnvFn: func(t *testing.T) updateEnvFn {
return func(a app.App, envName, k8sAPISpec string, spec *app.EnvironmentSpec, override bool) error { return func(a app.App, envName, k8sAPISpec string, spec *app.EnvironmentConfig, override bool) error {
assert.Equal(t, newk8sAPISpec, k8sAPISpec) assert.Equal(t, newk8sAPISpec, k8sAPISpec)
return nil return nil
} }
...@@ -130,8 +130,8 @@ func TestEnvSet(t *testing.T) { ...@@ -130,8 +130,8 @@ func TestEnvSet(t *testing.T) {
OptionSpecFlag: newk8sAPISpec, OptionSpecFlag: newk8sAPISpec,
}, },
updateEnvFn: func(t *testing.T) updateEnvFn { updateEnvFn: func(t *testing.T) updateEnvFn {
return func(a app.App, newName, k8sAPISpec string, spec *app.EnvironmentSpec, override bool) error { return func(a app.App, newName, k8sAPISpec string, spec *app.EnvironmentConfig, override bool) error {
assert.Equal(t, spec, &app.EnvironmentSpec{ assert.Equal(t, spec, &app.EnvironmentConfig{
Destination: &app.EnvironmentDestinationSpec{ Destination: &app.EnvironmentDestinationSpec{
Namespace: namespace, Namespace: namespace,
Server: server, Server: server,
......
...@@ -32,7 +32,7 @@ func TestEnvTargets(t *testing.T) { ...@@ -32,7 +32,7 @@ func TestEnvTargets(t *testing.T) {
envName := "default" envName := "default"
modules := []string{"foo"} modules := []string{"foo"}
env := &app.EnvironmentSpec{} env := &app.EnvironmentConfig{}
appMock.On("Environment", "default").Return(env, nil) appMock.On("Environment", "default").Return(env, nil)
appMock.On("UpdateTargets", envName, modules).Return(nil) appMock.On("UpdateTargets", envName, modules).Return(nil)
...@@ -62,7 +62,7 @@ func TestEnvTargets_invalid_module(t *testing.T) { ...@@ -62,7 +62,7 @@ func TestEnvTargets_invalid_module(t *testing.T) {
envName := "default" envName := "default"
modules := []string{"foo"} modules := []string{"foo"}
env := &app.EnvironmentSpec{} env := &app.EnvironmentConfig{}
appMock.On("Environment", "default").Return(env, nil) appMock.On("Environment", "default").Return(env, nil)
appMock.On("UpdateTargets", envName, modules).Return(nil) appMock.On("UpdateTargets", envName, modules).Return(nil)
...@@ -92,7 +92,7 @@ func TestEnvTargets_invalid_environment(t *testing.T) { ...@@ -92,7 +92,7 @@ func TestEnvTargets_invalid_environment(t *testing.T) {
envName := "invalid" envName := "invalid"
modules := []string{"foo"} modules := []string{"foo"}
env := &app.EnvironmentSpec{} env := &app.EnvironmentConfig{}
envErr := errors.New("environment invalid was not found") envErr := errors.New("environment invalid was not found")
appMock.On("Environment", "invalid").Return(env, envErr) appMock.On("Environment", "invalid").Return(env, envErr)
......
...@@ -27,7 +27,7 @@ import ( ...@@ -27,7 +27,7 @@ import (
func TestEnvUpdate(t *testing.T) { func TestEnvUpdate(t *testing.T) {
withApp(t, func(appMock *amocks.App) { withApp(t, func(appMock *amocks.App) {
envSpec := &app.EnvironmentSpec{ envSpec := &app.EnvironmentConfig{
KubernetesVersion: "v1.8.9", KubernetesVersion: "v1.8.9",
} }
appMock.On("Environment", "envName").Return(envSpec, nil) appMock.On("Environment", "envName").Return(envSpec, nil)
......
...@@ -64,7 +64,7 @@ func TestValidate(t *testing.T) { ...@@ -64,7 +64,7 @@ func TestValidate(t *testing.T) {
aModuleName := "module" aModuleName := "module"
aClientConfig := &client.Config{} aClientConfig := &client.Config{}
env := &app.EnvironmentSpec{} env := &app.EnvironmentConfig{}
appMock.On("Environment", "default").Return(env, nil) appMock.On("Environment", "default").Return(env, nil)
in := map[string]interface{}{ in := map[string]interface{}{
......
...@@ -56,15 +56,15 @@ var ( ...@@ -56,15 +56,15 @@ var (
// App is a ksonnet application. // App is a ksonnet application.
type App interface { type App interface {
// AddEnvironment adds an environment. // AddEnvironment adds an environment.
AddEnvironment(name, k8sSpecFlag string, spec *EnvironmentSpec, isOverride bool) error AddEnvironment(name, k8sSpecFlag string, spec *EnvironmentConfig, isOverride bool) error
// AddRegistry adds a registry. // AddRegistry adds a registry.
AddRegistry(spec *RegistryConfig, isOverride bool) error AddRegistry(spec *RegistryConfig, isOverride bool) error
// CurrentEnvironment returns the current environment name or an empty string. // CurrentEnvironment returns the current environment name or an empty string.
CurrentEnvironment() string CurrentEnvironment() string
// Environment finds an environment by name. // Environment finds an environment by name.
Environment(name string) (*EnvironmentSpec, error) Environment(name string) (*EnvironmentConfig, error)
// Environments returns all environments. // Environments returns all environments.
Environments() (EnvironmentSpecs, error) Environments() (EnvironmentConfigs, error)
// EnvironmentParams returns params for an environment. // EnvironmentParams returns params for an environment.
EnvironmentParams(name string) (string, error) EnvironmentParams(name string) (string, error)
// Fs is the app's afero Fs. // Fs is the app's afero Fs.
......
...@@ -54,7 +54,7 @@ func NewApp001(fs afero.Fs, root string) *App001 { ...@@ -54,7 +54,7 @@ func NewApp001(fs afero.Fs, root string) *App001 {
// AddEnvironment adds an environment spec to the app spec. If the spec already exists, // AddEnvironment adds an environment spec to the app spec. If the spec already exists,
// it is overwritten. // it is overwritten.
func (a *App001) AddEnvironment(name, k8sSpecFlag string, spec *EnvironmentSpec, isOverride bool) error { func (a *App001) AddEnvironment(name, k8sSpecFlag string, spec *EnvironmentConfig, isOverride bool) error {
// if it is an override, write the destination to override file. If not, do the normal thing. // if it is an override, write the destination to override file. If not, do the normal thing.
envPath := filepath.Join(a.root, EnvironmentDirName, name) envPath := filepath.Join(a.root, EnvironmentDirName, name)
...@@ -77,21 +77,21 @@ func (a *App001) AddEnvironment(name, k8sSpecFlag string, spec *EnvironmentSpec, ...@@ -77,21 +77,21 @@ func (a *App001) AddEnvironment(name, k8sSpecFlag string, spec *EnvironmentSpec,
return err return err
} }
func (a *App001) overrideDestintation(name string, envSpec *EnvironmentSpec) error { func (a *App001) overrideDestintation(name string, envSpec *EnvironmentConfig) error {
return nil return nil
} }
// Environment returns the spec for an environment. In 0.1.0, the file lives in // Environment returns the spec for an environment. In 0.1.0, the file lives in
// /environments/name/spec.json. // /environments/name/spec.json.
func (a *App001) Environment(name string) (*EnvironmentSpec, error) { func (a *App001) Environment(name string) (*EnvironmentConfig, error) {
path := filepath.Join(a.root, EnvironmentDirName, name, app001specJSON) path := filepath.Join(a.root, EnvironmentDirName, name, app001specJSON)
return read001EnvSpec(a.fs, name, path) return read001EnvSpec(a.fs, name, path)
} }
// Environments returns specs for all environments. In 0.1.0, the environment spec // Environments returns specs for all environments. In 0.1.0, the environment spec
// lives in spec.json files. // lives in spec.json files.
func (a *App001) Environments() (EnvironmentSpecs, error) { func (a *App001) Environments() (EnvironmentConfigs, error) {
specs := EnvironmentSpecs{} specs := EnvironmentConfigs{}
root := filepath.Join(a.root, EnvironmentDirName) root := filepath.Join(a.root, EnvironmentDirName)
...@@ -222,7 +222,7 @@ type k8sSchema struct { ...@@ -222,7 +222,7 @@ type k8sSchema struct {
} `json:"info,omitempty"` } `json:"info,omitempty"`
} }
func read001EnvSpec(fs afero.Fs, name, path string) (*EnvironmentSpec, error) { func read001EnvSpec(fs afero.Fs, name, path string) (*EnvironmentConfig, error) {
b, err := afero.ReadFile(fs, path) b, err := afero.ReadFile(fs, path)
if err != nil { if err != nil {
return nil, err return nil, err
...@@ -254,7 +254,7 @@ func read001EnvSpec(fs afero.Fs, name, path string) (*EnvironmentSpec, error) { ...@@ -254,7 +254,7 @@ func read001EnvSpec(fs afero.Fs, name, path string) (*EnvironmentSpec, error) {
return nil, errors.New("unable to determine environment Kubernetes version") return nil, errors.New("unable to determine environment Kubernetes version")
} }
spec := EnvironmentSpec{ spec := EnvironmentConfig{
Path: name, Path: name,
Destination: &s, Destination: &s,
KubernetesVersion: ks.Info.Version, KubernetesVersion: ks.Info.Version,
......
...@@ -89,8 +89,8 @@ func TestApp001_RenameEnvironment(t *testing.T) { ...@@ -89,8 +89,8 @@ func TestApp001_RenameEnvironment(t *testing.T) {
func TestApp001_Environments(t *testing.T) { func TestApp001_Environments(t *testing.T) {
withApp001Fs(t, "app001_app.yaml", func(app *App001) { withApp001Fs(t, "app001_app.yaml", func(app *App001) {
expected := EnvironmentSpecs{ expected := EnvironmentConfigs{
"default": &EnvironmentSpec{ "default": &EnvironmentConfig{
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
...@@ -98,7 +98,7 @@ func TestApp001_Environments(t *testing.T) { ...@@ -98,7 +98,7 @@ func TestApp001_Environments(t *testing.T) {
KubernetesVersion: "v1.7.0", KubernetesVersion: "v1.7.0",
Path: "default", Path: "default",
}, },
"us-east/test": &EnvironmentSpec{ "us-east/test": &EnvironmentConfig{
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
...@@ -106,7 +106,7 @@ func TestApp001_Environments(t *testing.T) { ...@@ -106,7 +106,7 @@ func TestApp001_Environments(t *testing.T) {
KubernetesVersion: "v1.7.0", KubernetesVersion: "v1.7.0",
Path: "us-east/test", Path: "us-east/test",
}, },
"us-west/test": &EnvironmentSpec{ "us-west/test": &EnvironmentConfig{
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
...@@ -114,7 +114,7 @@ func TestApp001_Environments(t *testing.T) { ...@@ -114,7 +114,7 @@ func TestApp001_Environments(t *testing.T) {
KubernetesVersion: "v1.7.0", KubernetesVersion: "v1.7.0",
Path: "us-west/test", Path: "us-west/test",
}, },
"us-west/prod": &EnvironmentSpec{ "us-west/prod": &EnvironmentConfig{
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
...@@ -164,7 +164,7 @@ func TestApp001_Environment(t *testing.T) { ...@@ -164,7 +164,7 @@ func TestApp001_Environment(t *testing.T) {
func TestApp001_AddEnvironment(t *testing.T) { func TestApp001_AddEnvironment(t *testing.T) {
withApp001Fs(t, "app001_app.yaml", func(app *App001) { withApp001Fs(t, "app001_app.yaml", func(app *App001) {
newEnv := &EnvironmentSpec{ newEnv := &EnvironmentConfig{
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
......
...@@ -48,7 +48,7 @@ func NewApp010(fs afero.Fs, root string) *App010 { ...@@ -48,7 +48,7 @@ func NewApp010(fs afero.Fs, root string) *App010 {
// AddEnvironment adds an environment spec to the app spec. If the spec already exists, // AddEnvironment adds an environment spec to the app spec. If the spec already exists,
// it is overwritten. // it is overwritten.
func (a *App010) AddEnvironment(name, k8sSpecFlag string, newEnv *EnvironmentSpec, isOverride bool) error { func (a *App010) AddEnvironment(name, k8sSpecFlag string, newEnv *EnvironmentConfig, isOverride bool) error {
logrus.WithFields(logrus.Fields{ logrus.WithFields(logrus.Fields{
"k8s-spec-flag": k8sSpecFlag, "k8s-spec-flag": k8sSpecFlag,
"name": name, "name": name,
...@@ -79,7 +79,7 @@ func (a *App010) AddEnvironment(name, k8sSpecFlag string, newEnv *EnvironmentSpe ...@@ -79,7 +79,7 @@ func (a *App010) AddEnvironment(name, k8sSpecFlag string, newEnv *EnvironmentSpe
} }
// Environment returns the spec for an environment. // Environment returns the spec for an environment.
func (a *App010) Environment(name string) (*EnvironmentSpec, error) { func (a *App010) Environment(name string) (*EnvironmentConfig, error) {
if err := a.load(); err != nil { if err := a.load(); err != nil {
return nil, errors.Wrap(err, "load configuration") return nil, errors.Wrap(err, "load configuration")
} }
...@@ -100,12 +100,12 @@ func (a *App010) Environment(name string) (*EnvironmentSpec, error) { ...@@ -100,12 +100,12 @@ func (a *App010) Environment(name string) (*EnvironmentSpec, error) {
} }
// Environments returns all environment specs. // Environments returns all environment specs.
func (a *App010) Environments() (EnvironmentSpecs, error) { func (a *App010) Environments() (EnvironmentConfigs, error) {
if err := a.load(); err != nil { if err := a.load(); err != nil {
return nil, errors.Wrap(err, "load configuration") return nil, errors.Wrap(err, "load configuration")
} }
environments := EnvironmentSpecs{} environments := EnvironmentConfigs{}
for k, v := range a.config.Environments { for k, v := range a.config.Environments {
environments[k] = v environments[k] = v
} }
......
...@@ -33,7 +33,7 @@ func TestApp010_AddEnvironment(t *testing.T) { ...@@ -33,7 +33,7 @@ func TestApp010_AddEnvironment(t *testing.T) {
envLen := len(envs) envLen := len(envs)
newEnv := &EnvironmentSpec{ newEnv := &EnvironmentConfig{
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
...@@ -83,8 +83,9 @@ func TestApp010_AddEnvironment_empty_spec_flag(t *testing.T) { ...@@ -83,8 +83,9 @@ func TestApp010_AddEnvironment_empty_spec_flag(t *testing.T) {
func TestApp0101_Environments(t *testing.T) { func TestApp0101_Environments(t *testing.T) {
withApp010Fs(t, "app010_app.yaml", func(app *App010) { withApp010Fs(t, "app010_app.yaml", func(app *App010) {
expected := EnvironmentSpecs{ expected := EnvironmentConfigs{
"default": &EnvironmentSpec{ "default": &EnvironmentConfig{
Name: "default",
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
...@@ -92,7 +93,8 @@ func TestApp0101_Environments(t *testing.T) { ...@@ -92,7 +93,8 @@ func TestApp0101_Environments(t *testing.T) {
KubernetesVersion: "v1.7.0", KubernetesVersion: "v1.7.0",
Path: "default", Path: "default",
}, },
"us-east/test": &EnvironmentSpec{ "us-east/test": &EnvironmentConfig{
Name: "us-east/test",
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
...@@ -100,7 +102,8 @@ func TestApp0101_Environments(t *testing.T) { ...@@ -100,7 +102,8 @@ func TestApp0101_Environments(t *testing.T) {
KubernetesVersion: "v1.7.0", KubernetesVersion: "v1.7.0",
Path: "us-east/test", Path: "us-east/test",
}, },
"us-west/test": &EnvironmentSpec{ "us-west/test": &EnvironmentConfig{
Name: "us-west/test",
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
...@@ -108,7 +111,8 @@ func TestApp0101_Environments(t *testing.T) { ...@@ -108,7 +111,8 @@ func TestApp0101_Environments(t *testing.T) {
KubernetesVersion: "v1.7.0", KubernetesVersion: "v1.7.0",
Path: "us-west/test", Path: "us-west/test",
}, },
"us-west/prod": &EnvironmentSpec{ "us-west/prod": &EnvironmentConfig{
Name: "us-west/prod",
Destination: &EnvironmentDestinationSpec{ Destination: &EnvironmentDestinationSpec{
Namespace: "some-namespace", Namespace: "some-namespace",
Server: "http://example.com", Server: "http://example.com",
......
...@@ -40,7 +40,7 @@ func newBaseApp(fs afero.Fs, root string) *baseApp { ...@@ -40,7 +40,7 @@ func newBaseApp(fs afero.Fs, root string) *baseApp {
root: root, root: root,
config: &Spec{}, config: &Spec{},
overrides: &Override{ overrides: &Override{
Environments: EnvironmentSpecs{}, Environments: EnvironmentConfigs{},
Registries: RegistryConfigs{}, Registries: RegistryConfigs{},
}, },
} }
...@@ -113,7 +113,7 @@ func (ba *baseApp) load() error { ...@@ -113,7 +113,7 @@ func (ba *baseApp) load() error {
} }
if len(config.Environments) == 0 { if len(config.Environments) == 0 {
config.Environments = EnvironmentSpecs{} config.Environments = EnvironmentConfigs{}
} }
if len(config.Registries) == 0 { if len(config.Registries) == 0 {
...@@ -121,7 +121,7 @@ func (ba *baseApp) load() error { ...@@ -121,7 +121,7 @@ func (ba *baseApp) load() error {
} }
override := Override{ override := Override{
Environments: EnvironmentSpecs{}, Environments: EnvironmentConfigs{},
Registries: RegistryConfigs{}, Registries: RegistryConfigs{},
} }
if exists { if exists {
...@@ -138,7 +138,7 @@ func (ba *baseApp) load() error { ...@@ -138,7 +138,7 @@ func (ba *baseApp) load() error {
} }
if len(override.Environments) == 0 { if len(override.Environments) == 0 {
override.Environments = EnvironmentSpecs{} override.Environments = EnvironmentConfigs{}
} }