fix(tiller): fix a warning bug in hook annotation

pull/2874/head
DoctorZK 7 years ago
parent 8befd50c12
commit 608fd7318a

@ -171,17 +171,18 @@ func (file *manifestFile) sort(result *result) error {
DeletePolicies: []release.Hook_DeletePolicy{}, DeletePolicies: []release.Hook_DeletePolicy{},
} }
isKnownHook := false isUnknownHook := false
for _, hookType := range strings.Split(hookTypes, ",") { for _, hookType := range strings.Split(hookTypes, ",") {
hookType = strings.ToLower(strings.TrimSpace(hookType)) hookType = strings.ToLower(strings.TrimSpace(hookType))
e, ok := events[hookType] e, ok := events[hookType]
if ok { if !ok {
isKnownHook = true isUnknownHook = true
h.Events = append(h.Events, e) break
} }
h.Events = append(h.Events, e)
} }
if !isKnownHook { if isUnknownHook {
log.Printf("info: skipping unknown hook: %q", hookTypes) log.Printf("info: skipping unknown hook: %q", hookTypes)
continue continue
} }

Loading…
Cancel
Save