feat: add import support and unit tests for provider resources
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package resources
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// parseImportID разбирает импорт в формате namespace/name.
|
||||
func parseImportID(importID string) (string, string, error) {
|
||||
parts := strings.Split(importID, "/")
|
||||
if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
|
||||
return "", "", fmt.Errorf("invalid import id %q, expected format namespace/name", importID)
|
||||
}
|
||||
|
||||
return parts[0], parts[1], nil
|
||||
}
|
||||
Reference in New Issue
Block a user