Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated features #284

Merged
merged 2 commits into from
Feb 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions config/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,10 @@ package config
import (
"fmt"

log "github.com/Sirupsen/logrus"
"github.com/joyent/containerpilot/commands"
)

func (cfg *rawConfig) parsePreStart() (*commands.Command, error) {
// onStart has been deprecated for preStart. Remove in 2.0
if cfg.preStart != nil && cfg.onStart != nil {
log.Warnf("The onStart option has been deprecated in favor of preStart. ContainerPilot will use only the preStart option provided")
}

// alias the onStart behavior to preStart
if cfg.preStart == nil && cfg.onStart != nil {
log.Warnf("The onStart option has been deprecated in favor of preStart. ContainerPilot will use the onStart option as a preStart")
cfg.preStart = cfg.onStart
}
return parseCommand("preStart", cfg.preStart)
}

Expand Down
3 changes: 0 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

type rawConfig struct {
logConfig *LogConfig
onStart interface{}
preStart interface{}
preStop interface{}
postStop interface{}
Expand Down Expand Up @@ -382,7 +381,6 @@ func decodeConfig(configMap map[string]interface{}, result *rawConfig) error {
}
result.stopTimeout = stopTimeout
result.logConfig = &logConfig
result.onStart = configMap["onStart"]
result.preStart = configMap["preStart"]
result.preStop = configMap["preStop"]
result.postStop = configMap["postStop"]
Expand All @@ -393,7 +391,6 @@ func decodeConfig(configMap map[string]interface{}, result *rawConfig) error {
result.telemetryConfig = configMap["telemetry"]

delete(configMap, "logging")
delete(configMap, "onStart")
delete(configMap, "preStart")
delete(configMap, "preStop")
delete(configMap, "postStop")
Expand Down
4 changes: 1 addition & 3 deletions utils/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package utils
import (
"fmt"
"regexp"

log "github.com/Sirupsen/logrus"
)

var validName = regexp.MustCompile(`^[a-z][a-zA-Z0-9\-]+$`)
Expand All @@ -17,7 +15,7 @@ func ValidateServiceName(name string) error {
return fmt.Errorf("`name` must not be blank")
}
if ok := validName.MatchString(name); !ok {
log.Warnf("Deprecation warning: service names must be alpha-numeric with dashes. In a future version of ContainerPilot this will be an error.")
return fmt.Errorf("service names must be alphanumeric with dashes to comply with service discovery")
}
return nil
}