This commit is contained in:
Ybehrooz
2025-08-03 14:54:21 +03:30
parent 97d1424fa7
commit b1656a5e65
3 changed files with 319 additions and 6 deletions

View File

@@ -202,6 +202,32 @@ func CreateApp(objectID string, clustername string, ControlPlane string, Platfor
}
func DeleteApp(appName string) error {
InitializeClient()
// Create an application client
_, appClient, err := client.NewApplicationClient()
if err != nil {
log.Fatalf("Failed to create application client: %v", err)
}
cascade := true
propagationPolicy := "Foreground"
_, err = appClient.Delete(context.Background(), &application.ApplicationDeleteRequest{
Name: &appName,
Cascade: &cascade, // Set to true if you want to delete related resources
PropagationPolicy: &propagationPolicy, // You can also use "Background" or "Orphan"
})
if err != nil {
return fmt.Errorf("failed to delete application: %v", err)
}
fmt.Printf("Application %s deleted successfully\n", appName)
return nil
}
func getConfig(objectID string, cluster string, namespace string) {
var hostcluster HostConfig