Documentation ¶
Index ¶
- Constants
- Variables
- func AddNode(ctx context.Context, k8sClient client.Client) error
- func CreateDNSClass(ctx context.Context, k8sClient client.Client, dnsclass client.Object) error
- func DeleteDNSClass(ctx context.Context, k8sClient client.Client, dnsclass client.Object) error
- func DeleteNode(ctx context.Context, k8sClient client.Client) error
- func GetDNSClass(ctx context.Context, k8sClient client.Client, dnsclass client.Object) error
- func GetDummyConfig(url string, k8sManager manager.Manager) *rest.Config
- func GetNonEmptyLines(output string) []string
- func GetProjectDir() (string, error)
- func InstallCertManager() error
- func InstallPrometheusOperator() error
- func LoadImageToKindClusterWithName(name string) error
- func Run(cmd *exec.Cmd) ([]byte, error)
- func UninstallCertManager()
- func UninstallPrometheusOperator()
Constants ¶
View Source
const ( ClusterDomain = "cluster.local" ClusterDNS = "10.96.0.10" NodeName = "dummy-node" )
Variables ¶
View Source
var MockResponse interface{} = map[string]interface{}{ "kubeletconfig": map[string]interface{}{ "clusterDomain": ClusterDomain, "clusterDNS": []string{ClusterDNS}, }, }
View Source
var MockServer = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == fmt.Sprintf("/api/v1/nodes/%s/proxy/configz", NodeName) { w.Header().Set("Content-Type", "application/json") if MockResponse == nil { MockResponse = map[string]interface{}{ "kubeletconfig": map[string]interface{}{ "clusterDomain": ClusterDomain, "clusterDNS": []string{ClusterDNS}, }, } } _ = json.NewEncoder(w).Encode(MockResponse) } else { http.NotFound(w, r) } }))
Starts a mock server to simulate the kubelet /configz endpoint
Functions ¶
func CreateDNSClass ¶ added in v0.2.0
func DeleteDNSClass ¶ added in v0.2.0
func DeleteNode ¶ added in v0.3.0
func GetDNSClass ¶ added in v0.2.0
func GetDummyConfig ¶ added in v0.3.0
func GetNonEmptyLines ¶
GetNonEmptyLines converts given command output string into individual objects according to line breakers, and ignores the empty elements in it.
func GetProjectDir ¶
GetProjectDir will return the directory where the project is
func InstallCertManager ¶
func InstallCertManager() error
InstallCertManager installs the cert manager bundle.
func InstallPrometheusOperator ¶
func InstallPrometheusOperator() error
InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics.
func LoadImageToKindClusterWithName ¶
LoadImageToKindCluster loads a local docker image to the kind cluster
func UninstallCertManager ¶
func UninstallCertManager()
UninstallCertManager uninstalls the cert manager
func UninstallPrometheusOperator ¶
func UninstallPrometheusOperator()
UninstallPrometheusOperator uninstalls the prometheus
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.