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

Export FQDN for managed Kubernetes cluster #907

Merged
merged 2 commits into from
Mar 2, 2018

Conversation

phekmat
Copy link
Contributor

@phekmat phekmat commented Feb 28, 2018

@phekmat
Copy link
Contributor Author

phekmat commented Feb 28, 2018

I can rebase this on #904 if that makes it easier to get into 1.1.3 as well Rebased

@@ -98,11 +103,6 @@ func resourceArmKubernetesCluster() *schema.Resource {
Computed: true,
},

"fqdn": {
Copy link
Collaborator

@katbyte katbyte Feb 28, 2018

Choose a reason for hiding this comment

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

By moving this out we will break existing terraform code.

@@ -321,10 +322,6 @@ func flattenAzureRmKubernetesClusterAgentPoolProfiles(profiles *[]containerservi
agentPoolProfile["dns_prefix"] = *profile.DNSPrefix
}

if profile.Fqdn != nil {
Copy link
Collaborator

@katbyte katbyte Feb 28, 2018

Choose a reason for hiding this comment

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

Could we just set this to profile.Fqdn for now?

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'd be surprised that it would break existing code (profile.Fqdn has always been empty, so the field hasn't been useful), but I can make that change and deprecate it.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Hello @phekmat,

Thank you for this PR, I noticed this issue myself last night. I've left a couple of comments in-line but the gist is if the FQDN property is removed from agent_pool_profile it will break existing terraform. If we can just keep it for now and set it to the parent value this should be good to merge.

Thanks!

- Set the FQDN for the Kubernetes cluster
- Deprecate the FQDN on the agent_pool_profile as it's not populated by
Azure for managed Kubernetes
@phekmat
Copy link
Contributor Author

phekmat commented Mar 1, 2018

I updated the code to deprecate the FQDN in the agent_pool_profile, but overlooked your latest comment. Should I go ahead and update the code to use the parent FQDN in the agent_pool_profile.#.fqdn?

It feels counterproductive to me since the field will eventually be removed (and any current usages never worked to begin with), but I'm ok with making that change too.

@katbyte
Copy link
Collaborator

katbyte commented Mar 1, 2018

Yes please if you don't mind :)

This is so we can merge the new field in sooner and removing the old field later, likely grouping with multiple breaking changes in a larger release.

@phekmat
Copy link
Contributor Author

phekmat commented Mar 1, 2018

Updated. Thanks for the review and feedback!

@@ -260,7 +260,7 @@ func resourceArmKubernetesClusterRead(d *schema.ResourceData, meta interface{})
return fmt.Errorf("Error setting `linux_profile`: %+v", err)
}

agentPoolProfiles := flattenAzureRmKubernetesClusterAgentPoolProfiles(resp.ManagedClusterProperties.AgentPoolProfiles)
agentPoolProfiles := flattenAzureRmKubernetesClusterAgentPoolProfiles(resp.ManagedClusterProperties.AgentPoolProfiles, *resp.Fqdn)
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the unlikely situation where resp.Fqdn is null this will crash. I suggest passing in the pointer and then checking it for null like all the other values in agent_pool_profile and dereferencing it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Updated

@katbyte
Copy link
Collaborator

katbyte commented Mar 1, 2018

Other then one last minor change this LGTM, once that is done we can get this merged :)

- Temporarily use the parent FQDN as the value for the FQDN on the agent
pool profile. The latter is not populated by Azure and the field should
eventually be removed
@tombuildsstuff tombuildsstuff added this to the 1.3.0 milestone Mar 2, 2018
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @phekmat

Thanks for pushing the latest updates - I've taken a look through and this now LGTM 👍

I'll kick off the test suite now - but thanks for this!

@tombuildsstuff
Copy link
Contributor

Tests pass:

screen shot 2018-03-02 at 12 46 41

@tombuildsstuff tombuildsstuff dismissed katbyte’s stale review March 2, 2018 20:55

changes have been pushed

@tombuildsstuff tombuildsstuff merged commit 6c45ba5 into hashicorp:master Mar 2, 2018
tombuildsstuff added a commit that referenced this pull request Mar 2, 2018
@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FQDN missing from managed Kubernetes cluster
3 participants