Skip to content

Conversation

@Cali0707
Copy link
Collaborator

@Cali0707 Cali0707 commented Oct 8, 2025

This PR enables adding other ManagerProvider implementations more easily in downstream repos such as the openshift-mcp-server, without introducing any git conflicts between the two

Relates/follows up to #348
Relates to #83

Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

Comment on lines +15 to +25
var providerFactories = make(map[string]ProviderFactory)

// RegisterProvider registers a provider factory for a given strategy name.
// This should be called from init() functions in provider implementation files.
// Panics if a provider is already registered for the given strategy.
func RegisterProvider(strategy string, factory ProviderFactory) {
if _, exists := providerFactories[strategy]; exists {
panic(fmt.Sprintf("provider already registered for strategy '%s'", strategy))
}
providerFactories[strategy] = factory
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ This is exactly what I was thinking of

@manusa manusa added this to the 0.1.0 milestone Oct 9, 2025
@manusa manusa merged commit 31e90fb into containers:main Oct 9, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants