fix: fix lintings
This commit is contained in:
parent
cdbfc56fd0
commit
55eeed71f0
1 changed files with 62 additions and 62 deletions
|
|
@ -76,12 +76,12 @@ func TestMain(m *testing.M) {
|
||||||
os.Exit(code)
|
os.Exit(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
//var (
|
||||||
validFlavor = "2.4"
|
// validFlavor = "2.4"
|
||||||
kekKeyRingId = ""
|
// kekKeyRingId = ""
|
||||||
kekKeyVersion = ""
|
// kekKeyVersion = ""
|
||||||
kekKeySA = ""
|
// kekKeySA = ""
|
||||||
)
|
//)
|
||||||
|
|
||||||
func testAccPreCheck(t *testing.T) {
|
func testAccPreCheck(t *testing.T) {
|
||||||
// TODO: if needed ...
|
// TODO: if needed ...
|
||||||
|
|
@ -202,63 +202,63 @@ resource "stackitprivatepreview_postgresflexalpha_instance" "test" {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testAccResourceEncryptionExampleConfig(data resData) string {
|
//func testAccResourceEncryptionExampleConfig(data resData) string {
|
||||||
return fmt.Sprintf(`
|
// return fmt.Sprintf(`
|
||||||
|
//
|
||||||
%[1]s
|
//%[1]s
|
||||||
|
//
|
||||||
resource "stackitprivatepreview_postgresflexalpha_instance" "test" {
|
//resource "stackitprivatepreview_postgresflexalpha_instance" "test" {
|
||||||
project_id = %[2]q
|
// project_id = %[2]q
|
||||||
name = %[3]q
|
// name = %[3]q
|
||||||
backup_schedule = "0 0 * * *"
|
// backup_schedule = "0 0 * * *"
|
||||||
retention_days = 45
|
// retention_days = 45
|
||||||
flavor_id = "2.1"
|
// flavor_id = "2.1"
|
||||||
replicas = 1
|
// replicas = 1
|
||||||
storage = {
|
// storage = {
|
||||||
performance_class = "premium-perf2-stackit"
|
// performance_class = "premium-perf2-stackit"
|
||||||
size = 10
|
// size = 10
|
||||||
}
|
// }
|
||||||
encryption = {
|
// encryption = {
|
||||||
kek_key_id = "key01"
|
// kek_key_id = "key01"
|
||||||
kek_key_ring_id = "key_ring_01"
|
// kek_key_ring_id = "key_ring_01"
|
||||||
kek_key_version = 1
|
// kek_key_version = 1
|
||||||
service_account = "service@account.email"
|
// service_account = "service@account.email"
|
||||||
}
|
// }
|
||||||
network = {
|
// network = {
|
||||||
acl = ["0.0.0.0/0"]
|
// acl = ["0.0.0.0/0"]
|
||||||
access_scope = "PUBLIC"
|
// access_scope = "PUBLIC"
|
||||||
}
|
// }
|
||||||
version = 14
|
// version = 14
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
`,
|
//`,
|
||||||
testutil.PostgresFlexProviderConfig(data.ServiceAccountFilePath),
|
// testutil.PostgresFlexProviderConfig(data.ServiceAccountFilePath),
|
||||||
data.ProjectID,
|
// data.ProjectID,
|
||||||
data.Name,
|
// data.Name,
|
||||||
)
|
// )
|
||||||
}
|
|
||||||
|
|
||||||
func testCheckResourceExists(resourceName string) resource.TestCheckFunc {
|
|
||||||
return func(s *terraform.State) error {
|
|
||||||
rs, ok := s.RootModule().Resources[resourceName]
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("resource not found: %s", resourceName)
|
|
||||||
}
|
|
||||||
|
|
||||||
if rs.Primary.ID == "" {
|
|
||||||
return fmt.Errorf("resource ID not set")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verify resource exists in the API
|
|
||||||
//client := testAccProvider.Meta().(*APIClient)
|
|
||||||
//_, err := client.GetResource(rs.Primary.ID)
|
|
||||||
//if err != nil {
|
|
||||||
// return fmt.Errorf("error fetching resource: %w", err)
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
return nil
|
//func testCheckResourceExists(resourceName string) resource.TestCheckFunc {
|
||||||
}
|
// return func(s *terraform.State) error {
|
||||||
}
|
// rs, ok := s.RootModule().Resources[resourceName]
|
||||||
|
// if !ok {
|
||||||
|
// return fmt.Errorf("resource not found: %s", resourceName)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if rs.Primary.ID == "" {
|
||||||
|
// return fmt.Errorf("resource ID not set")
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // Verify resource exists in the API
|
||||||
|
// //client := testAccProvider.Meta().(*APIClient)
|
||||||
|
// //_, err := client.GetResource(rs.Primary.ID)
|
||||||
|
// //if err != nil {
|
||||||
|
// // return fmt.Errorf("error fetching resource: %w", err)
|
||||||
|
// //}
|
||||||
|
//
|
||||||
|
// return nil
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
func setupMockServer() *httptest.Server {
|
func setupMockServer() *httptest.Server {
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue