// Convert_network_EgressNetworkPolicyPeer_To_v1_EgressNetworkPolicyPeer is an autogenerated conversion function.
335528
func Convert_network_EgressNetworkPolicyPeer_To_v1_EgressNetworkPolicyPeer(in *network.EgressNetworkPolicyPeer, out *v1.EgressNetworkPolicyPeer, s conversion.Scope) error {
	return autoConvert_network_EgressNetworkPolicyPeer_To_v1_EgressNetworkPolicyPeer(in, out, s)
}
781168
func Convert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(in *networking.NetworkPolicyIngressRule, out *v1.NetworkPolicyIngressRule, s conversion.Scope) error {
	return autoConvert_networking_NetworkPolicyIngressRule_To_v1_NetworkPolicyIngressRule(in, out, s)
}
215203
func Convert_v1_EgressNetworkPolicy_To_network_EgressNetworkPolicy(in *v1.EgressNetworkPolicy, out *network.EgressNetworkPolicy, s conversion.Scope) error {
	return autoConvert_v1_EgressNetworkPolicy_To_network_EgressNetworkPolicy(in, out, s)
}
298204
func Convert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort(in *networking.NetworkPolicyPort, out *v1.NetworkPolicyPort, s conversion.Scope) error {
	return autoConvert_networking_NetworkPolicyPort_To_v1_NetworkPolicyPort(in, out, s)
}
3027
func GetPolicyLabelsv1(np *networkingv1.NetworkPolicy) labels.LabelArray {
	if np == nil {
		log.Warningf("unable to extract policy labels because provided NetworkPolicy is nil")
		return nil
	}

	policyName := np.Annotations[annotation.Name]
	policyUID := np.UID

	if policyName == "" {
		policyName = np.Name
	}

	ns := k8sUtils.ExtractNamespace(&np.ObjectMeta)

	return k8sCiliumUtils.GetPolicyLabels(ns, policyName, policyUID, resourceTypeNetworkPolicy)
}
283355
func Convert_policy_HostPortRange_To_v1beta1_HostPortRange(in *policy.HostPortRange, out *v1beta1.HostPortRange, s conversion.Scope) error {
	return autoConvert_policy_HostPortRange_To_v1beta1_HostPortRange(in, out, s)
}
1173780
func (in *NetworkPolicyPeer) DeepCopy() *NetworkPolicyPeer {
	if in == nil {
		return nil
	}
	out := new(NetworkPolicyPeer)
	in.DeepCopyInto(out)
	return out
}
765066
func Convert_v1_EgressNetworkPolicyRule_To_network_EgressNetworkPolicyRule(in *v1.EgressNetworkPolicyRule, out *network.EgressNetworkPolicyRule, s conversion.Scope) error {
	return autoConvert_v1_EgressNetworkPolicyRule_To_network_EgressNetworkPolicyRule(in, out, s)
}
689958
func (in *EgressNetworkPolicy) DeepCopy() *EgressNetworkPolicy {
	if in == nil {
		return nil
	}
	out := new(EgressNetworkPolicy)
	in.DeepCopyInto(out)
	return out
}
1071117
func (in *EgressNetworkPolicyPeer) DeepCopy() *EgressNetworkPolicyPeer {
	if in == nil {
		return nil
	}
	out := new(EgressNetworkPolicyPeer)
	in.DeepCopyInto(out)
	return out
}
432344
func ValidateEgressNetworkPolicy(policy *networkapi.EgressNetworkPolicy) field.ErrorList {
	allErrs := validation.ValidateObjectMeta(&policy.ObjectMeta, true, path.ValidatePathSegmentName, field.NewPath("metadata"))

	for i, rule := range policy.Spec.Egress {
		if rule.Type != networkapi.EgressNetworkPolicyRuleAllow && rule.Type != networkapi.EgressNetworkPolicyRuleDeny {
			allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("egress").Index(i).Child("type"), rule.Type, "invalid policy type"))
		}

		if len(rule.To.CIDRSelector) == 0 && len(rule.To.DNSName) == 0 {
			allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("egress").Index(i).Child("to"), rule.To, "must specify cidrSelector or dnsName"))
		} else if len(rule.To.CIDRSelector) != 0 && len(rule.To.DNSName) != 0 {
			allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("egress").Index(i).Child("to"), rule.To, "either specify cidrSelector or dnsName but not both"))
		}

		if len(rule.To.CIDRSelector) > 0 {
			if _, err := netutils.ParseCIDRMask(rule.To.CIDRSelector); err != nil {
				allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("egress").Index(i).Child("to", "cidrSelector"), rule.To.CIDRSelector, err.Error()))
			}
		}

		if len(rule.To.DNSName) > 0 {
			if len(utilvalidation.IsDNS1123Subdomain(rule.To.DNSName)) != 0 {
				allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("egress").Index(i).Child("to", "dnsName"), rule.To.DNSName, "must conform to DNS 952 subdomain conventions"))
			}
		}
	}

	if len(policy.Spec.Egress) > networkapi.EgressNetworkPolicyMaxRules {
		allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("egress"), "", ("too many egress rules (max 50)")))
	}

	return allErrs
}
177797
func Convert_policy_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList(in *policy.PodSecurityPolicyList, out *v1beta1.PodSecurityPolicyList, s conversion.Scope) error {
	return autoConvert_policy_PodSecurityPolicyList_To_v1beta1_PodSecurityPolicyList(in, out, s)
}
524813
func Convert_build_BuildTriggerPolicy_To_v1_BuildTriggerPolicy(in *build.BuildTriggerPolicy, out *v1.BuildTriggerPolicy, s conversion.Scope) error {
	return autoConvert_build_BuildTriggerPolicy_To_v1_BuildTriggerPolicy(in, out, s)
}
181248
func NewNetworkControlChangePolicyType(Description string) *NetworkControlChangePolicyType {
	s := new(NetworkControlChangePolicyType)
	s.Description = Description
	return s
}
341697
func Convert_network_ClusterNetworkList_To_v1_ClusterNetworkList(in *network.ClusterNetworkList, out *v1.ClusterNetworkList, s conversion.Scope) error {
	return autoConvert_network_ClusterNetworkList_To_v1_ClusterNetworkList(in, out, s)
}
963474
func (s *DescribePoliciesInput) SetPolicyTypes(v []*string) *DescribePoliciesInput {
	s.PolicyTypes = v
	return s
}
755370
func Convert_policy_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(in *policy.RunAsUserStrategyOptions, out *v1beta1.RunAsUserStrategyOptions, s conversion.Scope) error {
	return autoConvert_policy_RunAsUserStrategyOptions_To_v1beta1_RunAsUserStrategyOptions(in, out, s)
}