Remove unused helper methods for PullPolicy.

This commit is contained in:
Dawn Chen 2015-01-16 17:05:13 -08:00
parent 3101a33d32
commit 92ff4cd2b1
2 changed files with 0 additions and 26 deletions

View File

@ -18,7 +18,6 @@ package api
import (
"reflect"
"strings"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/resource"
"github.com/GoogleCloudPlatform/kubernetes/pkg/conversion"
@ -60,27 +59,4 @@ var Semantic = conversion.EqualitiesOrDie(
}
return a.Amount.Cmp(b.Amount) == 0
},
pullPoliciesEqual,
)
// TODO: Address these per #1502
func IsPullAlways(p PullPolicy) bool {
return pullPoliciesEqual(p, PullAlways)
}
func IsPullNever(p PullPolicy) bool {
return pullPoliciesEqual(p, PullNever)
}
func IsPullIfNotPresent(p PullPolicy) bool {
// Default to pull if not present
if len(p) == 0 {
return true
}
return pullPoliciesEqual(p, PullIfNotPresent)
}
func pullPoliciesEqual(p1, p2 PullPolicy) bool {
return strings.ToLower(string(p1)) == strings.ToLower(string(p2))
}

View File

@ -59,8 +59,6 @@ func TestSemantic(t *testing.T) {
true,
},
{resource.MustParse("2m"), resource.MustParse("1m"), false},
{PullPolicy("NEVER"), PullPolicy("neveR"), true},
{PullPolicy("NEVER"), PullPolicy("neveRi"), false},
}
for index, item := range table {