mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Remove unused helper methods for PullPolicy.
This commit is contained in:
		@@ -18,7 +18,6 @@ package api
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"reflect"
 | 
						"reflect"
 | 
				
			||||||
	"strings"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/api/resource"
 | 
						"github.com/GoogleCloudPlatform/kubernetes/pkg/api/resource"
 | 
				
			||||||
	"github.com/GoogleCloudPlatform/kubernetes/pkg/conversion"
 | 
						"github.com/GoogleCloudPlatform/kubernetes/pkg/conversion"
 | 
				
			||||||
@@ -60,27 +59,4 @@ var Semantic = conversion.EqualitiesOrDie(
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		return a.Amount.Cmp(b.Amount) == 0
 | 
							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,
 | 
								true,
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		{resource.MustParse("2m"), resource.MustParse("1m"), false},
 | 
							{resource.MustParse("2m"), resource.MustParse("1m"), false},
 | 
				
			||||||
		{PullPolicy("NEVER"), PullPolicy("neveR"), true},
 | 
					 | 
				
			||||||
		{PullPolicy("NEVER"), PullPolicy("neveRi"), false},
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for index, item := range table {
 | 
						for index, item := range table {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user