Skip to content

Output cluster's fqdn#251

Merged
lonegunmanb merged 2 commits intoAzure:masterfrom
lonegunmanb:e-250
Sep 29, 2022
Merged

Output cluster's fqdn#251
lonegunmanb merged 2 commits intoAzure:masterfrom
lonegunmanb:e-250

Conversation

@lonegunmanb
Copy link
Copy Markdown
Member

Add new outputs: cluster_fqdn, cluster_portal_fqdn and cluster_private_fqdn

Fixes #250

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

Copy link
Copy Markdown
Contributor

@zioproto zioproto left a comment

Choose a reason for hiding this comment

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

Please check if the test passes when cluster is not a private cluster.

Comment thread outputs.tf

output "cluster_private_fqdn" {
description = "The FQDN for the Kubernetes Cluster when private link has been enabled, which is only resolvable inside the Virtual Network used by the Kubernetes Cluster."
value = azurerm_kubernetes_cluster.main.private_fqdn
Copy link
Copy Markdown
Contributor

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:

 "private_fqdn": "",

Copy link
Copy Markdown
Member Author

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_fqdn will be empty string when we set aks's private_cluster_enabled to false.

Copy link
Copy Markdown
Contributor

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 assertOutputNotEmpty to 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 assertOutputNotEmpty is not used because it will always fail. Thank you !

Copy link
Copy Markdown
Member Author

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 assertOutputNotEmpty from our e2e test, the failed test will warn us and the we can figure out what's wrong quickly by reading description.

o, ok := output[name].(string)
assert.True(t, ok)
assert.NotEqual(t, "", o)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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:

 "private_fqdn": "",

??

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@lonegunmanb did you have an opportunity to look at this comment ? thanks :)

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #253, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #249, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@zioproto
Copy link
Copy Markdown
Contributor

@lonegunmanb do you want to rebase this one on the current master ?

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #245, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #259, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #262, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Copy Markdown
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #260, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@zioproto
Copy link
Copy Markdown
Contributor

LGTM

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.

Support for output private_fqdn

2 participants