Skip to content

APIGOV-32662 - add SetRevisionOnly to ServiceBuilder to skip instance creation for shared-ID proxies#1037

Open
sbolosan wants to merge 6 commits into
mainfrom
APIGOV-32662
Open

APIGOV-32662 - add SetRevisionOnly to ServiceBuilder to skip instance creation for shared-ID proxies#1037
sbolosan wants to merge 6 commits into
mainfrom
APIGOV-32662

Conversation

@sbolosan
Copy link
Copy Markdown
Collaborator

When API Manager has multiple frontend proxies sharing the same API ID, we were creating a redundant APIServiceInstance for each one. Only one should own the instance.

To fix this, I added SetRevisionOnly() to the service builder so agents can flag a proxy as revision-only, meaning it publishes its spec but skips instance creation. The check is a simple early return inside processInstance. Added a getter IsRevisionOnly() on ServiceBody to keep it consistent with the existing pattern.

@sbolosan sbolosan marked this pull request as ready for review May 18, 2026 23:12
@jcollins-axway
Copy link
Copy Markdown
Collaborator

I do not see anything blocking the API Service update if revision only is set.

If the service does not exist we should create, but we should not update it at all.

Copy link
Copy Markdown
Collaborator

@jcollins-axway jcollins-axway left a comment

Choose a reason for hiding this comment

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

See comment

Comment thread pkg/apic/apiservice.go Outdated

if svc != nil {
serviceBody.serviceContext.serviceAction = updateAPI
c.updateAPIService(serviceBody, svc) // populates from existing service
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if svc != nil && serviceBody.IsRevisionOnly() {
 serviceBody.serviceContext.serviceName = svc.Name
 serviceBody.serviceContext.serviceID = svc.Metadata.ID
 return svc, nil
} else if svc != nil {
 serviceBody.serviceContext.serviceAction = updateAPI
 httpMethod = http.MethodPut
 serviceURL += "/" + svc.Name
 c.updateAPIService(serviceBody, svc)
} else {
 svc = c.buildAPIService(serviceBody)
}

…ID when rev only is set, skip the service update entirely
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