Documentation
¶
Index ¶
- func CheckGardenerCRD(resourceMgr *resource.Manager, k8sClient dynamic.Interface) error
- func CreateApiRule(resourceMgr *resource.Manager, k8sClient dynamic.Interface, ...) error
- func CreateApiRuleV2Alpha1(resourceMgr *resource.Manager, k8sClient dynamic.Interface, ...) error
- func CreateApiRuleV2Alpha1ExpectError(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 GetLoadBalancerIngress(k8sClient dynamic.Interface, svcName string, svcNamespace string) (map[string]interface{}, 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(resourceMgr *resource.Manager, k8sClient dynamic.Interface, ...) error
- func WaitForDeployment(resourceMgr *resource.Manager, k8sClient dynamic.Interface, namespace string, ...) error
- func WaitForRateLimit(resourceMgr *resource.Manager, k8sClient dynamic.Interface, namespace string, ...) error
- type ApiRuleStatusV1beta1
- type ApiRuleStatusV2alpha1
- type BodyContainsPredicate
- type HttpResponseAsserter
- type OIDCConfiguration
- type RequestOptions
- 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) CallEndpointWithRequestRetry(req *http.Request, 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)
- func (h *RetryableHttpClient) HttpClient() *http.Client
- type StatusPredicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckGardenerCRD ¶
func CreateApiRule ¶
func CreateApiRule(resourceMgr *resource.Manager, k8sClient dynamic.Interface, retryOpts []retry.Option, apiRuleResource unstructured.Unstructured) error
CreateApiRule creates APIRule and waits for its status This function works for both v1beta1 and v2alpha1 versions of APIRule.
func CreateApiRuleV2Alpha1 ¶
func CreateApiRuleV2Alpha1(resourceMgr *resource.Manager, k8sClient dynamic.Interface, retryOpts []retry.Option, apiRuleResource unstructured.Unstructured) error
func CreateApiRuleV2Alpha1ExpectError ¶
func CreateApiRuleV2Alpha1ExpectError(resourceMgr *resource.Manager, k8sClient dynamic.Interface, retryOpts []retry.Option, apiRuleResource unstructured.Unstructured, errorMessage string) error
func GenerateRandomString ¶
func GenerateRandomTestId ¶
func GenerateRandomTestId() string
func GetGardenerDomain ¶
func GetLoadBalancerIngress ¶
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(resourceMgr *resource.Manager, k8sClient dynamic.Interface, retryOpts []retry.Option, apiRuleResource unstructured.Unstructured) error
func WaitForDeployment ¶
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 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) CallEndpointWithRequestRetry ¶
func (h *RetryableHttpClient) CallEndpointWithRequestRetry(req *http.Request, 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
func (*RetryableHttpClient) CallEndpointWithRetriesAndGetResponse ¶
func (*RetryableHttpClient) HttpClient ¶
func (h *RetryableHttpClient) HttpClient() *http.Client
type StatusPredicate ¶
StatusPredicate is a struct representing desired endpoint call response status code, that is between LowerStatusBound and UpperStatusBound