diff --git a/internal/controllers/environments.go b/internal/controllers/environments.go index 1c20168..3d7d930 100644 --- a/internal/controllers/environments.go +++ b/internal/controllers/environments.go @@ -201,12 +201,22 @@ func (env *Environemnt) Get(ctx context.Context) error { if err != nil { return err } + if val, ok := res["SP_DESCRIPTION"]; ok { + env.Data.Description = val + } - env.Data.Description = res["SP_DESCRIPTION"] - env.Data.Provider = res["SP_PROVIDER"] - env.Data.Kubernetes = res["SP_KUBERNETES"] - env.Data.ServerType = res["SP_SERVER_TYPE"] - env.Data.Location = res["SP_SERVER_LOCATION"] + if val, ok := res["SP_PROVIDER"]; ok { + env.Data.Provider = val + } + if val, ok := res["SP_KUBERNETES"]; ok { + env.Data.Kubernetes = val + } + if val, ok := res["SP_SERVER_TYPE"]; ok { + env.Data.ServerType = val + } + if val, ok := res["SP_SERVER_LOCATION"]; ok { + env.Data.Location = val + } return nil }