package main

import (
	"wdd.io/agent-go/utils"
	"wdd.io/cmii_operator"
)

var realConfig = `apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeE1ERXhPREEyTURZeU5Gb1hEVE14TURFeE5qQTJNRFl5TkZvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBS2ZNCjFjTjBNUnhUTkRGdEZxcnRIZ0RPM29SV0dicmVob3VFcDJ3VUVRbU8yRUFyZDdkMUFReTJsSm9WM0RUVmhXbUwKcUFUOFcxaWRaS0x0Wm5mNjEva3JPeDd0U2lJeU4xa1ErN3NYRUhnTjVMc01EOVlKcndpUFdFY2FXdU9HVmI1aApMWDZWOTRjN0U5UlFDOENtd09iSkRCNG45ZE8zcDVlTDJHaFRpMkNrRWt3ZkRPR0tEL1IxeUNaK0tFcDRWWlplCnpwcnUzRG5zOUNqZHVOT1VBWTZzUGxjazNvdEdIVnhnRC9IRlRjUEhNbGhvUVQ4dmNDOTZwc0FtYXZPR1BZQ0YKa3RtN0VWYkZDOHN5Q1BMT3AwWWhTWHRkbGtKaC9UWHBaM0hSUWJxSzVPNXR4K1dGL05qMGJVc202ZldSMzZWQgpKQVVscUJIeFhSTzhGTFNrVHkwQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFKeWZ2T3hHVVYvT2wybGRQNnYxeWFSTkd5RVkKWkVxTmM2Y29LSklsd0VQNUxNYzdZNGFReWorZCtVTE4zYmIrOXZsZXdHamluTHRrUW5HZ1R3Q3pKTU5ZNlNJNQo2NzJGZEtQTE85Szdpalhway9qRE9FVHJWS25aMXJBTytOUVBmSVhpcXQ3Y1RyVHlaVzdKTVl3emZNa2VlTGErCnREdmY1Rm5vQTBLN2U3a0ZXNTBpN2pXcGh4RXRMNEJpNzAwNnU4NEpqTU5weVp1MzhKMjFXZkR1RjBoU0NQREgKS0x4cnZIZ0FOYzJWU1c2L3JPaVVCQjdiV0JkcWcyQUNVRWZwN0V3UGs2S1BsdGNiNTJtdFhCU2xiQ3pRWWw4UQpmNmVGRFIrbnRjeXNGbU1FMFI3M1lNSHJwR0dGdlduSDVaTmEyVEJYdHpwN2tNNkVPREE5a2R4WkI1dz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
    server: https://192.168.11.170:16443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4ekNDQWR1Z0F3SUJBZ0lKQU9SWThQZlhadWQyTUEwR0NTcUdTSWIzRFFFQkN3VUFNQlV4RXpBUkJnTlYKQkFNVENtdDFZbVZ5Ym1WMFpYTXdIaGNOTWpJd01URTRNRFl6TmpRMFdoY05Nekl3TVRFMk1EWXpOalEwV2pBMApNUmN3RlFZRFZRUUtEQTV6ZVhOMFpXMDZiV0Z6ZEdWeWN6RVpNQmNHQTFVRUF3d1FhM1ZpWlhKdVpYUmxjeTFoClpHMXBiakNDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFPNTZ0ZG51M24rWUsxM3oKZmNlTzNiSmhBL2J0SGpoQXpvRnNObmZjeEY3dlRTZGczSUxySmVNVkFGbG50MHpUL2xacFBlU0ZUN25iL1g1Ygo4RjErSHA2dVR0b0hRVGJHR2Vz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JVkFURSBLRVktLS0tLQo=`

func main() {
	k8sOperator := cmii_operator.CmiiK8sOperator{}
	k8sOperator.BuildCurrentClientFromConfig(realConfig)
	realNamespace := "ingress-nginx"

	// 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)

}
