wrong types

pull/99/head
Karolis Rusenas 2017-08-16 23:14:12 +01:00
parent 7abdfaf013
commit f026adfef8
2 changed files with 13 additions and 5 deletions

View File

@ -2,6 +2,7 @@ package kubernetes
import (
"testing"
"time"
"github.com/rusenask/keel/approvals"
"github.com/rusenask/keel/cache/memory"
@ -89,7 +90,7 @@ func (s *fakeSender) Send(event types.EventNotification) error {
}
func approver() *approvals.DefaultManager {
cache := memory.NewMemoryCache(10, 10, 10)
cache := memory.NewMemoryCache(10*time.Minute, 10*time.Minute, 10*time.Minute)
return approvals.New(cache, codecs.DefaultSerializer(), &fakeProvider{})
}

View File

@ -1,3 +1,4 @@
// Package types holds most of the types used across Keel
//go:generate jsonenums -type=Notification
//go:generate jsonenums -type=Level
//go:generate jsonenums -type=PolicyType
@ -31,7 +32,13 @@ const KeelPollDefaultSchedule = "@every 1m"
const KeelDigestAnnotation = "keel.sh/digest"
// KeelMinimumApprovalsLabel - min approvals
const KeelMinimumApprovalsLabel = "keel.sh/minApprovals"
const KeelMinimumApprovalsLabel = "keel.sh/approvals"
// KeelApprovalTimeoutLabel - approval deadline
const KeelApprovalTimeoutLabel = "keel.sh/approvalTimeout"
// KeelApprovalTimeoutDefault - default timeout in minutes
const KeelApprovalTimeoutDefault = 30
// Repository - represents main docker repository fields that
// keel cares about
@ -274,8 +281,8 @@ type Approval struct {
Message string
CurrentVersion Version
NewVersion Version
CurrentVersion string
NewVersion string
// Requirements for the update such as number of votes
// and deadline
@ -305,5 +312,5 @@ func (a *Approval) Approved() bool {
// Delta of what's changed
// ie: webhookrelay/webhook-demo:0.15.0 -> webhookrelay/webhook-demo:0.16.0
func (a *Approval) Delta() string {
return fmt.Sprintf("%s -> %s", a.CurrentVersion.Original, a.NewVersion.Original)
return fmt.Sprintf("%s -> %s", a.CurrentVersion, a.NewVersion)
}