Skip to content

Commit

Permalink
Merge pull request #1945 from AmaliMatharaarachchi/no-apis
Browse files Browse the repository at this point in the history
Improve logging in startup api deployments
  • Loading branch information
AmaliMatharaarachchi authored Jan 11, 2024
2 parents 531aec8 + 049ea0f commit 6523a5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions adapter/internal/operator/controllers/dp/api_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,13 @@ func (apiReconciler *APIReconciler) applyStartupAPIs() {
}
}
// Send all the API events to the channel
*apiReconciler.ch <- *combinedapiEvent
if len(combinedapiEvent.Events) > 0 {
*apiReconciler.ch <- *combinedapiEvent
loggers.LoggerAPKOperator.Info("Initial APIs were reconciled successfully")
} else {
loggers.LoggerAPKOperator.Warn("No startup APIs found")
}
xds.SetReady()
loggers.LoggerAPKOperator.Info("Initial APIs were deployed successfully")
}

// resolveAPIRefs validates following references related to the API
Expand Down
2 changes: 1 addition & 1 deletion adapter/internal/operator/synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func HandleAPILifeCycleEvents(ch *chan APIEvent, successChannel *chan SuccessEve
loggers.LoggerAPKOperator.Infof("Delete event received for %v", event.Events[0].APIDefinition.Name)
err = undeployAPIInGateway(event.Events[0])
case constants.Create:
loggers.LoggerAPKOperator.Infof("Create event received for %v", event.Events[0].APIDefinition.Name)
deployMultipleAPIsInGateway(event.Events)
case constants.Update:
loggers.LoggerAPKOperator.Infof("Update event received for %v", event.Events[0].APIDefinition.Name)
Expand Down Expand Up @@ -111,6 +110,7 @@ func undeployAPIInGateway(apiState APIState) error {
func deployMultipleAPIsInGateway(apiStates []APIState) {
updatedLabelsMap := make(map[string]struct{})
for _, apiState := range apiStates {
loggers.LoggerAPKOperator.Infof("Create event received for %v", apiState.APIDefinition.Name)
if len(apiState.OldOrganizationID) != 0 {
xds.RemoveAPIFromOrgAPIMap(string((*apiState.APIDefinition).ObjectMeta.UID), apiState.OldOrganizationID)
}
Expand Down

0 comments on commit 6523a5c

Please sign in to comment.