Documentation
¶
Index ¶
- func DeleteAgent(name, namespace string) error
- func GetNonEmptyLines(output string) []string
- func GetProjectDir() (string, error)
- func GetRequestWithStatus(url string) ([]byte, int, error)
- func InstallCertManager() error
- func InstallPrometheusOperator() error
- func IsCertManagerCRDsInstalled() bool
- func IsPrometheusCRDsInstalled() bool
- func LoadImageToKindClusterWithName(name string) error
- func MakeServiceGet(namespace, serviceName string, servicePort int, endpoint string) ([]byte, int, error)
- func MakeServicePost(namespace, serviceName string, servicePort int, endpoint string, ...) ([]byte, int, error)
- func MakeServiceRequest(namespace, serviceName string, servicePort int, requestFunc RequestFunc) (body []byte, statusCode int, err error)
- func PortForwardPod(ctx context.Context, namespace, podName string, port int) (int, error)
- func PortForwardService(ctx context.Context, namespace, serviceName string, port int) (int, error)
- func PostRequestWithStatus(url string, payload any) ([]byte, int, error)
- func Run(cmd *exec.Cmd) (string, error)
- func UninstallCertManager()
- func UninstallPrometheusOperator()
- func VerifyDeploymentReady(name, namespace string, timeout time.Duration) error
- type RequestFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAgent ¶ added in v0.11.0
DeleteAgent deletes an agent resource
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 GetRequestWithStatus ¶ added in v0.11.0
GetRequestWithStatus sends a GET request and returns the response body, status code, and error. This function does not treat non-200 status codes as errors, allowing callers to explicitly check for specific status codes like 404.
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 IsCertManagerCRDsInstalled ¶
func IsCertManagerCRDsInstalled() bool
IsCertManagerCRDsInstalled checks if any Cert Manager CRDs are installed by verifying the existence of key CRDs related to Cert Manager.
func IsPrometheusCRDsInstalled ¶
func IsPrometheusCRDsInstalled() bool
IsPrometheusCRDsInstalled checks if any Prometheus CRDs are installed by verifying the existence of key CRDs related to Prometheus.
func LoadImageToKindClusterWithName ¶
LoadImageToKindClusterWithName loads a local docker image to the kind cluster
func MakeServiceGet ¶ added in v0.11.0
func MakeServiceGet(namespace, serviceName string, servicePort int, endpoint string) ([]byte, int, error)
MakeServiceGet is a convenience wrapper for GET requests to a Kubernetes service.
func MakeServicePost ¶ added in v0.11.0
func MakeServicePost( namespace, serviceName string, servicePort int, endpoint string, payload interface{}, ) ([]byte, int, error)
MakeServicePost is a convenience wrapper for POST requests to a Kubernetes service.
func MakeServiceRequest ¶ added in v0.11.0
func MakeServiceRequest( namespace, serviceName string, servicePort int, requestFunc RequestFunc, ) (body []byte, statusCode int, err error)
MakeServiceRequest establishes a port-forward to the service, makes an HTTP request, and cleans up. The requestFunc receives the base URL (e.g., "http://localhost:12345") and performs the actual request. Non-2xx HTTP status codes are returned successfully (not treated as errors), allowing callers to verify specific status codes like 404.
func PortForwardPod ¶ added in v0.11.0
PortForwardPod creates a port forward to a specific pod
func PortForwardService ¶ added in v0.11.0
PortForwardService creates a port forward to a service by resolving it to a pod
func PostRequestWithStatus ¶ added in v0.11.0
PostRequestWithStatus sends a POST request with a JSON payload and returns the response body, status code, and error. This function does not treat non-200 status codes as errors, allowing callers to explicitly check for specific status codes.
func UninstallCertManager ¶
func UninstallCertManager()
UninstallCertManager uninstalls the cert manager
func UninstallPrometheusOperator ¶
func UninstallPrometheusOperator()
UninstallPrometheusOperator uninstalls the prometheus