File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ type VirtualServiceSpec struct {
4545 Labels map [string ]string
4646 Annotations map [string ]string
4747 Headers * istionetworking.Headers
48+ Retries * int32
4849}
4950
5051type Destination struct {
@@ -153,6 +154,14 @@ func VirtualService(spec *VirtualServiceSpec) *istioclientnetworking.VirtualServ
153154 httpRoutes = append (httpRoutes , exactMatch , prefixMatch )
154155 }
155156
157+ if spec .Retries != nil {
158+ for i := range httpRoutes {
159+ httpRoutes [i ].Retries = & istionetworking.HTTPRetry {
160+ Attempts : * spec .Retries ,
161+ }
162+ }
163+ }
164+
156165 virtualService := & istioclientnetworking.VirtualService {
157166 TypeMeta : _virtualServiceTypeMeta ,
158167 ObjectMeta : kmeta.ObjectMeta {
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ func virtualServiceSpec(api *spec.API) *istioclientnetworking.VirtualService {
149149 },
150150 PrefixPath : api .Networking .Endpoint ,
151151 Rewrite : pointer .String ("/" ),
152+ Retries : pointer .Int32 (0 ),
152153 Annotations : api .ToK8sAnnotations (),
153154 Labels : map [string ]string {
154155 "apiName" : api .Name ,
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ func virtualServiceSpec(trafficSplitter *spec.API) *istioclientnetworking.Virtua
3232 Destinations : getTrafficSplitterDestinations (trafficSplitter ),
3333 ExactPath : trafficSplitter .Networking .Endpoint ,
3434 Rewrite : pointer .String ("/" ),
35+ Retries : pointer .Int32 (0 ),
3536 Annotations : trafficSplitter .ToK8sAnnotations (),
3637 Labels : map [string ]string {
3738 "apiName" : trafficSplitter .Name ,
You can’t perform that action at this time.
0 commit comments