package main

//
//import (
//	"wdd.io/agent-common/utils"
//	cmiioperator "wdd.io/agent-operator"
//)
//
//var realConfig = `apiVersion: v1
//kind: Config
//clusters:
//- cluster:
//    api-version: v1
//    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN3akNDQWFxZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFTTVJBd0RnWURWUVFERXdkcmRXSmwKTFdOaE1CNFhEVEkwTURNd056QTVNamd3TkZvWERUTTBNRE13TlRBNU1qZ3dORm93RWpFUU1BNEdBMVVFQXhNSAphM1ZpWlMxallUQ0NBU0l3RFFZSktvWklodmNOQVFFQkJRQURnZ0VQQURDQ0FRb0NnZ0VCQUwvNENFYy96cnNPCnpzTG9OVlhTQWFLTkpldGs2RlBCbFYvditLcFNOelFOY1FsZ0hSN2NSSWl0c0N2eHBvYUtucFY4VEFLZFJpb3gKTGRPakM4a1E1OUt3cXk5SXU1Wk5LYWpOaDVIZDNCdzlMOHJiUVJoTThwRWp3dzRJTFdhdzNNMlF2NnA2YjdqRgpQN0h1c3VWZW1JVEl4TTl1T3BtQzNVOWZaQzVIbVpKZDdpaEJzaVpMR2lZOGVES2lPbGh6am10amNQWUFiUnE4Cml6UW1zcmdhUityb203YTdBQTdxU3ZTdHlyTmRjbXFBQmRvU3lEUDhaOFBzWlB2djhWSisyOUJ1eEgveVhCLzIKaVBsaG83Yjl4eGduSmJxaURRS0NsbzVjcFBzbWpQQ0JkZmJPVk9ORzhRZzY1UmJPems2TnNXUzNvLzFWVklaSwpqeVMyZjFlcjFBMENBd0VBQWFNak1DRXdEZ1lEVlIwUEFRSC9CQVFEQWdLa01BOEdBMVVkRXdFQi93UUZNQU1CCkFmOHdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBQjRNd3ZyWGZOaHBWTVpFNWMyY2gxS05CYStJNGc1Z2tnU1YKajNGN3BRV1FpbXZSb1VDSmhjOEJiZmRIVnN1VzE5NE9FREx6WUtONGxDb20vWUVZNUN3R0lwVjhVRlN0aDJuZQpxcTRhM1crVW4xM2Z1TWdBemxTblFSQ3F0d01UbEh3cnlnaUQ0bE5HMGVEdVdoVlMwdVpZSHFpV0Y2OENUZmp5Cng3UVhsVmNrTU1XZzhoSlIwNG1QV1BhYis5cDd0b3Q1WWZwK0kxOWU5V2dpelJNNCs3TGoxUmpCVGN4WGFaYWgKL3JrMjZzV3JmK0xkcEh6c0U1cFc3LzlKM09MNGdTWFJKb09kclQwK1lsczVIRm83Q1d5TW1tbmVxMlR4Q2tHSwpxTkVzNUUrdDYrYStCL3B0cXZHd3RmbnlKeFV1YkZhY3FJeG1vbGo3UW52OWR1RVRiQkU9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
//    server: "https://127.0.0.1:6443"
//  name: "rke-cluster"
//contexts:
//- context:
//    cluster: "rke-cluster"
//    user: "kube-admin-rke-cluster"
//  name: "rke-cluster"
//current-context: "rke-cluster"
//users:
//- name: "kube-admin-rke-cluster"
//  user:
//    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM2VENDQWRHZ0F3SUJBZ0lJZEtaNDNXVVpLOE13RFFZSktvWklodmNOQVFFTEJRQXdFakVRTUE0R0ExVUUKQXhNSGEzVmlaUzFqWVRBZUZ3MHlOREF6TURjd09USTRNRFJhRncwek5EQXpNRFV3T1RVd05EWmFNQzR4RnpBVgpCZ05WQkFvVERuTjVjM1JsYlRwdFlYTjBaWEp6TVJNd0VRWURWUVFERXdwcmRXSmxMV0ZrYldsdU1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTA0M1hyS215Rkgvemw5SU9ubjJkODN5Mlo2Rm4KMXhiYVZMN09nTXlZelVCS204WFdWY0V5L1RaRTBnV1pJdm9nTmtVOGptd0F6d0dxb2dmeS9nVVk2VWRINkVDQgowcVRMUDFkQTlJSU1XL3c5SlpjUU0wTWw3Qi9N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UFJJVkFURSBLRVktLS0tLQo=`
//
//func main() {
//	k8sOperator := cmiioperator.CmiiK8sOperator{}
//	k8sOperator.BuildCurrentClientFromConfig(realConfig)
//	realNamespace := "zyga"
//
//	// get all pods
//	//allInterface := k8sOperator.PodAllInterface(realNamespace)
//	//
//	//for _, deploymentInterface := range allInterface {
//	//	utils.BeautifulPrint(deploymentInterface)
//	//}
//
//	// restart all backend
//	//cmii_operator.RestartCmiiBackendDeployment(realNamespace)
//
//	//cmii_operator.RestartCmiiFrontendDeployment(realNamespace)
//
//	backMap := map[string]string{
//		//"cmii-admin-data":               "5.4.0",
//		//"cmii-admin-gateway":            "5.4.0",
//		//"cmii-admin-user":               "5.4.0",
//		//"cmii-app-release":              "4.2.0-validation",
//		//"cmii-open-gateway":             "5.4.0",
//		//"cmii-suav-supervision":         "5.2.0",
//		//"cmii-uav-airspace":             "5.4.0",
//		//"cmii-uav-alarm":                "5.4.0",
//		//"cmii-uav-autowaypoint":         "4.1.6-cm",
//		//"cmii-uav-brain":                "5.4.0",
//		//"cmii-uav-cloud-live":           "5.4.0",
//		//"cmii-uav-clusters":             "5.2.0",
//		//"cmii-uav-cms":                  "5.3.0",
//		//"cmii-uav-data-post-process":    "5.4.0",
//		//"cmii-uav-depotautoreturn":      "5.4.0",
//		//"cmii-uav-developer":            "5.4.0",
//		//"cmii-uav-device":               "5.4.0-25916",
//		//"cmii-uav-emergency":            "5.3.0",
//		//"cmii-uav-gateway":              "5.4.0",
//		//"cmii-uav-gis-server":           "5.4.0",
//		//"cmii-uav-grid-datasource":      "5.2.0-24810",
//		//"cmii-uav-grid-engine":          "5.1.0",
//		//"cmii-uav-grid-manage":          "5.1.0",
//		//"cmii-uav-industrial-portfolio": "5.4.0-27348-1",
//		//"cmii-uav-integration":          "5.4.0-25916",
//		//"cmii-uav-kpi-monitor":          "5.4.0",
//		//"cmii-uav-logger":               "5.4.0",
//		//"cmii-uav-material-warehouse":   "5.4.0",
//		//"cmii-uav-mission":              "5.4.0-26462-0307",
//		//"cmii-uav-mqtthandler":          "5.4.0-25916",
//		//"cmii-uav-multilink":            "5.4.0",
//		//"cmii-uav-notice":               "5.4.0",
//		//"cmii-uav-oauth":                "5.4.0",
//		//"cmii-uav-process":              "5.4.0",
//		"cmii-uav-surveillance": "5.4.0-leaflet",
//		//"cmii-uav-threedsimulation":     "5.1.0",
//		//"cmii-uav-tower":                "5.4.0",
//		//"cmii-uav-user":                 "5.4.0",
//		//"cmii-uav-waypoint":             "5.4.0-26768",
//	}
//	//
//	frontMap := map[string]string{
//		"cmii-uav-platform": "5.4.0-leaflet",
//		//"cmii-suav-platform-supervision":     "5.4.0",
//		//"cmii-suav-platform-supervisionh5":   "5.4.0",
//		//"cmii-uav-platform-ai-brain":         "5.4.0",
//		//"cmii-uav-platform-armypeople":       "5.4.0",
//		//"cmii-uav-platform-base":             "5.4.0",
//		//"cmii-uav-platform-cms-portal":       "5.4.0",
//		//"cmii-uav-platform-detection":        "5.4.0",
//		//"cmii-uav-platform-emergency-rescue": "5.2.0",
//		//"cmii-uav-platform-hljtt":            "5.3.0-hjltt",
//		//"cmii-uav-platform-jiangsuwenlv":     "4.1.3-jiangsu-0427",
//		//"cmii-uav-platform-logistics":        "5.4.0",
//		//"cmii-uav-platform-media":            "5.4.0",
//		//"cmii-uav-platform-multiterminal":    "5.4.0",
//		//"cmii-uav-platform-mws":              "5.4.0",
//		//"cmii-uav-platform-oms":              "5.4.0",
//		//"cmii-uav-platform-open":             "5.4.0",
//		//"cmii-uav-platform-qingdao":          "4.1.6-24238-qingdao",
//		//"cmii-uav-platform-qinghaitourism":   "4.1.0-21377-0508",
//		//"cmii-uav-platform-security":         "4.1.6",
//		//"cmii-uav-platform-securityh5":       "5.4.0",
//		//"cmii-uav-platform-seniclive":        "5.2.0",
//		//"cmii-uav-platform-share":            "5.4.0",
//		//"cmii-uav-platform-splice":           "5.4.0",
//		//"cmii-uav-platform-threedsimulation": "5.2.0-21392",
//		//"cmii-uav-platform-visualization":    "5.2.0",
//	}
//	//
//	cmiioperator.CmiiOperator = k8sOperator
//	//
//	result := cmiioperator.UpdateCmiiImageTagFromNameTagMap(realNamespace, backMap)
//	utils.BeautifulPrint(result)
//
//	result = cmiioperator.UpdateCmiiImageTagFromNameTagMap(realNamespace, frontMap)
//	utils.BeautifulPrint(result)
//
//}
