diff --git a/cmd/apply.go b/cmd/apply.go index 311f64b..3a50ddf 100644 --- a/cmd/apply.go +++ b/cmd/apply.go @@ -67,13 +67,19 @@ func runApply(configPath string, isDryRun bool, autoApprove bool) error { fmt.Printf("✅ Configuration loaded successfully: %s\n", cfg.Metadata.Name) - // Step 3: Create EdgeConnect client (apply always uses v2) + // Step 3: Validate API version (apply only supports v2) + apiVersion := getAPIVersion() + if apiVersion == "v1" { + return fmt.Errorf("apply command only supports API v2. The v1 API does not support the advanced deployment features required by this command. Please use --api-version v2 or remove the api_version setting") + } + + // Step 4: Create EdgeConnect client (v2 only) client := newSDKClientV2() - // Step 4: Create deployment planner + // Step 5: Create deployment planner planner := apply.NewPlanner(client) - // Step 5: Generate deployment plan + // Step 6: Generate deployment plan fmt.Println("🔍 Analyzing current state and generating deployment plan...") planOptions := apply.DefaultPlanOptions()