Documentation
¶
Index ¶
- Variables
- func ContainerDefaultResourceLimit(limitsCPU, limitsMemory, requestsCPU, requestsMemory string) string
- func CreateNamespace(client *rancher.Client, ...) (*coreV1.Namespace, error)
- func GetNamespaceByName(client *rancher.Client, clusterID, namespaceName string) (*corev1.Namespace, error)
- type NamespaceList
Constants ¶
This section is empty.
Variables ¶
var NamespaceGroupVersionResource = schema.GroupVersionResource{
Group: "",
Version: "v1",
Resource: "namespaces",
}
NamespaceGroupVersionResource is the required Group Version Resource for accessing namespaces in a cluster, using the dynamic client.
Functions ¶
func ContainerDefaultResourceLimit ¶
func ContainerDefaultResourceLimit(limitsCPU, limitsMemory, requestsCPU, requestsMemory string) string
ContainerDefaultResourceLimit sets the container default resource limit in a string limitsCPU and requestsCPU in form of "3m" limitsMemory and requestsMemory in the form of "3Mi"
func CreateNamespace ¶
func CreateNamespace(client *rancher.Client, clusterID, projectName, namespaceName, containerDefaultResourceLimit string, labels, annotations map[string]string) (*coreV1.Namespace, error)
CreateNamespace is a helper function that uses the dynamic client to create a namespace on a project. It registers a delete function with a wait.WatchWait to ensure the namspace is deleted cleanly.
Types ¶
type NamespaceList ¶
NamespaceList is a struct that contains a list of namespaces.
func ListNamespaces ¶
func ListNamespaces(client *rancher.Client, clusterID string, listOpts metav1.ListOptions) (*NamespaceList, error)
ListNamespaces is a helper function that uses the dynamic client to list namespaces in a cluster with its list options.
func (*NamespaceList) Names ¶
func (list *NamespaceList) Names() []string
Names is a method that accepts NamespaceList as a receiver, returns each namespace name in the list as a new slice of strings.