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

Fixes to test suite #1113

Merged
merged 4 commits into from
Jun 23, 2022
Merged

Fixes to test suite #1113

merged 4 commits into from
Jun 23, 2022

Conversation

severinson
Copy link
Contributor

No description provided.

tokens := strings.Split(host, ".")
if len(tokens) == 0 {
return errors.Errorf("malformed hostname: %s", host)
ingressUrl := os.Getenv("ARMADA_EXECUTOR_INGRESS_URL")
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like you are missing the case of a bad hostname from host parameter.

Is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

The original code parsed the host function parameter and returned an error if it couldn't get any tokens.

You are reading from an environment variable but if someone didn't specify it, you assume that the host function parameter is valid without any tokens.

You also don't check if the environment variable is a valid url spec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's fine.
If the host name isn't set correctly, the test will fail, which is the correct behaviour.
If the env variable is set incorrectly, the test will also fail, which I think is fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Kk. I didn't see that this was in test suite. Yea I think that's fine.

@severinson severinson changed the title Fix ingress URL Fixes to test suite Jun 23, 2022
@severinson severinson enabled auto-merge (squash) June 23, 2022 15:22
@severinson severinson merged commit 0168f15 into master Jun 23, 2022
@severinson severinson deleted the severinson-patch-1 branch June 23, 2022 15:24
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.

None yet

3 participants