Documentation ¶
Overview ¶
Package handlers is a generated GoMock package.
Index ¶
- Constants
- func GetKubeAzureSubject(namespace, saName string) string
- func GetMapValue[T any](collection any, key string) (T, error)
- func NewDeploymentWaiter(clientSet k8s.Interface) *deploymentWaiter
- func NewHTTPProxyWaiter(dynamicClientSet dynamic.Interface) *httpProxyWaiter
- func ValidateResourceIDsForResource(properties map[string]string, keys ...string) error
- type DeleteOptions
- type MockResourceHandler
- type MockResourceHandlerDeleteCall
- func (c *MockResourceHandlerDeleteCall) Do(f func(context.Context, *DeleteOptions) error) *MockResourceHandlerDeleteCall
- func (c *MockResourceHandlerDeleteCall) DoAndReturn(f func(context.Context, *DeleteOptions) error) *MockResourceHandlerDeleteCall
- func (c *MockResourceHandlerDeleteCall) Return(arg0 error) *MockResourceHandlerDeleteCall
- type MockResourceHandlerMockRecorder
- type MockResourceHandlerPutCall
- func (c *MockResourceHandlerPutCall) Do(f func(context.Context, *PutOptions) (map[string]string, error)) *MockResourceHandlerPutCall
- func (c *MockResourceHandlerPutCall) DoAndReturn(f func(context.Context, *PutOptions) (map[string]string, error)) *MockResourceHandlerPutCall
- func (c *MockResourceHandlerPutCall) Return(arg0 map[string]string, arg1 error) *MockResourceHandlerPutCall
- type PutOptions
- type ResourceHandler
- func NewARMHandler(arm *armauth.ArmConfig) ResourceHandler
- func NewAzureFederatedIdentity(arm *armauth.ArmConfig) ResourceHandler
- func NewAzureRoleAssignmentHandler(arm *armauth.ArmConfig) ResourceHandler
- func NewAzureUserAssignedManagedIdentityHandler(arm *armauth.ArmConfig) ResourceHandler
- func NewKubernetesHandler(client client.Client, clientSet k8s.Interface, ...) ResourceHandler
- type ResourceWaiter
Constants ¶
const ( // AzureFederatedIdentityAudience represents the Azure AD OIDC target audience. AzureFederatedIdentityAudience = "api://AzureADTokenExchange" // FederatedIdentityNameKey is the key to represent the federated identity credential name (aka workload identity). FederatedIdentityNameKey = "federatedidentityname" // FederatedIdentityIssuerKey is the key to represent the oidc issuer. FederatedIdentityIssuerKey = "federatedidentityissuer" // FederatedIdentitySubjectKey is the key to represent the identity subject. FederatedIdentitySubjectKey = "federatedidentitysubject" )
const ( RoleNameKey = "rolename" // RoleAssignmentScope is used to pass the fully qualified identifier of the resource for which the role assignment needs to be created RoleAssignmentScope = "roleassignmentscope" )
const ( IdentityProperties = "identityproperties" UserAssignedIdentityNameKey = "userassignedidentityname" UserAssignedIdentityIDKey = "userassignedidentityid" UserAssignedIdentityPrincipalIDKey = "userassignedidentityprincipalid" UserAssignedIdentityClientIDKey = "userassignedidentityclientid" UserAssignedIdentityTenantIDKey = "userassignedidentitytenantid" UserAssignedIdentitySubscriptionID = "userassignedidentitysubscriptionid" UserAssignedIdentityResourceGroup = "userassignedidentityresourcegroup" )
const ( MaxHTTPProxyDeploymentTimeout = time.Minute * time.Duration(10) HTTPProxyConditionValid = "Valid" HTTPProxyStatusInvalid = "invalid" HTTPProxyStatusValid = "valid" )
const ( // Common K8s Keys KubernetesAPIVersionKey = "kubernetesapiversion" KubernetesKindKey = "kuberneteskind" KubernetesNamespaceKey = "kubernetesnamespace" KubernetesNameKey = "kubernetesname" ResourceName = "resourcename" )
const ( // Common Keys APIVersionKey = "kubernetesapiversion" KindKey = "kuberneteskind" NamespaceKey = "kubernetesnamespace" NameKey = "kubernetesname" ResourceNameKey = "resourcename" )
const ( // DefaultCacheResyncInterval is the interval for resyncing informer. DefaultCacheResyncInterval = time.Second * time.Duration(30) )
const ( // MaxDeploymentTimeout is the max timeout for waiting for a deployment to be ready. // Deployment duration should not reach to this timeout since async operation worker will time out context before MaxDeploymentTimeout. MaxDeploymentTimeout = time.Minute * time.Duration(10) )
Variables ¶
This section is empty.
Functions ¶
func GetKubeAzureSubject ¶
GetKubeAzureSubject constructs the federated identity subject in the format "system:serviceaccount:<namespace>:<saName>" from the given namespace and service account name.
func GetMapValue ¶
GetMapValue returns the value of a given key from a map of strings or a map of any type, or an error if the key is not found or the value is not of the expected type.
func NewDeploymentWaiter ¶
func NewHTTPProxyWaiter ¶
NewHTTPProxyWaiter returns a new instance of HTTPProxyWaiter
Types ¶
type DeleteOptions ¶
type DeleteOptions struct { // Resource represents the rendered resource. Resource *rpv1.OutputResource }
DeleteOptions represents the options for ResourceHandler.Delete.
type MockResourceHandler ¶
type MockResourceHandler struct {
// contains filtered or unexported fields
}
MockResourceHandler is a mock of ResourceHandler interface.
func NewMockResourceHandler ¶
func NewMockResourceHandler(ctrl *gomock.Controller) *MockResourceHandler
NewMockResourceHandler creates a new mock instance.
func (*MockResourceHandler) Delete ¶
func (m *MockResourceHandler) Delete(arg0 context.Context, arg1 *DeleteOptions) error
Delete mocks base method.
func (*MockResourceHandler) EXPECT ¶
func (m *MockResourceHandler) EXPECT() *MockResourceHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockResourceHandler) Put ¶
func (m *MockResourceHandler) Put(arg0 context.Context, arg1 *PutOptions) (map[string]string, error)
Put mocks base method.
type MockResourceHandlerDeleteCall ¶ added in v0.35.0
MockResourceHandlerDeleteCall wrap *gomock.Call
func (*MockResourceHandlerDeleteCall) Do ¶ added in v0.35.0
func (c *MockResourceHandlerDeleteCall) Do(f func(context.Context, *DeleteOptions) error) *MockResourceHandlerDeleteCall
Do rewrite *gomock.Call.Do
func (*MockResourceHandlerDeleteCall) DoAndReturn ¶ added in v0.35.0
func (c *MockResourceHandlerDeleteCall) DoAndReturn(f func(context.Context, *DeleteOptions) error) *MockResourceHandlerDeleteCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockResourceHandlerDeleteCall) Return ¶ added in v0.35.0
func (c *MockResourceHandlerDeleteCall) Return(arg0 error) *MockResourceHandlerDeleteCall
Return rewrite *gomock.Call.Return
type MockResourceHandlerMockRecorder ¶
type MockResourceHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockResourceHandlerMockRecorder is the mock recorder for MockResourceHandler.
func (*MockResourceHandlerMockRecorder) Delete ¶
func (mr *MockResourceHandlerMockRecorder) Delete(arg0, arg1 any) *MockResourceHandlerDeleteCall
Delete indicates an expected call of Delete.
func (*MockResourceHandlerMockRecorder) Put ¶
func (mr *MockResourceHandlerMockRecorder) Put(arg0, arg1 any) *MockResourceHandlerPutCall
Put indicates an expected call of Put.
type MockResourceHandlerPutCall ¶ added in v0.35.0
MockResourceHandlerPutCall wrap *gomock.Call
func (*MockResourceHandlerPutCall) Do ¶ added in v0.35.0
func (c *MockResourceHandlerPutCall) Do(f func(context.Context, *PutOptions) (map[string]string, error)) *MockResourceHandlerPutCall
Do rewrite *gomock.Call.Do
func (*MockResourceHandlerPutCall) DoAndReturn ¶ added in v0.35.0
func (c *MockResourceHandlerPutCall) DoAndReturn(f func(context.Context, *PutOptions) (map[string]string, error)) *MockResourceHandlerPutCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockResourceHandlerPutCall) Return ¶ added in v0.35.0
func (c *MockResourceHandlerPutCall) Return(arg0 map[string]string, arg1 error) *MockResourceHandlerPutCall
Return rewrite *gomock.Call.Return
type PutOptions ¶
type PutOptions struct { // Resource represents the rendered resource. Resource *rpv1.OutputResource // DependencyProperties is a map of output resource localID to resource properties populated during deployment in the resource handler DependencyProperties map[string]map[string]string }
PutOptions represents the options for ResourceHandler.Put.
type ResourceHandler ¶
type ResourceHandler interface { // Put deploys the rendered output resource and returns and populates the properties during deployment, // which can be used by the next resource handlers. Put(ctx context.Context, options *PutOptions) (map[string]string, error) // Delete deletes the rendered output resource. Delete(ctx context.Context, options *DeleteOptions) error }
ResourceHandler interface defines the methods that every output resource will implement
func NewARMHandler ¶
func NewARMHandler(arm *armauth.ArmConfig) ResourceHandler
NewARMHandler creates a new ARMHandler instance with the given ARM configuration, for 'generic' ARM resources.
func NewAzureFederatedIdentity ¶
func NewAzureFederatedIdentity(arm *armauth.ArmConfig) ResourceHandler
NewAzureFederatedIdentity creates a new instance of AzureFederatedIdentityHandler.
func NewAzureRoleAssignmentHandler ¶
func NewAzureRoleAssignmentHandler(arm *armauth.ArmConfig) ResourceHandler
NewAzureRoleAssignmentHandler creates a new instance of azureRoleAssignmentHandler which is used to handle Azure role assignments.
func NewAzureUserAssignedManagedIdentityHandler ¶
func NewAzureUserAssignedManagedIdentityHandler(arm *armauth.ArmConfig) ResourceHandler
NewAzureUserAssignedManagedIdentityHandler creates a new ResourceHandler for Azure User Assigned Managed Identity.
func NewKubernetesHandler ¶
func NewKubernetesHandler(client client.Client, clientSet k8s.Interface, discoveryClient discovery.ServerResourcesInterface, dynamicClientSet dynamic.Interface) ResourceHandler
NewKubernetesHandler creates a new KubernetesHandler which is used to handle Kubernetes resources.
type ResourceWaiter ¶
type ResourceWaiter interface {
// contains filtered or unexported methods
}
Create an interface for deployment waiter and http proxy waiter