Documentation ¶
Index ¶
- func ApplyApiRule(toExecute RetryableApiRule, onRetry RetryableApiRule, ...) error
- func ApplyApiRuleV2Alpha1(toExecute RetryableApiRule, onRetry RetryableApiRule, ...) error
- func ApplyApiRuleV2Alpha1ExpectError(toExecute RetryableApiRule, onRetry RetryableApiRule, ...) error
- func CheckGardenerCRD(resourceMgr *resource.Manager, k8sClient dynamic.Interface) error
- func GenerateRandomString(length int) string
- func GenerateRandomTestId() string
- func GetGardenerDomain(resourceMgr *resource.Manager, k8sClient dynamic.Interface) (string, error)
- func GetLoadBalancerIp(loadBalancerIngress map[string]interface{}) (net.IP, error)
- func HasAPIRuleStatus(apiRuleUnstructured *unstructured.Unstructured, status string) (bool, error)
- func IsGardenerDetected(resourceMgr *resource.Manager, k8sClient dynamic.Interface) bool
- func LoadFile(filePath string) ([]byte, error)
- func UpdateApiRule(resourceManager *resource.Manager, k8sClient dynamic.Interface, ...) error
- func WaitForDeployment(resourceMgr *resource.Manager, k8sClient dynamic.Interface, namespace string, ...) error
- type ApiRuleStatusV1beta1
- type ApiRuleStatusV2alpha1
- type BodyContainsPredicate
- type HttpResponseAsserter
- type OIDCConfiguration
- type RequestOptions
- type RetryableApiRule
- type RetryableHttpClient
- func (h *RetryableHttpClient) CallEndpointWithHeadersAndMethod(requestHeaders map[string]string, url string, method string, ...) error
- func (h *RetryableHttpClient) CallEndpointWithHeadersWithRetries(requestHeaders map[string]string, url string, validator HttpResponseAsserter) error
- func (h *RetryableHttpClient) CallEndpointWithRequest(req *http.Request, url string, validator HttpResponseAsserter) error
- func (h *RetryableHttpClient) CallEndpointWithRetries(url string, validator HttpResponseAsserter) error
- func (h *RetryableHttpClient) CallEndpointWithRetriesAndGetResponse(headers map[string]string, body io.Reader, method, url string) (*http.Response, error)
- type StatusPredicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyApiRule ¶
func ApplyApiRule(toExecute RetryableApiRule, onRetry RetryableApiRule, k8sClient dynamic.Interface, retryOpts []retry.Option, resources []unstructured.Unstructured) error
ApplyApiRule tries toExecute function and retries with onRetry if APIRule status is in error status or has no status code. This function works for both v1beta1 and v2alpha1 versions of APIRule.
func ApplyApiRuleV2Alpha1 ¶
func ApplyApiRuleV2Alpha1(toExecute RetryableApiRule, onRetry RetryableApiRule, k8sClient dynamic.Interface, retryOpts []retry.Option, resources []unstructured.Unstructured) error
func ApplyApiRuleV2Alpha1ExpectError ¶
func ApplyApiRuleV2Alpha1ExpectError(toExecute RetryableApiRule, onRetry RetryableApiRule, k8sClient dynamic.Interface, retryOpts []retry.Option, resources []unstructured.Unstructured, errorMessage string) error
func CheckGardenerCRD ¶
func GenerateRandomString ¶
func GenerateRandomTestId ¶
func GenerateRandomTestId() string
func GetGardenerDomain ¶
func GetLoadBalancerIp ¶
GetLoadBalancerIp returns the IP of the load balancer from the load balancer ingress object
func HasAPIRuleStatus ¶
func HasAPIRuleStatus(apiRuleUnstructured *unstructured.Unstructured, status string) (bool, error)
func IsGardenerDetected ¶
func UpdateApiRule ¶
func UpdateApiRule(resourceManager *resource.Manager, k8sClient dynamic.Interface, retryOpts []retry.Option, resources []unstructured.Unstructured) error
Types ¶
type ApiRuleStatusV1beta1 ¶
type ApiRuleStatusV1beta1 struct { Status struct { APIRuleStatus struct { Code string `json:"code"` Description string `json:"desc"` } `json:"APIRuleStatus"` } `json:"status"` }
func GetAPIRuleStatusV1beta1 ¶
func GetAPIRuleStatusV1beta1(apiRuleUnstructured *unstructured.Unstructured) (ApiRuleStatusV1beta1, error)
type ApiRuleStatusV2alpha1 ¶
type ApiRuleStatusV2alpha1 struct { Status struct { State string `json:"state"` Description string `json:"description"` } `json:"status"` }
func GetAPIRuleStatusV2Alpha1 ¶
func GetAPIRuleStatusV2Alpha1(apiRuleUnstructured *unstructured.Unstructured) (ApiRuleStatusV2alpha1, error)
type BodyContainsPredicate ¶
type BodyContainsPredicate struct {
Expected []string
}
BodyContainsPredicate is a struct representing desired HTTP response body containing expected strings
type HttpResponseAsserter ¶
type OIDCConfiguration ¶
type OIDCConfiguration struct { Issuer string `json:"issuer"` AuthorizationEndpoint string `json:"authorization_endpoint"` TokenEndpoint string `json:"token_endpoint"` UserinfoEndpoint string `json:"userinfo_endpoint"` EndSessionEndpoint string `json:"end_session_endpoint"` JwksUri string `json:"jwks_uri"` IntrospectionEndpoint string `json:"introspection_endpoint"` RevocationEndpoint string `json:"revocation_endpoint"` ResponseTypesSupported []string `json:"response_types_supported"` GrantTypesSupported []string `json:"grant_types_supported"` SubjectTypesSupported []string `json:"subject_types_supported"` IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"` ScopesSupported []string `json:"scopes_supported"` TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"` ClaimsSupported []string `json:"claims_supported"` CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported"` TlsClientCertificateBoundAccessTokens bool `json:"tls_client_certificate_bound_access_tokens"` FrontchannelLogoutSupported bool `json:"frontchannel_logout_supported"` FrontchannelLogoutSessionSupported bool `json:"frontchannel_logout_session_supported"` }
func GetOIDCConfiguration ¶
func GetOIDCConfiguration(oidcConfigurationEndpoint string) (oidcConfiguration OIDCConfiguration, err error)
type RequestOptions ¶
type RetryableApiRule ¶
type RetryableApiRule func(k8sClient dynamic.Interface, resources ...unstructured.Unstructured) (*unstructured.Unstructured, error)
RetryableApiRule wraps any function that modifies or creates an APIRule
type RetryableHttpClient ¶
type RetryableHttpClient struct {
// contains filtered or unexported fields
}
func NewClientWithRetry ¶
func NewClientWithRetry(c *http.Client, opts []retry.Option) *RetryableHttpClient
func (*RetryableHttpClient) CallEndpointWithHeadersAndMethod ¶
func (h *RetryableHttpClient) CallEndpointWithHeadersAndMethod(requestHeaders map[string]string, url string, method string, validator HttpResponseAsserter) error
CallEndpointWithHeadersAndMethod calls given url with given method and headers. Returns error if the status code is not in between bounds of status predicate after retrying deadline is reached
func (*RetryableHttpClient) CallEndpointWithHeadersWithRetries ¶
func (h *RetryableHttpClient) CallEndpointWithHeadersWithRetries(requestHeaders map[string]string, url string, validator HttpResponseAsserter) error
CallEndpointWithHeadersWithRetries calls given url with headers and GET method. Returns error if the status code is not in between bounds of status predicate after retrying deadline is reached
func (*RetryableHttpClient) CallEndpointWithRequest ¶
func (h *RetryableHttpClient) CallEndpointWithRequest(req *http.Request, url string, validator HttpResponseAsserter) error
func (*RetryableHttpClient) CallEndpointWithRetries ¶
func (h *RetryableHttpClient) CallEndpointWithRetries(url string, validator HttpResponseAsserter) error
CallEndpointWithRetries returns error if the status code is not in between bounds of status predicate after retrying deadline is reached
type StatusPredicate ¶
StatusPredicate is a struct representing desired endpoint call response status code, that is between LowerStatusBound and UpperStatusBound