diff --git a/contrib/mesos/pkg/scheduler/resource/resource.go b/contrib/mesos/pkg/scheduler/resource/resource.go index f2521d730e3..7d3b8b9068e 100644 --- a/contrib/mesos/pkg/scheduler/resource/resource.go +++ b/contrib/mesos/pkg/scheduler/resource/resource.go @@ -42,8 +42,8 @@ func PodMemLimit(pod *api.Pod) MegaBytes { } // limitPodResource sets the given default resource limit for each container that -// does not limit the given resource yet. limitPodResource returns true iff at least one -// container had no limit for that resource. +// does not limit the given resource yet. limitPodResource returns true if and only if +// at least one container had no limit for that resource. func limitPodResource(pod *api.Pod, resourceName api.ResourceName, defaultLimit resource.Quantity) bool { unlimited := false for j := range pod.Spec.Containers { @@ -79,16 +79,16 @@ func unlimitedCountainerNum(pod *api.Pod, resourceName api.ResourceName) int { } // limitPodCPU sets DefaultContainerCPUs for the CPU limit of each container that -// does not limit its CPU resource yet. limitPodCPU returns true iff at least one -// container had no CPU limit set. +// does not limit its CPU resource yet. limitPodCPU returns true if and only if +// at least one container had no CPU limit set. func LimitPodCPU(pod *api.Pod, defaultLimit CPUShares) bool { defaultCPUQuantity := resource.NewMilliQuantity(int64(float64(defaultLimit)*1000.0), resource.DecimalSI) return limitPodResource(pod, api.ResourceCPU, *defaultCPUQuantity) } // limitPodMem sets DefaultContainerMem for the memory limit of each container that -// does not limit its memory resource yet. limitPodMem returns true iff at least one -// container had no memory limit set. +// does not limit its memory resource yet. limitPodMem returns true if and only if +// at least one container had no memory limit set. func LimitPodMem(pod *api.Pod, defaultLimit MegaBytes) bool { defaultMemQuantity := resource.NewQuantity(int64(float64(defaultLimit)*1024.0*1024.0), resource.BinarySI) return limitPodResource(pod, api.ResourceMemory, *defaultMemQuantity) diff --git a/hack/update-generated-swagger-docs.sh b/hack/update-generated-swagger-docs.sh index 27af1397e9c..f3742db4e01 100755 --- a/hack/update-generated-swagger-docs.sh +++ b/hack/update-generated-swagger-docs.sh @@ -37,8 +37,8 @@ function generate_version() { // generate Swagger API documentation for its models. Please read this PR for more // information on the implementation: https://github.com/emicklei/go-restful/pull/215 // -// TODOs are ignored from the parser. (e.g. TODO(andronat):... || TODO:...) iff -// are on one line! For multiple line or blocks that you want to ignore use ---. +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. // Any context after a --- is ignored. // // Those methods can be generated by using hack/update-generated-swagger-docs.sh diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index 0acc87d3346..c6ca756d5f2 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -27,8 +27,8 @@ import ( // generate Swagger API documentation for its models. Please read this PR for more // information on the implementation: https://github.com/emicklei/go-restful/pull/215 // -// TODOs are ignored from the parser. (e.g. TODO(andronat):... || TODO:...) iff -// are on one line! For multiple line or blocks that you want to ignore use ---. +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. // Any context after a --- is ignored and not exported to the SwaggerAPI. // // The aforementioned methods can be generated by hack/update-generated-swagger-docs.sh diff --git a/pkg/api/v1/types_swagger_doc_generated.go b/pkg/api/v1/types_swagger_doc_generated.go index d56456dad2f..11872643d8e 100644 --- a/pkg/api/v1/types_swagger_doc_generated.go +++ b/pkg/api/v1/types_swagger_doc_generated.go @@ -20,8 +20,8 @@ package v1 // generate Swagger API documentation for its models. Please read this PR for more // information on the implementation: https://github.com/emicklei/go-restful/pull/215 // -// TODOs are ignored from the parser. (e.g. TODO(andronat):... || TODO:...) iff -// are on one line! For multiple line or blocks that you want to ignore use ---. +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. // Any context after a --- is ignored. // // Those methods can be generated by using hack/update-generated-swagger-docs.sh diff --git a/pkg/apis/experimental/v1/types_swagger_doc_generated.go b/pkg/apis/experimental/v1/types_swagger_doc_generated.go index e43c3244ba3..dd1587e2c7e 100644 --- a/pkg/apis/experimental/v1/types_swagger_doc_generated.go +++ b/pkg/apis/experimental/v1/types_swagger_doc_generated.go @@ -20,8 +20,8 @@ package v1 // generate Swagger API documentation for its models. Please read this PR for more // information on the implementation: https://github.com/emicklei/go-restful/pull/215 // -// TODOs are ignored from the parser. (e.g. TODO(andronat):... || TODO:...) iff -// are on one line! For multiple line or blocks that you want to ignore use ---. +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. // Any context after a --- is ignored. // // Those methods can be generated by using hack/update-generated-swagger-docs.sh diff --git a/pkg/client/cache/expiration_cache.go b/pkg/client/cache/expiration_cache.go index e6d67c14274..cea3c7b5cdd 100644 --- a/pkg/client/cache/expiration_cache.go +++ b/pkg/client/cache/expiration_cache.go @@ -73,7 +73,7 @@ func (c *ExpirationCache) getTimestampedEntry(key string) (*timestampedEntry, bo return nil, false } -// getOrExpire retrieves the object from the timestampedEntry iff it hasn't +// getOrExpire retrieves the object from the timestampedEntry if and only if it hasn't // already expired. It kicks-off a go routine to delete expired objects from // the store and sets exists=false. func (c *ExpirationCache) getOrExpire(key string) (interface{}, bool) { diff --git a/pkg/client/cache/listers.go b/pkg/client/cache/listers.go index 0bb917f69a1..20fd4315215 100644 --- a/pkg/client/cache/listers.go +++ b/pkg/client/cache/listers.go @@ -249,7 +249,8 @@ func (s *StoreToDaemonSetLister) List() (dss []experimental.DaemonSet, err error return dss, nil } -// GetPodDaemonSets returns a list of daemon sets managing a pod. Returns an error iff no matching daemon sets are found. +// GetPodDaemonSets returns a list of daemon sets managing a pod. +// Returns an error if and only if no matching daemon sets are found. func (s *StoreToDaemonSetLister) GetPodDaemonSets(pod *api.Pod) (daemonSets []experimental.DaemonSet, err error) { var selector labels.Selector var daemonSet experimental.DaemonSet diff --git a/pkg/client/unversioned/conditions.go b/pkg/client/unversioned/conditions.go index e26067cda75..c6901a37cb4 100644 --- a/pkg/client/unversioned/conditions.go +++ b/pkg/client/unversioned/conditions.go @@ -21,8 +21,8 @@ import ( "k8s.io/kubernetes/pkg/util/wait" ) -// ControllerHasDesiredReplicas returns a condition that will be true iff the desired replica count -// for a controller's ReplicaSelector equals the Replicas count. +// ControllerHasDesiredReplicas returns a condition that will be true if and only if +// the desired replica count for a controller's ReplicaSelector equals the Replicas count. func ControllerHasDesiredReplicas(c Interface, controller *api.ReplicationController) wait.ConditionFunc { // If we're given a controller where the status lags the spec, it either means that the controller is stale, diff --git a/pkg/client/unversioned/helper.go b/pkg/client/unversioned/helper.go index c762abbc6fe..a4d114787b6 100644 --- a/pkg/client/unversioned/helper.go +++ b/pkg/client/unversioned/helper.go @@ -508,7 +508,7 @@ func DefaultServerURL(host, prefix, version string, defaultTLS bool) (*url.URL, return hostURL, nil } -// IsConfigTransportTLS returns true iff the provided config will result in a protected +// IsConfigTransportTLS returns true if and only if the provided config will result in a protected // connection to the server when it is passed to client.New() or client.RESTClientFor(). // Use to determine when to send credentials over the wire. // diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go index f5376e9abc0..268bef4b4bf 100644 --- a/pkg/cloudprovider/providers/aws/aws.go +++ b/pkg/cloudprovider/providers/aws/aws.go @@ -1413,7 +1413,7 @@ func isEqualIPPermission(l, r *ec2.IPPermission, compareGroupUserIDs bool) bool } // Makes sure the security group includes the specified permissions -// Returns true iff changes were made +// Returns true if and only if changes were made // The security group must already exist func (s *AWSCloud) ensureSecurityGroupIngress(securityGroupId string, addPermissions []*ec2.IPPermission) (bool, error) { group, err := s.findSecurityGroup(securityGroupId) @@ -1467,7 +1467,7 @@ func (s *AWSCloud) ensureSecurityGroupIngress(securityGroupId string, addPermiss } // Makes sure the security group no longer includes the specified permissions -// Returns true iff changes were made +// Returns true if and only if changes were made // If the security group no longer exists, will return (false, nil) func (s *AWSCloud) removeSecurityGroupIngress(securityGroupId string, removePermissions []*ec2.IPPermission) (bool, error) { group, err := s.findSecurityGroup(securityGroupId) diff --git a/pkg/conversion/scheme.go b/pkg/conversion/scheme.go index e534345a1ae..1906178a9dc 100644 --- a/pkg/conversion/scheme.go +++ b/pkg/conversion/scheme.go @@ -44,7 +44,8 @@ type Scheme struct { // deep copy behavior. cloner *Cloner - // Indent will cause the JSON output from Encode to be indented, iff it is true. + // Indent will cause the JSON output from Encode to be indented, + // if and only if it is true. Indent bool // InternalVersion is the default internal version. It is recommended that diff --git a/pkg/kubelet/config/file.go b/pkg/kubelet/config/file.go index 354f158a154..ba86a397ee4 100644 --- a/pkg/kubelet/config/file.go +++ b/pkg/kubelet/config/file.go @@ -92,8 +92,8 @@ func (s *sourceFile) extractFromPath() error { return nil } -// Get as many pod configs as we can from a directory. Return an error iff something -// prevented us from reading anything at all. Do not return an error if only some files +// Get as many pod configs as we can from a directory. Return an error if and only if something +// prevented us from reading anything at all. Do not return an error if only some files // were problematic. func (s *sourceFile) extractFromDir(name string) ([]*api.Pod, error) { dirents, err := filepath.Glob(filepath.Join(name, "[^.]*")) diff --git a/pkg/kubelet/dockertools/manager.go b/pkg/kubelet/dockertools/manager.go index e59a2474f87..93108bf1eec 100644 --- a/pkg/kubelet/dockertools/manager.go +++ b/pkg/kubelet/dockertools/manager.go @@ -1532,7 +1532,7 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubeletTypes.Doc // Structure keeping information on changes that need to happen for a pod. The semantics is as follows: // - startInfraContainer is true if new Infra Containers have to be started and old one (if running) killed. // Additionally if it is true then containersToKeep have to be empty -// - infraContainerId have to be set iff startInfraContainer is false. It stores dockerID of running Infra Container +// - infraContainerId have to be set if and only if startInfraContainer is false. It stores dockerID of running Infra Container // - containersToStart keeps indices of Specs of containers that have to be started. // - containersToKeep stores mapping from dockerIDs of running containers to indices of their Specs for containers that // should be kept running. If startInfraContainer is false then it contains an entry for infraContainerId (mapped to -1). diff --git a/pkg/registry/generic/matcher.go b/pkg/registry/generic/matcher.go index b3870747b33..9aa85615c40 100644 --- a/pkg/registry/generic/matcher.go +++ b/pkg/registry/generic/matcher.go @@ -47,7 +47,7 @@ func (s *SelectionPredicate) Matches(obj runtime.Object) (bool, error) { return s.Label.Matches(labels) && s.Field.Matches(fields), nil } -// MatchesSingle will return (name, true) iff s.Field matches on the object's +// MatchesSingle will return (name, true) if and only if s.Field matches on the object's // name. func (s *SelectionPredicate) MatchesSingle() (string, bool) { // TODO: should be namespace.name diff --git a/pkg/registry/pod/etcd/etcd.go b/pkg/registry/pod/etcd/etcd.go index 64df4bf2d8e..11795255d7d 100644 --- a/pkg/registry/pod/etcd/etcd.go +++ b/pkg/registry/pod/etcd/etcd.go @@ -150,8 +150,8 @@ func (r *BindingREST) Create(ctx api.Context, obj runtime.Object) (out runtime.O return } -// setPodHostAndAnnotations sets the given pod's host to 'machine' iff it was previously 'oldMachine' and merges -// the provided annotations with those of the pod. +// setPodHostAndAnnotations sets the given pod's host to 'machine' if and only if it was +// previously 'oldMachine' and merges the provided annotations with those of the pod. // Returns the current state of the pod, or an error. func (r *BindingREST) setPodHostAndAnnotations(ctx api.Context, podID, oldMachine, machine string, annotations map[string]string) (finalPod *api.Pod, err error) { podKey, err := r.store.KeyFunc(ctx, podID) diff --git a/pkg/storage/etcd/etcd_util.go b/pkg/storage/etcd/etcd_util.go index 2f20b2f97fa..dedf1e36b33 100644 --- a/pkg/storage/etcd/etcd_util.go +++ b/pkg/storage/etcd/etcd_util.go @@ -29,27 +29,27 @@ import ( "github.com/golang/glog" ) -// IsEtcdNotFound returns true iff err is an etcd not found error. +// IsEtcdNotFound returns true if and only if err is an etcd not found error. func IsEtcdNotFound(err error) bool { return isEtcdErrorNum(err, tools.EtcdErrorCodeNotFound) } -// IsEtcdNodeExist returns true iff err is an etcd node already exist error. +// IsEtcdNodeExist returns true if and only if err is an etcd node already exist error. func IsEtcdNodeExist(err error) bool { return isEtcdErrorNum(err, tools.EtcdErrorCodeNodeExist) } -// IsEtcdTestFailed returns true iff err is an etcd write conflict. +// IsEtcdTestFailed returns true if and only if err is an etcd write conflict. func IsEtcdTestFailed(err error) bool { return isEtcdErrorNum(err, tools.EtcdErrorCodeTestFailed) } -// IsEtcdWatchStoppedByUser returns true iff err is a client triggered stop. +// IsEtcdWatchStoppedByUser returns true if and only if err is a client triggered stop. func IsEtcdWatchStoppedByUser(err error) bool { return goetcd.ErrWatchStoppedByUser == err } -// isEtcdErrorNum returns true iff err is an etcd error, whose errorCode matches errorCode +// isEtcdErrorNum returns true if and only if err is an etcd error, whose errorCode matches errorCode func isEtcdErrorNum(err error, errorCode int) bool { etcdError, ok := err.(*goetcd.EtcdError) return ok && etcdError != nil && etcdError.ErrorCode == errorCode diff --git a/pkg/storage/interfaces.go b/pkg/storage/interfaces.go index 3ba685ab57e..1b4440f34f1 100644 --- a/pkg/storage/interfaces.go +++ b/pkg/storage/interfaces.go @@ -55,7 +55,7 @@ type ResponseMeta struct { } // FilterFunc is a predicate which takes an API object and returns true -// iff the object should remain in the set. +// if and only if the object should remain in the set. type FilterFunc func(obj runtime.Object) bool // Everything is a FilterFunc which accepts all objects. diff --git a/pkg/util/atomic_value.go b/pkg/util/atomic_value.go index 718b712787e..546e19d713f 100644 --- a/pkg/util/atomic_value.go +++ b/pkg/util/atomic_value.go @@ -46,7 +46,7 @@ func (at *AtomicValue) Load() interface{} { // for some quantity. type HighWaterMark int64 -// Check returns true iff 'current' is the highest value ever seen. +// Check returns true if and only if 'current' is the highest value ever seen. func (hwm *HighWaterMark) Check(current int64) bool { for { old := atomic.LoadInt64((*int64)(hwm)) diff --git a/pkg/util/sets/set.go b/pkg/util/sets/set.go index a0b8900b361..910b254de19 100644 --- a/pkg/util/sets/set.go +++ b/pkg/util/sets/set.go @@ -61,13 +61,13 @@ func (s String) Delete(items ...string) { } } -// Has returns true iff item is contained in the set. +// Has returns true if and only if item is contained in the set. func (s String) Has(item string) bool { _, contained := s[item] return contained } -// HasAll returns true iff all items are contained in the set. +// HasAll returns true if and only if all items are contained in the set. func (s String) HasAll(items ...string) bool { for _, item := range items { if !s.Has(item) { @@ -121,7 +121,7 @@ func (s1 String) Union(s2 String) String { return result } -// IsSuperset returns true iff s1 is a superset of s2. +// IsSuperset returns true if and only if s1 is a superset of s2. func (s1 String) IsSuperset(s2 String) bool { for item := range s2 { if !s1.Has(item) { @@ -131,7 +131,7 @@ func (s1 String) IsSuperset(s2 String) bool { return true } -// Equal returns true iff s1 is equal (as a set) to s2. +// Equal returns true if and only if s1 is equal (as a set) to s2. // Two sets are equal if their membership is identical. // (In practice, this means same elements, order doesn't matter) func (s1 String) Equal(s2 String) bool { diff --git a/plugin/pkg/scheduler/scheduler.go b/plugin/pkg/scheduler/scheduler.go index 26d6be414df..09511c2201f 100644 --- a/plugin/pkg/scheduler/scheduler.go +++ b/plugin/pkg/scheduler/scheduler.go @@ -56,7 +56,7 @@ type SystemModeler interface { ForgetPodByKey(key string) // For serializing calls to Assume/ForgetPod: imagine you want to add - // a pod iff a bind succeeds, but also remove a pod if it is deleted. + // a pod if and only if a bind succeeds, but also remove a pod if it is deleted. // TODO: if SystemModeler begins modeling things other than pods, this // should probably be parameterized or specialized for pods. LockedAction(f func()) @@ -137,8 +137,8 @@ func (s *Scheduler) scheduleOne() { }, } - // We want to add the pod to the model iff the bind succeeds, but we don't want to race - // with any deletions, which happen asynchronously. + // We want to add the pod to the model if and only if the bind succeeds, + // but we don't want to race with any deletions, which happen asynchronously. s.config.Modeler.LockedAction(func() { bindingStart := time.Now() err := s.config.Binder.Bind(b)