// WaitUntilLokiReceivesLogs waits until the loki instance in <lokiNamespace> receives <expected> logs for <key>=<value>
WaitUntilLokiReceivesLogs waits until the loki instance in  receives  logs for =
// WaitUntilLokiReceivesLogs waits until the loki instance in <lokiNamespace > receives <expected > logs for <key > = <value >
func WaitUntilLokiReceivesLogs(ctx context.Context, interval time.Duration, f *framework.ShootFramework, tenant, lokiNamespace, key, value string, expected, delta int, client kubernetes.Interface) error {
	return retry.Until(ctx, interval, func(ctx context.Context) (done bool, err error) {
		search, err := f.GetLokiLogs(ctx, tenant, lokiNamespace, key, value, client)
		if err != nil {
			return retry.SevereError(err)
		}
		var actual int
		for _, result := range search.Data.Result {
			currentStr, ok := result.Value[1].(string)
			if !ok {
				return retry.SevereError(fmt.Errorf("Data.Result.Value[1] is not a string for %s=%s", key, value))
			}
			current, err := strconv.Atoi(currentStr)
			if err != nil {
				return retry.SevereError(fmt.Errorf("Data.Result.Value[1] string is not parsable to intiger for %s=%s", key, value))
			}
			actual += current
		}
		if expected > actual {
			f.Logger.Infof("Waiting to receive %d logs, currently received %d", expected, actual)
			return retry.MinorError(fmt.Errorf("received only %d/%d logs", actual, expected))
		} else if expected+delta < actual {
			return retry.SevereError(fmt.Errorf("expected to receive %d logs but was %d", expected, actual))
		}
		f.Logger.Infof("Received %d logs. Expected %d logs with delta %d. Expected logs received.", actual, expected, delta)
		return retry.Ok()
	})
}
func WaitUntilLokiReceivesLogs ( ctx context . Context , interval time . Duration , f * framework . ShootFramework , tenant , lokiNamespace , key , value string , expected , delta int , client kubernetes . Interface ) error { return retry . Until ( ctx , interval , func ( ctx context . Context ) ( done bool , err error ) { search , err := f . GetLokiLogs ( ctx , tenant , lokiNamespace , key , value , client ) if err != nil { return retry . SevereError ( err ) } var actual int for _ , result := range search . Data . Result { currentStr , ok := result . Value [ 1 ] . ( string ) if ! ok { return retry . SevereError ( fmt . Errorf ( " " , key , value ) ) } current , err := strconv . Atoi ( currentStr ) if err != nil { return retry . SevereError ( fmt . Errorf ( " " , key , value ) ) } actual += current } if expected > actual { f . Logger . Infof ( " " , expected , actual ) return retry . MinorError ( fmt . Errorf ( " " , actual , expected ) ) } else if expected + delta < actual { return retry . SevereError ( fmt . Errorf ( " " , expected , actual ) ) } f . Logger . Infof ( " " , actual , expected , delta ) return retry . Ok ( ) } ) }
WaitUntilLokiReceivesLogs waits until the loki instance in  receives  logs for
WaitUntilLokiReceivesLogs waits until the loki instance in receives logs for