Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add fixed response config and target group ARN #1220

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading