// CheckIngressRulesExist checks the ingress rules are exist in current ingress
CheckIngressRulesExist checks the ingress rules are exist in current ingress
// CheckIngressRulesExist checks the ingress rules are exist in current ingress
func CheckIngressRulesExist(config *EIConfigNew, currentIngress *networking.Ingress) ([]networking.IngressRule, bool) {
	var integration = config.integration
	ingressPaths := GenerateIngressPaths(&integration)
	currentRules := currentIngress.Spec.Rules
	newRule := networking.IngressRule{
		Host: config.ingressConfigMap.Data[ingressHostNameKey],
		IngressRuleValue: networking.IngressRuleValue{
			HTTP: &networking.HTTPIngressRuleValue{
				Paths: ingressPaths,
			},
		},
	}
	ruleExists := false
	for _, rule := range currentRules {
		if reflect.DeepEqual(rule, newRule) {
			ruleExists = true
		}
	}
	if !ruleExists {
		currentRules = append(currentRules, newRule)
	}
	return currentRules, ruleExists
}
func CheckIngressRulesExist ( config * EIConfigNew , currentIngress * networking . Ingress ) ( [ ] networking . IngressRule , bool ) { var integration = config . integration ingressPaths := GenerateIngressPaths ( & integration ) currentRules := currentIngress . Spec . Rules newRule := networking . IngressRule { Host : config . ingressConfigMap . Data [ ingressHostNameKey ] , IngressRuleValue : networking . IngressRuleValue { HTTP : & networking . HTTPIngressRuleValue { Paths : ingressPaths , } , } , } ruleExists := false for _ , rule := range currentRules { if reflect . DeepEqual ( rule , newRule ) { ruleExists = true } } if ! ruleExists { currentRules = append ( currentRules , newRule ) } return currentRules , ruleExists }
CheckIngressRulesExist checks the ingress rules are exist in current ingress
CheckIngressRulesExist checks the ingress rules are exist in current ingress
// check the rules are exists in the ingress, if not add the rules // checking because of reconsile is looping