Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve logging in startup api deployments #1945

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading