Skip to content

Commit

Permalink
add fixed response config and target group ARN
Browse files Browse the repository at this point in the history
  • Loading branch information
ishankhare07 committed Sep 21, 2023
1 parent f23fac2 commit 3ff9e28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/resources/ingresses/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ func TestSync(t *testing.T) {
"vcluster.loft.sh/object-name": baseIngress.Name,
"vcluster.loft.sh/object-namespace": baseIngress.Namespace,
translate.UIDAnnotation: "",
"alb.ingress.kubernetes.io/actions.testservice-x-test-x-suffix": "{\"forwardConfig\":{\"targetGroups\":[{\"serviceName\":\"nginx-service-x-test-x-suffix\",\"servicePort\":\"80\",\"weight\":100}]}}",
"alb.ingress.kubernetes.io/actions.ssl-redirect-x-test-x-suffix": `{"type":"redirect","forwardConfig":{},"redirectConfig":{"Port":"443","Protocol":"HTTPS","StatusCode":"HTTP_301"}}`,
"alb.ingress.kubernetes.io/actions.testservice-x-test-x-suffix": "{\"targetGroupARN\":null,\"forwardConfig\":{\"targetGroups\":[{\"serviceName\":\"nginx-service-x-test-x-suffix\",\"servicePort\":\"80\",\"weight\":100}]}}",
"alb.ingress.kubernetes.io/actions.ssl-redirect-x-test-x-suffix": `{"type":"redirect","targetGroupARN":null,"forwardConfig":{},"redirectConfig":{"Port":"443","Protocol":"HTTPS","StatusCode":"HTTP_301"}}`,
},
},
},
Expand Down
6 changes: 4 additions & 2 deletions pkg/controllers/resources/ingresses/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ func getActionOrConditionValue(annotation, actionOrCondition string) string {

// ref https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/pkg/ingress/config_types.go
type actionPayload struct {
Type string `json:"type,omitempty"`
ForwardConfig struct {
Type string `json:"type,omitempty"`
TargetGroupARN *string `json:"targetGroupARN"`
FixedResponseConfig map[string]interface{} `json:"fixedResponseConfig,omitempty"`
ForwardConfig struct {
TargetGroups []map[string]interface{} `json:"targetGroups,omitempty"`
TargetGroupStickinessConfig map[string]interface{} `json:"targetGroupStickinessConfig,omitempty"`
} `json:"forwardConfig,omitempty"`
Expand Down

0 comments on commit 3ff9e28

Please sign in to comment.