Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalo-rodrigues committed Jul 13, 2022
1 parent 7e9468c commit 65ea15d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions resources/types/aws/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (r AwsDatabase) FromState(state *output.TfState) (*resourcespb.DatabaseReso
SubnetId: r.Args.SubnetId,
Host: host,
ConnectionUsername: r.Args.Username,
GcpOverride: r.Args.GcpOverride,
}, nil
}

Expand Down
1 change: 1 addition & 0 deletions resources/types/azure/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (r AzureDatabase) FromState(state *output.TfState) (*resourcespb.DatabaseRe
SubnetId: r.Args.SubnetId,
Host: host,
ConnectionUsername: fmt.Sprintf("%s@%s", r.Args.Username, host),
GcpOverride: r.Args.GcpOverride,
}, nil
}

Expand Down
1 change: 1 addition & 0 deletions resources/types/gcp/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (r GcpDatabase) FromState(state *output.TfState) (*resourcespb.DatabaseReso
SubnetId: r.Args.SubnetId,
Host: host,
ConnectionUsername: r.Args.Username,
GcpOverride: r.Args.GcpOverride,
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion resources/types/gcp/kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (r GcpKubernetesCluster) Translate(ctx resources.MultyContext) ([]output.Tf
}

func (r GcpKubernetesCluster) getServiceAccountId() string {
return common.UniqueId(r.Args.Name, "-sa-", common.LowercaseAlphanumericAndDashFormatFunc)
return common.UniqueId(fmt.Sprintf("%s-%s", r.Args.Name, r.ResourceId), "-sa-", common.LowercaseAlphanumericAndDashFormatFunc)
}

func (r GcpKubernetesCluster) GetMainResourceName() (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/vault_secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func testVaultSecret(t *testing.T, cloud commonpb.CloudProvider) {
}

func setupVmForVaultTest(t *testing.T, ctx context.Context, location commonpb.Location, cloud commonpb.CloudProvider, pubKey string) *resourcespb.VirtualMachineResource {
subnet, nsg := createNetworkWithInternetAccess(t, ctx, location, cloud, "vm")
subnet, nsg := createNetworkWithInternetAccess(t, ctx, location, cloud, "vault")
createVmRequest := &resourcespb.CreateVirtualMachineRequest{Resource: &resourcespb.VirtualMachineArgs{
CommonParameters: &commonpb.ResourceCommonArgs{
Location: location,
Expand Down

0 comments on commit 65ea15d

Please sign in to comment.