Skip to content

Add proxyProfile support to qdr pkg#2395

Open
ajssmith wants to merge 6 commits intoskupperproject:mainfrom
ajssmith:issue-2391
Open

Add proxyProfile support to qdr pkg#2395
ajssmith wants to merge 6 commits intoskupperproject:mainfrom
ajssmith:issue-2391

Conversation

@ajssmith
Copy link
Copy Markdown
Member

@ajssmith ajssmith commented Mar 5, 2026

Resolves #2391, Resolves #2393

@ajssmith ajssmith added the do-not-merge Work In Progress label Mar 5, 2026
for _, profile := range desired {
current, ok := actual[profile.Name]
if !ok {
if err := agent.CreateProxyProfile(profile); err != nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should it just call continue here, if err == nil?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, makes sense. Will adjust.

Comment thread internal/qdr/amqp_mgmt.go
Comment thread internal/qdr/qdr.go
@ajssmith ajssmith removed do-not-merge Work In Progress labels Apr 27, 2026
@ajssmith ajssmith requested a review from fgiorgetti April 27, 2026 16:32
Comment thread internal/kube/adaptor/config_sync.go Outdated
}

func UpdateRouterConfig(client kubernetes.Interface, ctxt context.Context, update *qdr.RouterConfig, configmap *corev1.ConfigMap) error {
return retry.RetryOnConflict(retry.DefaultRetry, func() error {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am wondering if the retry mechanism will actually work or not here.

If a conflict is found, further attempts to update it might result on a new error, unless the latest revision of the ConfigMap is retrieved, i.e.:

return updateRouterConfig(client, name, namespace, ctxt, update, labelling)

proxyConfig.Port = string(proxySecret.Data["port"])
proxyConfig.User = string(proxySecret.Data["username"])
} else {
return nil, stderrors.New("Secret not found for proxy configuration")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe include the secret name that was not found and the optional error.

Comment thread internal/kube/site/site_test.go Outdated
wantLinks: 1,
skupperErrorMessage: "NotFound",
},
// {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these tests disabled on purpose or by accident?

Comment thread internal/kube/adaptor/config_sync.go Outdated

func updateRouterConfig(client kubernetes.Interface, ctxt context.Context, update *qdr.RouterConfig, configmap *corev1.ConfigMap) error {

err := update.WriteToConfigMap(configmap)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So I understand that the latest revision of the configmap should be loaded here.


func (s *Sync) handle(key string, secret *corev1.Secret) error {
if secret == nil {
return nil
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If a proxyProfile's secret is removed, it is not being removed from: Sync.configuredProxy.

@fgiorgetti
Copy link
Copy Markdown
Member

fgiorgetti commented Apr 30, 2026

When I create a Link with no proxy configuration, I am seeing an empty proxyProfile set on the router and an error on kube-adaptor, saying ‘missing secret for profile “”’

  • Kube-adaptor error:
    2026/04/30 14:02:25 ERROR Error while handling event component=kube.watchers.eventProcessor errorKey=config-syncError eventDescription="ConfigMap east/skupper-router" error="secrets not synchronized with router config: missing secret for profile \"\""

  • Empty profile on router config:

    [
        "proxyProfile",
        {}
    ]

@fgiorgetti
Copy link
Copy Markdown
Member

Once a proxyProfile is added into the router configuration, it is not being removed.

@ajssmith ajssmith requested a review from pwright May 5, 2026 12:54
@fgiorgetti fgiorgetti self-requested a review May 5, 2026 18:05
delta.Missing = append(delta.Missing, profileName)
continue
} else {
_, err := s.handleProxyProfile(key, secret)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LLM thinks ExpectProxyProfiles may be passing the wrong key into handleProxyProfile. It fetches the secret using namespace + "/" + profileName, but then calls handleProxyProfile(key, secret), where key is the router ConfigMap key. Since handleProxyProfile stores that argument as syncContext.SecretKey, the stored key appears to become the ConfigMap key rather than the proxy Secret key.

This may not break the current path because ExpectProxyProfiles reconstructs the proxy Secret key directly, but it could make recovery or future code that reads context.SecretKey look up the wrong object. Should this pass the secret key instead?

Copy link
Copy Markdown
Member

@fgiorgetti fgiorgetti left a comment

Choose a reason for hiding this comment

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

Good stuff @ajssmith ! It is working great now.

// secrets for services with TLS enabled, and secrets and connectors for links
// as well as proxy profiles)
type ConfigSync struct {
cli internalclient.Clients
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No longer needed, right?

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.

Add proxyProfile support to kube adaptor Add proxyProfile support to qdr package

3 participants