add new
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user