pulumi/pkg/engine/config_delete.go
Matt Ellis a6eabdc34b Move a bunch of code around
Move most of the guts of `lumi` into the newly created `engine`
package.
2017-08-24 18:00:46 -07:00

24 lines
468 B
Go

package engine
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi-fabric/pkg/tokens"
)
func DeleteConfig(envName string, key string) error {
info, err := initEnvCmdName(tokens.QName(envName), "")
if err != nil {
return err
}
config := info.Target.Config
if config != nil {
delete(config, tokens.Token(key))
if !saveEnv(info.Target, info.Snapshot, "", true) {
return errors.Errorf("could not save configuration value")
}
}
return nil
}