Skip to content

Refactor GetLoggingConfig method #8712

@Cali0707

Description

@Cali0707

We have the same function public in cmd/broker:

func GetLoggingConfig(ctx context.Context, namespace, loggingConfigMapName string) (*logging.Config, error) {
loggingConfigMap, err := kubeclient.Get(ctx).CoreV1().ConfigMaps(namespace).Get(ctx, loggingConfigMapName, metav1.GetOptions{})
if apierrors.IsNotFound(err) {
return logging.NewConfigFromMap(nil)
} else if err != nil {
return nil, err
}
return logging.NewConfigFromConfigMap(loggingConfigMap)
}
. Could be reused (but can be done in a follow up PR, as other cmds might have the same)

Originally posted by @creydr in #8699 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions