feat: Added auth token server

issue #96
This commit is contained in:
Andrey Melnikov
2020-03-10 12:53:13 -07:00
parent 8a3306f4df
commit c5975a4022
9 changed files with 174 additions and 216 deletions

View File

@@ -8,6 +8,24 @@ import (
var onepanelEnabledLabelKey = "onepanel.io/enabled"
func (c *Client) ListOnepanelEnabledNamespaces() (namespaces []*Namespace, err error) {
namespaceList, err := c.CoreV1().Namespaces().List(metav1.ListOptions{
LabelSelector: fmt.Sprintf("%s=%s", onepanelEnabledLabelKey, "true"),
})
if err != nil {
return
}
for _, ns := range namespaceList.Items {
namespaces = append(namespaces, &Namespace{
Name: ns.Name,
Labels: ns.Labels,
})
}
return
}
func (c *Client) ListNamespaces() (namespaces []*Namespace, err error) {
namespaceList, err := c.CoreV1().Namespaces().List(metav1.ListOptions{
LabelSelector: fmt.Sprintf("%s=%s", onepanelEnabledLabelKey, "true"),