func VerifyAPI(group string, version string) (bool, error) {
	cfg, err := config.GetConfig()
	if err != nil {
		log.Error(err, "unable to get k8s config")
		return false, err
	}

	k8s, err := kubernetes.NewForConfig(cfg)
	if err != nil {
		log.Error(err, "unable to create k8s client")
		return false, err
	}

	gv := schema.GroupVersion{
		Group:   group,
		Version: version,
	}

	if err = discovery.ServerSupportsVersion(k8s, gv); err != nil {
		// error, API not available
		return false, nil
	}

	log.Info(fmt.Sprintf("%s/%s API verified", group, version))
	return true, nil
}
// VerifyAPI will verify that the given group/version is present in the cluster.
VerifyAPI will verify that the given group/version is present in the cluster.
// VerifyAPI will verify that the given group / version is present in the cluster .
func VerifyAPI(group string, version string) (bool, error) {
	cfg, err := config.GetConfig()
	if err != nil {
		log.Error(err, "unable to get k8s config")
		return false, err
	}
	k8s, err := kubernetes.NewForConfig(cfg)
	if err != nil {
		log.Error(err, "unable to create k8s client")
		return false, err
	}
	gv := schema.GroupVersion{
		Group:   group,
		Version: version,
	}
	if err = discovery.ServerSupportsVersion(k8s, gv); err != nil {
		return false, nil
	}
	log.Info(fmt.Sprintf("%s/%s API verified", group, version))
	return true, nil
}
func VerifyAPI ( group string , version string ) ( bool , error ) { cfg , err := config . GetConfig ( ) if err != nil { log . Error ( err , " " ) return false , err } k8s , err := kubernetes . NewForConfig ( cfg ) if err != nil { log . Error ( err , " " ) return false , err } gv := schema . GroupVersion { Group : group , Version : version , } if err = discovery . ServerSupportsVersion ( k8s , gv ) ; err != nil { return false , nil } log . Info ( fmt . Sprintf ( " " , group , version ) ) return true , nil }
VerifyAPI will verify that the given group/version is present in the cluster.
VerifyAPI will verify that the given group / version is present in the cluster .
// error, API not available