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

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.triage/acceptedIssues which should be fixed (post-triage)

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions