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

PLT-1550: Remove resource spectrocloud_cluster_import #560

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 0 additions & 129 deletions docs/resources/cluster_import.md

This file was deleted.

14 changes: 0 additions & 14 deletions examples/resources/spectrocloud_cluster_import/providers.tf

This file was deleted.

36 changes: 0 additions & 36 deletions examples/resources/spectrocloud_cluster_import/resource.tf

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions examples/resources/spectrocloud_cluster_import/variables.tf

This file was deleted.

19 changes: 19 additions & 0 deletions spectrocloud/cluster_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package spectrocloud
import (
"errors"
"fmt"
"github.com/hashicorp/go-cty/cty"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/spectrocloud/palette-sdk-go/api/models"
Expand Down Expand Up @@ -307,3 +308,21 @@ func flattenCommonAttributeForCustomClusterImport(c *client.V1Client, d *schema.
}
return nil
}

func flattenCloudConfigGeneric(configUID string, d *schema.ResourceData, c *client.V1Client) diag.Diagnostics {
if err := d.Set("cloud_config_id", configUID); err != nil {
return diag.FromErr(err)
}
return diag.Diagnostics{}
}

func validateCloudType(data interface{}, path cty.Path) diag.Diagnostics {
var diags diag.Diagnostics
inCloudType := data.(string)
for _, cloudType := range []string{"aws", "azure", "gcp", "vsphere", "generic"} {
if cloudType == inCloudType {
return diags
}
}
return diag.FromErr(fmt.Errorf("cloud type '%s' is invalid. valid cloud types are %v", inCloudType, "cloud_types"))
}
2 changes: 0 additions & 2 deletions spectrocloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ func New(_ string) func() *schema.Provider {

"spectrocloud_cluster_group": resourceClusterGroup(),

"spectrocloud_cluster_import": resourceClusterImport(),

"spectrocloud_addon_deployment": resourceAddonDeployment(),

"spectrocloud_virtual_machine": resourceKubevirtVirtualMachine(),
Expand Down
11 changes: 0 additions & 11 deletions spectrocloud/provider_resource_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ func prepareClusterVirtualTestData(id string) *schema.ResourceData {
return d
}

func prepareClusterImportTestData(id string) *schema.ResourceData {
d := resourceClusterImport().TestResourceData()
d.SetId(id)
return d
}

func prepareAddonDeploymentTestData(id string) *schema.ResourceData {
d := resourceAddonDeployment().TestResourceData()
d.SetId(id)
Expand Down Expand Up @@ -391,11 +385,6 @@ func TestResourceClusterVirtual(t *testing.T) {
assert.Equal(t, "test-id", testData.Id())
}

func TestResourceClusterImport(t *testing.T) {
testData := prepareClusterImportTestData("test-id")
assert.Equal(t, "test-id", testData.Id())
}

func TestResourceAddonDeployment(t *testing.T) {
testData := prepareAddonDeploymentTestData("test-id")
assert.Equal(t, "test-id", testData.Id())
Expand Down
Loading
Loading