// Retry mechanism when requesting the Operator API
Retry mechanism when requesting the Operator API
// Retry mechanism when requesting the Operator API
func requestControlPlane(url string) ([]byte, error) {
	req := fasthttp.AcquireRequest()
	req.SetRequestURI(url)
	req.Header.SetContentType("application/json")
	resp := fasthttp.AcquireResponse()
	client := &fasthttp.Client{
		ReadTimeout: time.Second * 10,
	}
	err := client.Do(req, resp)
	if err != nil {
		log.Info("Retrying getting components")
		return nil, err
	}
	body := resp.Body()
	return body, nil
}
func requestControlPlane ( url string ) ( [ ] byte , error ) { req := fasthttp . AcquireRequest ( ) req . SetRequestURI ( url ) req . Header . SetContentType ( " " ) resp := fasthttp . AcquireResponse ( ) client := & fasthttp . Client { ReadTimeout : time . Second * 10 , } err := client . Do ( req , resp ) if err != nil { log . Info ( " " ) return nil , err } body := resp . Body ( ) return body , nil }
Retry mechanism when requesting the Operator API
Retry mechanism when requesting the Operator API
// Request failed, try again