func (cs *ClientSuite) UpsertNetworkPolicy(c *C, s *envoy.XDSServer, p *cilium.NetworkPolicy) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	wg := completion.NewWaitGroup(ctx)

	callback := func(err error) {
		if err == nil {
			log.Debug("ACK Callback called")
			atomic.AddUint64(&cs.acks, 1)
		} else {
			log.Debug("NACK Callback called")
			atomic.AddUint64(&cs.nacks, 1)
		}
	}

	s.NetworkPolicyMutator.Upsert(envoy.NetworkPolicyTypeURL, p.Name, p, []string{"127.0.0.1"}, wg, callback)
}
// UpsertNetworkPolicy must only be used for testing!
UpsertNetworkPolicy must only be used for testing!
// UpsertNetworkPolicy must only be used for testing!
func (cs *ClientSuite) UpsertNetworkPolicy(c *C, s *envoy.XDSServer, p *cilium.NetworkPolicy) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	wg := completion.NewWaitGroup(ctx)
	callback := func(err error) {
		if err == nil {
			log.Debug("ACK Callback called")
			atomic.AddUint64(&cs.acks, 1)
		} else {
			log.Debug("NACK Callback called")
			atomic.AddUint64(&cs.nacks, 1)
		}
	}
	s.NetworkPolicyMutator.Upsert(envoy.NetworkPolicyTypeURL, p.Name, p, []string{"127.0.0.1"}, wg, callback)
}
func ( cs * ClientSuite ) UpsertNetworkPolicy ( c * C , s * envoy . XDSServer , p * cilium . NetworkPolicy ) { ctx , cancel := context . WithTimeout ( context . Background ( ) , 5 * time . Second ) defer cancel ( ) wg := completion . NewWaitGroup ( ctx ) callback := func ( err error ) { if err == nil { log . Debug ( " " ) atomic . AddUint64 ( & cs . acks , 1 ) } else { log . Debug ( " " ) atomic . AddUint64 ( & cs . nacks , 1 ) } } s . NetworkPolicyMutator . Upsert ( envoy . NetworkPolicyTypeURL , p . Name , p , [ ] string { " " } , wg , callback ) }
UpsertNetworkPolicy must only be used for testing!
UpsertNetworkPolicy must only be used for testing!