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

chore(elbv2): add ListenerRuleHostHeaders #3473

Merged
merged 5 commits into from
Apr 19, 2022

Conversation

iamhopaul123
Copy link
Contributor

part of #2694

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.

@iamhopaul123 iamhopaul123 requested a review from a team as a code owner April 18, 2022 23:39
@iamhopaul123 iamhopaul123 requested review from dannyrandall and removed request for a team April 18, 2022 23:39
@efekarakus efekarakus added the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Apr 18, 2022
internal/pkg/aws/elbv2/elbv2.go Outdated Show resolved Hide resolved
Comment on lines +38 to +39
// ListenerRuleHostHeaders returns all the host headers for a listener rule.
func (e *ELBV2) ListenerRuleHostHeaders(ruleARN string) ([]string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to have also a path-pattern method? so that we can concatenate the two and give an output to the clients?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I was planning to continue using RulePath 🤔

Comment on lines +54 to +56
for _, value := range condition.Values {
hostHeaderSet[aws.StringValue(value)] = true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wut, what's the difference between condition.Values and condition.HostHeaderConfig.Values?
If I look at our CFN templates, we only have the latter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but the results always have both two. I check values just to be safe...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I just looked this up lol and these field names are so confusing 🤦

condition.Values allows you to specify only a single host name although the type is an array.
condition.HostHeaderConfig allows you to specify multiple host names.

So yeah, we should check both 👍 , maybe drop a comment with an explanation?

Suggested change
for _, value := range condition.Values {
hostHeaderSet[aws.StringValue(value)] = true
}
// Values is a legacy field that allowed specifying only a single host name.
// The alternative is to use HostHeaderConfig for multiple values.
// Only one of these fields should be set, but we collect from both to be safe.
for _, value := range condition.Values {
hostHeaderSet[aws.StringValue(value)] = true
}

internal/pkg/aws/elbv2/elbv2.go Outdated Show resolved Hide resolved
internal/pkg/aws/elbv2/elbv2.go Show resolved Hide resolved
Comment on lines +54 to +56
for _, value := range condition.Values {
hostHeaderSet[aws.StringValue(value)] = true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I just looked this up lol and these field names are so confusing 🤦

condition.Values allows you to specify only a single host name although the type is an array.
condition.HostHeaderConfig allows you to specify multiple host names.

So yeah, we should check both 👍 , maybe drop a comment with an explanation?

Suggested change
for _, value := range condition.Values {
hostHeaderSet[aws.StringValue(value)] = true
}
// Values is a legacy field that allowed specifying only a single host name.
// The alternative is to use HostHeaderConfig for multiple values.
// Only one of these fields should be set, but we collect from both to be safe.
for _, value := range condition.Values {
hostHeaderSet[aws.StringValue(value)] = true
}

hostHeaderSet[aws.StringValue(value)] = true
}
if condition.HostHeaderConfig == nil {
// Ideally this should never happen.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
// Ideally this should never happen.

internal/pkg/aws/elbv2/elbv2.go Outdated Show resolved Hide resolved
@iamhopaul123 iamhopaul123 removed the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Apr 19, 2022
@mergify mergify bot merged commit 664f41f into aws:mainline Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants