Documentation ¶
Overview ¶
Package utils implements the util functions
Index ¶
- Constants
- func CalculateSecretKeyMd5(secret *corev1.Secret, key string) (string, error)
- func ConvertJSONToMapStringInterface(raw *apiextensionsv1.JSON) (map[string]interface{}, error)
- func ConvertMap(input map[string]string) map[string]interface{}
- func IsManaged(object metav1.Object) bool
- type ClientCredentials
- type Duration
- type Event
- type EventSource
- type ReconcileRetryer
Constants ¶
const (
// ManagedAnnotation indicates the object is managed by the controller
ManagedAnnotation = "cloud.streamnative.io/managed"
)
Variables ¶
This section is empty.
Functions ¶
func CalculateSecretKeyMd5 ¶ added in v0.4.5
CalculateSecretKeyMd5 calculates the hash of the secret key.
func ConvertJSONToMapStringInterface ¶ added in v0.5.0
func ConvertJSONToMapStringInterface(raw *apiextensionsv1.JSON) (map[string]interface{}, error)
ConvertJSONToMapStringInterface converts a JSON object to a map[string]interface{}
func ConvertMap ¶ added in v0.5.0
ConvertMap converts a map[string]string to a map[string]interface{}
Types ¶
type ClientCredentials ¶ added in v0.5.5
type ClientCredentials struct { IssuerURL string `json:"issuerUrl,omitempty"` Audience string `json:"audience,omitempty"` Scope string `json:"scope,omitempty"` PrivateKey string `json:"privateKey,omitempty"` ClientID string `json:"clientId,omitempty"` }
ClientCredentials represents the client credentials for OAuth2
type EventSource ¶ added in v0.5.5
type EventSource struct { Log logr.Logger Events chan event.GenericEvent // contains filtered or unexported fields }
EventSource is a custom event source that can be used to trigger reconcile
func NewEventSource ¶ added in v0.5.5
func NewEventSource(log logr.Logger) *EventSource
NewEventSource creates a new EventSource
func (*EventSource) Close ¶ added in v0.5.5
func (s *EventSource) Close()
Close closes the EventSource
func (*EventSource) Contains ¶ added in v0.5.5
func (s *EventSource) Contains(key string) bool
Contains checks if the key exists in the event source
func (*EventSource) CreateIfAbsent ¶ added in v0.5.5
CreateIfAbsent triggers reconcile after delay, idempotent operation for the same key
func (*EventSource) Remove ¶ added in v0.5.5
func (s *EventSource) Remove(key string)
Remove removes the reconcile event
type ReconcileRetryer ¶ added in v0.5.5
type ReconcileRetryer struct {
// contains filtered or unexported fields
}
ReconcileRetryer is a helper to trigger reconcile with retry
func NewReconcileRetryer ¶ added in v0.5.5
func NewReconcileRetryer(maxRetries int, source *EventSource) *ReconcileRetryer
NewReconcileRetryer creates a new ReconcileRetryer
func (*ReconcileRetryer) Close ¶ added in v0.5.5
func (r *ReconcileRetryer) Close()
Close closes the ReconcileRetryer
func (*ReconcileRetryer) Contains ¶ added in v0.5.5
func (r *ReconcileRetryer) Contains(obj client.Object) bool
func (*ReconcileRetryer) CreateIfAbsent ¶ added in v0.5.5
func (r *ReconcileRetryer) CreateIfAbsent(obj client.Object)
CreateIfAbsent creates a new task if not exist
func (*ReconcileRetryer) Remove ¶ added in v0.5.5
func (r *ReconcileRetryer) Remove(obj client.Object)
Remove removes the task
func (*ReconcileRetryer) Source ¶ added in v0.5.5
func (r *ReconcileRetryer) Source() <-chan event.GenericEvent
Source returns the event source