// NewAddonRepo create new addon repo,now only support ConfigMap
NewAddonRepo create new addon repo,now only support ConfigMap
// NewAddonRepo create new addon repo now only support ConfigMap
func NewAddonRepo() (AddonRepo, error) {
	list := v1.ConfigMapList{}
	matchLabels := metav1.LabelSelector{
		MatchExpressions: []metav1.LabelSelectorRequirement{{
			Key:      MarkLabel,
			Operator: metav1.LabelSelectorOpExists,
		}},
	}
	selector, err := metav1.LabelSelectorAsSelector(&matchLabels)
	if err != nil {
		return nil, err
	}
	err = clt.List(context.Background(), &list, &client.ListOptions{LabelSelector: selector})
	if err != nil {
		return nil, errors.Wrap(err, "Get addon list failed")
	}
	return configMapAddonRepo{maps: list.Items}, nil
}
func NewAddonRepo ( ) ( AddonRepo , error ) { list := v1 . ConfigMapList { } matchLabels := metav1 . LabelSelector { MatchExpressions : [ ] metav1 . LabelSelectorRequirement { { Key : MarkLabel , Operator : metav1 . LabelSelectorOpExists , } } , } selector , err := metav1 . LabelSelectorAsSelector ( & matchLabels ) if err != nil { return nil , err } err = clt . List ( context . Background ( ) , & list , & client . ListOptions { LabelSelector : selector } ) if err != nil { return nil , errors . Wrap ( err , " " ) } return configMapAddonRepo { maps : list . Items } , nil }
NewAddonRepo create new addon repo,now only support ConfigMap
NewAddonRepo create new addon repo now only support ConfigMap