-
Notifications
You must be signed in to change notification settings - Fork 5
/
all.go
33 lines (25 loc) · 1 KB
/
all.go
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
package main
import (
"fmt"
"github.com/forbearing/k8s"
)
func All() {
discoveryClient := k8s.DiscoveryClientOrDie("")
// ServerGroups returns the supported groups, with information like supported versions and the
// preferred version.
fmt.Println(discoveryClient.ServerGroups())
fmt.Println()
// ServerGroupsAndResources returns the supported resources for all groups and versions.
fmt.Println(discoveryClient.ServerGroupsAndResources())
fmt.Println()
// ServerPreferredNamespacedResources returns the supported namespaced resources with the
// version preferred by the server.
fmt.Println(discoveryClient.ServerPreferredNamespacedResources())
fmt.Println()
// ServerPreferredResources returns the supported resources with the version preferred by the
// server.
fmt.Println(discoveryClient.ServerPreferredResources())
fmt.Println()
// ServerResourcesForGroupVersion returns the supported resources for a group and version.
fmt.Println(discoveryClient.ServerResourcesForGroupVersion("apps/v1"))
}