Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

E2E: eliminate possible nil dereference #22

Merged
merged 2 commits into from
Nov 16, 2018

Conversation

jackfrancis
Copy link
Member

What this PR does / why we need it: once I got rid of the nil dereference I got the actual error!

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

If applicable:

  • documentation
  • unit tests
  • tested backward compatibility (ie. deploy with previous version, upgrade with this branch)

Release note:

E2E: eliminate possible nil dereference

once I got rid of the nil dereference I got the actual error!
cs.ContainerService.Properties.LinuxProfile.SSH.PublicKeys[0].KeyData = config.PublicSSHKey
if cs.ContainerService.Properties.OrchestratorProfile.KubernetesConfig != nil && cs.ContainerService.Properties.OrchestratorProfile.KubernetesConfig.PrivateCluster != nil && cs.ContainerService.Properties.OrchestratorProfile.KubernetesConfig.PrivateCluster.JumpboxProfile != nil {
cs.ContainerService.Properties.OrchestratorProfile.KubernetesConfig.PrivateCluster.JumpboxProfile.PublicKey = config.PublicSSHKey
if cs.ContainerService.Properties.LinuxProfile != nil {
Copy link
Contributor

@tariq1890 tariq1890 Nov 15, 2018

Choose a reason for hiding this comment

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

can we assign cs.ContainerService.Properties to a variable?

Suggested change
if cs.ContainerService.Properties.LinuxProfile != nil {
props := cs.ContainerService.Properties
if props.LinuxProfile != nil {

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

/lgtm

@acs-bot acs-bot added the lgtm label Nov 16, 2018
@jackfrancis jackfrancis merged commit 6a1fec2 into Azure:master Nov 16, 2018
@jackfrancis jackfrancis deleted the e2e-nil-dereference branch November 16, 2018 00:35
@acs-bot
Copy link

acs-bot commented Nov 16, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon, jackfrancis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CecileRobertMichon,jackfrancis]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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.

4 participants