Documentation ¶
Index ¶
- func CreateChartRepoFromGithub(client *steveV1.Client, githubURL, githubBranch, repoName string) error
- func GenerateGatekeeperConfigYaml(excludedNamespaces []string, processes []string, name string, namespace string, ...) (string, error)
- func GenerateGatekeeperConstraintYaml(apiGroups []string, excludedNamespaces []string, kinds []string, name string, ...) (string, error)
- func WaitChartInstall(client *catalog.Client, chartNamespace, chartName string) error
- func WaitChartUpgrade(client *catalog.Client, chartNamespace, chartName, chartVersion string) error
- func WatchAndWaitDaemonSets(client *rancher.Client, clusterID, namespace string, ...) error
- func WatchAndWaitDeploymentForAnnotation(client *rancher.Client, ...) error
- func WatchAndWaitDeployments(client *rancher.Client, clusterID, namespace string, ...) error
- func WatchAndWaitStatefulSets(client *rancher.Client, clusterID, namespace string, ...) error
- type ChartStatus
- type ConfigMatch
- type ConfigSpec
- type ConfigYaml
- type ConstraintKinds
- type ConstraintMatch
- type ConstraintParameters
- type ConstraintSpec
- type ConstraintYaml
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateChartRepoFromGithub ¶
func CreateChartRepoFromGithub(client *steveV1.Client, githubURL, githubBranch, repoName string) error
CreateChartRepoFromGithub creates a ClusterRepo in a given client via github instead of helm
func GenerateGatekeeperConfigYaml ¶
func GenerateGatekeeperConfigYaml(excludedNamespaces []string, processes []string, name string, namespace string, apiVersion string, kind string) (string, error)
GenerateGatekeeperConfigYaml generates the yaml for a config for OPA gatekeeper https://open-policy-agent.github.io/gatekeeper/website/docs/exempt-namespaces#exempting-namespaces-from-gatekeeper-using-config-resource
func GenerateGatekeeperConstraintYaml ¶
func GenerateGatekeeperConstraintYaml(apiGroups []string, excludedNamespaces []string, kinds []string, name string, namespaces []string, enforcementAction string, apiVersion string, kind string) (string, error)
GenerateGatekeeperConstraintYaml takes inputs to generate the yaml for an OPA Gatekeeper Constraint from an OPA Constraint Template. This can be used to dynamically generate OPA Constraints based on test data
func WaitChartInstall ¶
WaitChartInstall verifies that the app from a chart was successfully deployed
func WaitChartUpgrade ¶
WaitChartUpgrade verifies that the app from a chart was successfully upgraded
func WatchAndWaitDaemonSets ¶
func WatchAndWaitDaemonSets(client *rancher.Client, clusterID, namespace string, listOptions metav1.ListOptions) error
WatchAndWaitDaemonSets is a helper function that watches the DaemonSets sequentially in a specific namespace and waits until number of available DeamonSets is equal to number of desired scheduled Daemonsets.
func WatchAndWaitDeploymentForAnnotation ¶
func WatchAndWaitDeploymentForAnnotation(client *rancher.Client, clusterID, namespace, deploymentName, annotationKey, annotationValue string) error
WatchAndWaitDeploymentForAnnotation is a helper function that watches the deployment in a specific namespace and waits until expected annotation key and its value.
func WatchAndWaitDeployments ¶
func WatchAndWaitDeployments(client *rancher.Client, clusterID, namespace string, listOptions metav1.ListOptions) error
WatchAndWaitDeployments is a helper function that watches the deployments sequentially in a specific namespace and waits until number of expected replicas is equal to number of available replicas.
func WatchAndWaitStatefulSets ¶
func WatchAndWaitStatefulSets(client *rancher.Client, clusterID, namespace string, listOptions metav1.ListOptions) error
WatchAndWaitStatefulSets is a helper function that watches the StatefulSets sequentially in a specific namespace and waits until number of expected replicas is equal to number of ready replicas.
Types ¶
type ChartStatus ¶
ChartStatus is a struct that GetChartStatus helper function returns. It contains the boolean for is already installed and the chart information.
func GetChartStatus ¶
func GetChartStatus(client *rancher.Client, clusterID, chartNamespace, chartName string) (*ChartStatus, error)
GetChartStatus is a helper function that takes client, clusterID, chartNamespace and chartName as args, uses admin catalog client to check if chart is already installed, if the chart is already installed returns chart information.
type ConfigMatch ¶
type ConfigMatch []struct { ExcludedNamespaces []string `yaml:"excludedNamespaces"` Processes []string `yaml:"processes"` }
ConfigMatch match field for ConfigYaml, it contains different fields than ConstraintMatch
type ConfigSpec ¶
type ConfigSpec struct {
Match ConfigMatch `yaml:"match"`
}
ConfigSpec spec field for ConfigYaml, it contains different fields than ConstraintSpec
type ConfigYaml ¶
type ConfigYaml struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Metadata Metadata `yaml:"metadata"` Spec ConfigSpec `yaml:"spec"` }
ConfigYaml all the structs that make up a gatekeeper Config are nested in this struct, Configs and Constraints are similar K8s objects, but require different Specs
type ConstraintKinds ¶
type ConstraintKinds []struct { APIGroups []string `yaml:"apiGroups"` Kinds []string `yaml:"kinds"` }
ConstraintKinds field
type ConstraintMatch ¶
type ConstraintMatch struct { ExcludedNamespaces []string `yaml:"excludedNamespaces"` Kinds ConstraintKinds `yaml:"kinds"` }
ConstraintMatch match field for ConstraintYaml, it contains different fields than ConfigMatch
type ConstraintParameters ¶
type ConstraintParameters struct {
Namespaces []string `yaml:"namespaces"`
}
ConstraintParameters field
type ConstraintSpec ¶
type ConstraintSpec struct { EnforcementAction string `yaml:"enforcementAction"` Match ConstraintMatch `yaml:"match"` Parameters ConstraintParameters `yaml:"parameters"` }
ConstraintSpec spec field for ConstraintYaml, it contains different fields than ConfigSpec
type ConstraintYaml ¶
type ConstraintYaml struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Metadata Metadata `yaml:"metadata"` Spec ConstraintSpec `yaml:"spec"` }
ConstraintYaml All the structs that make up a gatekeeper Constraint are nested in this struct, Configs and Constraints are similar K8s objects, but require different Specs