Move Policy test helpers into their own file
Since types.go should always be equal to latest API types.go, this makes future cut and paste refactors easier.
This commit is contained in:
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package api
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||
@@ -195,26 +194,6 @@ const (
|
||||
PullIfNotPresent PullPolicy = "PullIfNotPresent"
|
||||
)
|
||||
|
||||
func IsPullAlways(p PullPolicy) bool {
|
||||
// Default to pull always
|
||||
if len(p) == 0 {
|
||||
return true
|
||||
}
|
||||
return pullPoliciesEqual(p, PullAlways)
|
||||
}
|
||||
|
||||
func IsPullNever(p PullPolicy) bool {
|
||||
return pullPoliciesEqual(p, PullNever)
|
||||
}
|
||||
|
||||
func IsPullIfNotPresent(p PullPolicy) bool {
|
||||
return pullPoliciesEqual(p, PullIfNotPresent)
|
||||
}
|
||||
|
||||
func pullPoliciesEqual(p1, p2 PullPolicy) bool {
|
||||
return strings.ToLower(string(p1)) == strings.ToLower(string(p2))
|
||||
}
|
||||
|
||||
// Container represents a single container that is expected to be run on the host.
|
||||
type Container struct {
|
||||
// Required: This must be a DNS_LABEL. Each container in a pod must
|
||||
|
Reference in New Issue
Block a user