Skip to content

Commit

Permalink
fix: return overrides and default node pool on gcp k8s (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalo-rodrigues authored Jul 6, 2022
1 parent 7a1a1f5 commit 5a2091e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions resources/types/aws/kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func (r AwsKubernetesCluster) FromState(state *output.TfState) (*resourcespb.Kub
Name: r.Args.Name,
ServiceCidr: r.Args.ServiceCidr,
VirtualNetworkId: r.Args.VirtualNetworkId,
GcpOverride: r.Args.GcpOverride,
}
result.Endpoint = "dryrun"
if !flags.DryRun {
Expand Down
1 change: 1 addition & 0 deletions resources/types/azure/kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func (r AzureKubernetesCluster) FromState(state *output.TfState) (*resourcespb.K
Name: r.Args.Name,
ServiceCidr: r.Args.ServiceCidr,
VirtualNetworkId: r.Args.VirtualNetworkId,
GcpOverride: r.Args.GcpOverride,
}
result.Endpoint = "dryrun"
if !flags.DryRun {
Expand Down
7 changes: 7 additions & 0 deletions resources/types/gcp/kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (r GcpKubernetesCluster) FromState(state *output.TfState) (*resourcespb.Kub
Name: r.Args.Name,
ServiceCidr: r.Args.ServiceCidr,
VirtualNetworkId: r.Args.VirtualNetworkId,
GcpOverride: r.Args.GcpOverride,
}
result.Endpoint = "dryrun"
if !flags.DryRun {
Expand All @@ -55,6 +56,12 @@ func (r GcpKubernetesCluster) FromState(state *output.TfState) (*resourcespb.Kub
result.KubeConfigRaw = rawConfig
}

var err error
result.DefaultNodePool, err = GcpKubernetesNodePool{r.DefaultNodePool}.FromState(state)
if err != nil {
return nil, err
}

return result, nil
}

Expand Down
5 changes: 3 additions & 2 deletions resources/types/gcp/kubernetes_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ func (r GcpKubernetesNodePool) FromState(state *output.TfState) (*resourcespb.Ku
MaxNodeCount: r.Args.MaxNodeCount,
VmSize: r.Args.VmSize,
DiskSizeGb: r.Args.DiskSizeGb,
Labels: r.Args.Labels,
AzureOverride: r.Args.AzureOverride,
AvailabilityZone: r.Args.AvailabilityZone,
AwsOverride: r.Args.AwsOverride,
AzureOverride: r.Args.AzureOverride,
Labels: r.Args.Labels,
}, nil
}

Expand Down

0 comments on commit 5a2091e

Please sign in to comment.