// pointValue places a value on the SCC based on the settings of the SCC that can be used
// to determine how restrictive it is.  The lower the number, the more restrictive it is.
328128
func pointValue(constraint *securityv1.SecurityContextConstraints) points {
	totalPoints := noPoints

	if constraint.AllowPrivilegedContainer {
		totalPoints += privilegedPoints
	}

	// add points based on volume requests
	totalPoints += volumePointValue(constraint)

	if constraint.AllowHostNetwork {
		totalPoints += hostNetworkPoints
	}
	if constraint.AllowHostPorts {
		totalPoints += hostPortsPoints
	}

	// add points based on capabilities
	totalPoints += capabilitiesPointValue(constraint)

	// the map contains points for both RunAsUser and SELinuxContext
	// strategies by taking advantage that they have identical strategy names
	strategiesPoints := map[string]points{
		string(securityv1.RunAsUserStrategyRunAsAny):         runAsAnyUserPoints,
		string(securityv1.RunAsUserStrategyMustRunAsNonRoot): runAsNonRootPoints,
		string(securityv1.RunAsUserStrategyMustRunAsRange):   runAsRangePoints,
		string(securityv1.RunAsUserStrategyMustRunAs):        runAsUserPoints,
	}

	strategyType := string(constraint.SELinuxContext.Type)
	points, found := strategiesPoints[strategyType]
	if found {
		totalPoints += points
	} else {
		klog.Warningf("SELinuxContext type %q has no point value, this may cause issues in sorting SCCs by restriction", strategyType)
	}

	strategyType = string(constraint.RunAsUser.Type)
	points, found = strategiesPoints[strategyType]
	if found {
		totalPoints += points
	} else {
		klog.Warningf("RunAsUser type %q has no point value, this may cause issues in sorting SCCs by restriction", strategyType)
	}

	return totalPoints
}
52238
func capabilitiesPointValue(scc *securityv1.SecurityContextConstraints) points {
	capsPoints := capDefaultPoints
	capsPoints += capAddOnePoints * points(len(scc.DefaultAddCapabilities))
	if hasCap(string(securityv1.AllowAllCapabilities), scc.AllowedCapabilities) {
		capsPoints += capAllowAllPoints
	} else if hasCap("ALL", scc.AllowedCapabilities) {
		capsPoints += capAllowAllPoints
	} else {
		capsPoints += capAllowOnePoints * points(len(scc.AllowedCapabilities))
	}
	if hasCap("ALL", scc.RequiredDropCapabilities) {
		capsPoints += capDropAllPoints
	} else {
		capsPoints += capDropOnePoints * points(len(scc.RequiredDropCapabilities))
	}
	if capsPoints > capMaxPoints {
		return capMaxPoints
	} else if capsPoints < capMinPoints {
		return capMinPoints
	}
	return capsPoints
}
1029012
func (s *GeoMatchConstraint) SetValue(v string) *GeoMatchConstraint {
	s.Value = &v
	return s
}
977881
func IsValue(v interface{}) bool {
	if IsScanValue(v) {
		return true
	}
	if _, ok := v.(string); ok {
		return true
	}
	return false
}
234658
func (q *Quantity) ScaledValue(scale Scale) int64 {
	if q.d.Dec == nil {
		i, _ := q.i.AsScaledInt64(scale)
		return i
	}
	dec := q.d.Dec
	return scaledValue(dec.UnscaledBig(), int(dec.Scale()), int(scale.infScale()))
}
160857
func (s *SamplingStrategy) SetValue(v float64) *SamplingStrategy {
	s.Value = &v
	return s
}
704701
func IsValue(node Expr) bool {
	switch v := node.(type) {
	case *SQLVal:
		switch v.Type {
		case StrVal, HexVal, IntVal, ValArg:
			return true
		}
	}
	return false
}
985531
func (s *PatchOperation) SetValue(v string) *PatchOperation {
	s.Value = &v
	return s
}
665390
func (o *StoreComms) ReadValue(ctx context.Context, id []byte) ([]byte, error) {
	// TODO: You might want to make this whole area pass in reusable []byte to
	// lessen gc pressure.
	keyA, keyB := murmur3.Sum128(id)
	_, v, err := o.vstore.Read(ctx, keyA, keyB, nil)
	return v, err
}
57720
func (s *MouthOpen) SetValue(v bool) *MouthOpen {
	s.Value = &v
	return s
}
617877
func (s *CodeGenNodeArg) SetValue(v string) *CodeGenNodeArg {
	s.Value = &v
	return s
}
452143
func (s *ResourceRequirement) SetValue(v string) *ResourceRequirement {
	s.Value = &v
	return s
}
10181
func (e *Edge) WeightValue() int64 {
	if e.WeightDiv == 0 {
		return e.Weight
	}
	return e.Weight / e.WeightDiv
}
1106842
func (p *Point) Value() (driver.Value, error) {
	if p.Point == nil {
		return nil, nil
	}
	return value(p.Point)
}
1225397
func (s *LoadBalancerTlsCertificateDomainValidationRecord) SetValue(v string) *LoadBalancerTlsCertificateDomainValidationRecord {
	s.Value = &v
	return s
}
963393
func (s *MessageData) SetValue(v string) *MessageData {
	s.Value = &v
	return s
}
965114
func (s *OptionSetting) SetValue(v string) *OptionSetting {
	s.Value = &v
	return s
}