-
Notifications
You must be signed in to change notification settings - Fork 513
Output cluster's fqdn #251
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,9 +26,17 @@ func TestExamplesStartup(t *testing.T) { | |
| aksId, ok := output["test_aks_id"].(string) | ||
| assert.True(t, ok) | ||
| assert.Regexp(t, regexp.MustCompile("/subscriptions/.+/resourceGroups/.+/providers/Microsoft.ContainerService/managedClusters/.+"), aksId) | ||
| assertOutputNotEmpty(t, output, "test_cluster_portal_fqdn") | ||
| assertOutputNotEmpty(t, output, "test_cluster_private_fqdn") | ||
| }) | ||
| } | ||
|
|
||
| func assertOutputNotEmpty(t *testing.T, output test_helper.TerraformOutput, name string) { | ||
| o, ok := output[name].(string) | ||
| assert.True(t, ok) | ||
| assert.NotEqual(t, "", o) | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this testing passing when private cluster is not enabled and the value in the tf state is: ??
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lonegunmanb did you have an opportunity to look at this comment ? thanks :) |
||
|
|
||
| func TestExamplesWithoutMonitor(t *testing.T) { | ||
| var vars map[string]interface{} | ||
| managedIdentityId := os.Getenv("MSI_ID") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value in the terraform state is
""when not using private clusters:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @zioproto sorry for the late reply, I've tested and confirmed that this
private_fqdnwill be empty string when we set aks'sprivate_cluster_enabledtofalse.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Do you think is necessary to add a comment to the function
assertOutputNotEmptyto clarify that this function can be used only when testing with private clusters ?Let me know if it makes sense to add this comment in the code.
If in the future there will be a scenario with public clusters we want to make sure that
assertOutputNotEmptyis not used because it will always fail. Thank you !There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok since output's description has described this output only works for private cluster, if we change this example to provision a public cluster in the future and somehow we forget to remove this
assertOutputNotEmptyfrom our e2e test, the failed test will warn us and the we can figure out what's wrong quickly by reading description.