mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Remove unused helper methods for PullPolicy.
This commit is contained in:
parent
3101a33d32
commit
92ff4cd2b1
@ -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))
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user