// IsClusterVersionSupported verifies that the remote cluster's API version
// falls within the acceptable range.
IsClusterVersionSupported verifies that the remote cluster's API version
falls within the acceptable range.
// IsClusterVersionSupported verifies that the remote cluster ' s API version // falls within the acceptable range .
func IsClusterVersionSupported() error {
	clusterInfo, err := cluster.Client.Discovery().ServerVersion()
	if err != nil {
		return err
	}
	clusterVersion, err := semver.Make(
		strings.Replace(clusterInfo.String(), "v", "", -1))
	if err != nil {
		return err
	}
	versionRange, err := semver.ParseRange(KubernetesRange)
	if err != nil {
		return err
	}
	if !versionRange(clusterVersion) {
		return fmt.Errorf(
			kubeVersionError,
			clusterInfo.String(),
			KubernetesRange)
	}
	return nil
}
func IsClusterVersionSupported ( ) error { clusterInfo , err := cluster . Client . Discovery ( ) . ServerVersion ( ) if err != nil { return err } clusterVersion , err := semver . Make ( strings . Replace ( clusterInfo . String ( ) , " " , " " , - 1 ) ) if err != nil { return err } versionRange , err := semver . ParseRange ( KubernetesRange ) if err != nil { return err } if ! versionRange ( clusterVersion ) { return fmt . Errorf ( kubeVersionError , clusterInfo . String ( ) , KubernetesRange ) } return nil }
IsClusterVersionSupported verifies that the remote cluster's API version
falls within the acceptable range.
IsClusterVersionSupported verifies that the remote cluster ' s API version falls within the acceptable range .