Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
ishankhare07 committed Sep 21, 2023
1 parent 3ff9e28 commit ac58d31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/controllers/resources/ingresses/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ func TestSync(t *testing.T) {
Labels: baseIngress.Labels,
Annotations: map[string]string{
"nginx.ingress.kubernetes.io/auth-secret": "my-secret",
"alb.ingress.kubernetes.io/actions.testservice": "{\"forwardConfig\":{\"targetGroups\":[{\"serviceName\":\"nginx-service\",\"servicePort\":\"80\",\"weight\":100}]}}",
"alb.ingress.kubernetes.io/actions.testservice": `{"forwardConfig":{"targetGroups":[{"serviceName":"nginx-service","servicePort":"80","weight":100}]}}`,
"alb.ingress.kubernetes.io/actions.ssl-redirect": `{"type": "redirect", "redirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}`,
},
},
Expand All @@ -391,7 +391,7 @@ func TestSync(t *testing.T) {
Namespace: baseIngress.Namespace,
Labels: baseIngress.Labels,
Annotations: map[string]string{
"alb.ingress.kubernetes.io/actions.testservice": "{\"forwardConfig\":{\"targetGroups\":[{\"serviceName\":\"nginx-service\",\"servicePort\":\"80\",\"weight\":100}]}}",
"alb.ingress.kubernetes.io/actions.testservice": `{"forwardConfig":{"targetGroups":[{"serviceName":"nginx-service","servicePort":"80","weight":100}]}}`,
"alb.ingress.kubernetes.io/actions.ssl-redirect": `{"type": "redirect", "redirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}`,
"nginx.ingress.kubernetes.io/auth-secret": "my-secret",
},
Expand All @@ -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": "{\"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"}}`,
"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"}}`,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/resources/ingresses/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ 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"`
TargetGroupARN *string `json:"targetGroupARN"`
TargetGroupARN *string `json:"targetGroupARN,omitempty"`
FixedResponseConfig map[string]interface{} `json:"fixedResponseConfig,omitempty"`
ForwardConfig struct {
TargetGroups []map[string]interface{} `json:"targetGroups,omitempty"`
Expand Down

0 comments on commit ac58d31

Please sign in to comment.