APIGOV-32662 - add SetRevisionOnly to ServiceBuilder to skip instance creation for shared-ID proxies#1037
Open
sbolosan wants to merge 6 commits into
Open
APIGOV-32662 - add SetRevisionOnly to ServiceBuilder to skip instance creation for shared-ID proxies#1037sbolosan wants to merge 6 commits into
sbolosan wants to merge 6 commits into
Conversation
…nstance processing for loser proxies
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. |
…service already exists
|
|
||
| if svc != nil { | ||
| serviceBody.serviceContext.serviceAction = updateAPI | ||
| c.updateAPIService(serviceBody, svc) // populates from existing service |
Collaborator
There was a problem hiding this comment.
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
jcollins-axway
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.