Documentation ¶
Index ¶
- func AddAnnotations(obj metav1.Object, annotations map[string]string)
- func CreateNamespaceIfNotExist(ctx context.Context, k8sClient client.Client, namespace string) error
- func DeleteObject(ctx context.Context, k8sClient client.Client, obj *unstructured.Unstructured) (bool, error)
- func HasAnnotation(obj metav1.Object, annotation string) bool
- func HasLabel(obj metav1.Object, label string) bool
- func UpdateObject(ctx context.Context, k8sClient client.Client, obj *unstructured.Unstructured) error
- type ConfigManager
- type KafkaConfig
- type LabelsField
- type MetadataField
- type SyncServiceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAnnotations ¶
AddAnnotations adds the given annotations to the given object. if obj is nil or annotations are nil, it's a no-op.
func CreateNamespaceIfNotExist ¶
func CreateNamespaceIfNotExist(ctx context.Context, k8sClient client.Client, namespace string) error
CreateNamespaceIfNotExist creates a namespace in case it doesn't exist.
func DeleteObject ¶
func DeleteObject(ctx context.Context, k8sClient client.Client, obj *unstructured.Unstructured) (bool, error)
DeleteObject tries to delete the given object from k8s. returns error and true/false if object was deleted or not.
func HasAnnotation ¶
HasAnnotation returns a bool if the given annotation exists in annotations.
func UpdateObject ¶
func UpdateObject(ctx context.Context, k8sClient client.Client, obj *unstructured.Unstructured) error
UpdateObject function updates a given k8s object.
Types ¶
type ConfigManager ¶
type ConfigManager struct { LeafHubName string PodNameSpace string TransportType string TransportCompressionType string SpecWorkPoolSize int SpecEnforceHohRbac bool StatusDeltaCountSwitchFactor int Kafka *KafkaConfig SyncService *SyncServiceConfig }
func NewConfigManager ¶
func NewConfigManager() (*ConfigManager, error)
func (*ConfigManager) GetKafkaConfigMap ¶
func (configManager *ConfigManager) GetKafkaConfigMap() (*kafka.ConfigMap, error)
func (*ConfigManager) GetProducerKafkaConfigMap ¶
func (configManager *ConfigManager) GetProducerKafkaConfigMap() (*kafka.ConfigMap, error)
type KafkaConfig ¶
type LabelsField ¶
type LabelsField struct {
Labels map[string]struct{} `json:"f:labels"`
}
LabelsField presents a "f:labels" field subfield of metadataField.
type MetadataField ¶
type MetadataField struct {
LabelsField `json:"f:metadata"`
}
MetadataField presents a "f:metadata" field subfield of v1.FieldsV1.
Click to show internal directories.
Click to hide internal directories.