forked from kubeflow/hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.go
More file actions
41 lines (32 loc) · 1.63 KB
/
client.go
File metadata and controls
41 lines (32 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package kubernetes
import (
"context"
corev1 "k8s.io/api/core/v1"
)
const ComponentLabelValue = "model-registry"
const ComponentLabelValueCatalog = "model-catalog"
// TODO ppadti double check if the config map key is indeed sources.yaml
const CatalogSourceKey = "sources.yaml"
const CatalogSourceDefaultConfigMapName = "model-catalog-source-config"
const CatalogSourceUserConfigMapName = "model-catalog-sources"
type KubernetesClientInterface interface {
// Service discovery
GetServiceNames(ctx context.Context, namespace string) ([]string, error)
GetServiceDetailsByName(ctx context.Context, namespace, serviceName string, serviceType string) (ServiceDetails, error)
GetServiceDetails(ctx context.Context, namespace string) ([]ServiceDetails, error)
// Namespace access
GetNamespaces(ctx context.Context, identity *RequestIdentity) ([]corev1.Namespace, error)
// Permission checks (abstracted SAR/SelfSAR)
CanListServicesInNamespace(ctx context.Context, identity *RequestIdentity, namespace string) (bool, error)
CanAccessServiceInNamespace(ctx context.Context, identity *RequestIdentity, namespace, serviceName string) (bool, error)
GetSelfSubjectRulesReview(ctx context.Context, identity *RequestIdentity, namespace string) ([]string, error)
// Meta
IsClusterAdmin(identity *RequestIdentity) (bool, error)
BearerToken() (string, error)
GetUser(identity *RequestIdentity) (string, error)
// Model Registry Settings
GetGroups(ctx context.Context) ([]string, error)
//Model Catalog Settings
GetAllCatalogSourceConfigs(ctx context.Context, namespace string) (corev1.ConfigMap, corev1.ConfigMap, error)
//TODO ppadti add other methods here
}