func IsDeploymentCreated(namespace, deployment string) func() (bool, error) {
	return func() (bool, error) {
		var stdout, stderr bytes.Buffer
		err := kubectl.Run(&stdout, &stderr, "get", "-n", namespace,
			"deployments.apps", deployment, "-ojsonpath={.status.readyReplicas}")

		if err != nil {
			return false, err
		}

		readyReplicas := stdout.String()

		stdout.Reset()
		stderr.Reset()
		err = kubectl.Run(&stdout, &stderr, "get", "-n", namespace,
			"deployments.apps", deployment, "-ojsonpath={.status.replicas}")

		if err != nil {
			return false, err
		}

		replicas := stdout.String()

		return readyReplicas == replicas, nil
	}
}
// IsDeploymentCreated check if deployment created
IsDeploymentCreated check if deployment created
// IsDeploymentCreated check if deployment created
func IsDeploymentCreated(namespace, deployment string) func() (bool, error) {
	return func() (bool, error) {
		var stdout, stderr bytes.Buffer
		err := kubectl.Run(&stdout, &stderr, "get", "-n", namespace,
			"deployments.apps", deployment, "-ojsonpath={.status.readyReplicas}")
		if err != nil {
			return false, err
		}
		readyReplicas := stdout.String()
		stdout.Reset()
		stderr.Reset()
		err = kubectl.Run(&stdout, &stderr, "get", "-n", namespace,
			"deployments.apps", deployment, "-ojsonpath={.status.replicas}")
		if err != nil {
			return false, err
		}
		replicas := stdout.String()
		return readyReplicas == replicas, nil
	}
}
func IsDeploymentCreated ( namespace , deployment string ) func ( ) ( bool , error ) { return func ( ) ( bool , error ) { var stdout , stderr bytes . Buffer err := kubectl . Run ( & stdout , & stderr , " " , " " , namespace , " " , deployment , " " ) if err != nil { return false , err } readyReplicas := stdout . String ( ) stdout . Reset ( ) stderr . Reset ( ) err = kubectl . Run ( & stdout , & stderr , " " , " " , namespace , " " , deployment , " " ) if err != nil { return false , err } replicas := stdout . String ( ) return readyReplicas == replicas , nil } }
IsDeploymentCreated check if deployment created
IsDeploymentCreated check if deployment created