forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
helpers.go
28 lines (25 loc) · 824 Bytes
/
helpers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package api
// RequestsResolution returns true if you should attempt to resolve image pull specs
func RequestsResolution(imageResolutionType ImageResolutionType) bool {
switch imageResolutionType {
case RequiredRewrite, Required, AttemptRewrite, Attempt:
return true
}
return false
}
// FailOnResolutionFailure returns true if you should fail when resolution fails
func FailOnResolutionFailure(imageResolutionType ImageResolutionType) bool {
switch imageResolutionType {
case RequiredRewrite, Required:
return true
}
return false
}
// RewriteImagePullSpec returns true if you should rewrite image pull specs when resolution succeeds
func RewriteImagePullSpec(imageResolutionType ImageResolutionType) bool {
switch imageResolutionType {
case RequiredRewrite, AttemptRewrite:
return true
}
return false
}