-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PLT-1253:Added cluster profile support in terrafrom import. (#460) * PLT-790:Added import support for eks cluster (#461) * PLT-794 (#462) * PLT-792:Added import for vsphere cluster (#463) * PLT-792:Added import for vsphere cluster * Fixed unitest * PLT-800:Added support for cluster profile in terrafrom import. (#465) * PLT-800:Added support for cluster profile in terrafrom import. * lint fix * PLT-896: Updated registry_uid as mandatory for packs data source (#457) * PLT-896: Updated registry_uid as mandatoray for packs data source * updated go mod * setting up types back * Revert "PLT-896: Updated registry_uid as mandatory for packs data source (#457)" This reverts commit b561564. * Merging main (#473) * Fix for release job (#468) * update goreleaser version (#469) * PRM-911: Fix for release v20 (#470) * Prm 911 (#471) * fix for goreleaser (#472) --------- Co-authored-by: Seema Durrani <[email protected]> * incorporated review comments * added comment on code --------- Co-authored-by: Seema Durrani <[email protected]>
- Loading branch information
1 parent
2e6f516
commit 33f6f17
Showing
19 changed files
with
550 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package spectrocloud | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
"github.com/spectrocloud/palette-sdk-go/client" | ||
) | ||
|
||
func resourceClusterAzureImport(ctx context.Context, d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { | ||
c := m.(*client.V1Client) | ||
err := GetCommonCluster(d, c) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
diags := resourceClusterAzureRead(ctx, d, m) | ||
if diags.HasError() { | ||
return nil, fmt.Errorf("could not read cluster for import: %v", diags) | ||
} | ||
|
||
// cluster profile and common default cluster attribute is get set here | ||
err = flattenCommonAttributeForClusterImport(c, d) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return []*schema.ResourceData{d}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package spectrocloud | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
"github.com/spectrocloud/palette-sdk-go/client" | ||
) | ||
|
||
func resourceClusterEksImport(ctx context.Context, d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { | ||
c := m.(*client.V1Client) | ||
err := GetCommonCluster(d, c) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
diags := resourceClusterEksRead(ctx, d, m) | ||
if diags.HasError() { | ||
return nil, fmt.Errorf("could not read cluster for import: %v", diags) | ||
} | ||
|
||
// cluster profile and common default cluster attribute is get set here | ||
err = flattenCommonAttributeForClusterImport(c, d) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
// Return the resource data. In most cases, this method is only used to | ||
// import one resource at a time, so you should return the resource data | ||
// in a slice with a single element. | ||
return []*schema.ResourceData{d}, nil | ||
} |
Oops, something went wrong.