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

Fix several issues related to APIM APK Agent #1146

Merged
merged 2 commits into from
Apr 7, 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
6 changes: 3 additions & 3 deletions apim-apk-agent/pkg/managementserver/rest_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func StartInternalServer(port uint) {
if err == nil {
envLabel = cpConfig.ControlPlane.EnvironmentLabels
}
gin.SetMode(gin.ReleaseMode)
r := gin.Default()

r.GET("/applications", func(c *gin.Context) {
Expand Down Expand Up @@ -108,7 +109,7 @@ func StartInternalServer(port uint) {
if err := utils.CreateZipFile(&buf, zipFiles); err != nil {
logger.LoggerMgtServer.Errorf("Error while creating apim zip file for api uuid: %s. Error: %+v", event.API.APIUUID, err)
}

id, revisionID, err := utils.ImportAPI(fmt.Sprintf("admin-%s-%s.zip", event.API.APIName, event.API.APIVersion), &buf)
if err != nil {
logger.LoggerMgtServer.Errorf("Error while importing API. Sending error response to Adapter.")
Expand All @@ -118,7 +119,6 @@ func StartInternalServer(port uint) {
c.JSON(http.StatusOK, map[string]string{"id": id, "revisionID": revisionID})
}
})
gin.SetMode(gin.ReleaseMode)
publicKeyLocation, privateKeyLocation, _ := config.GetKeyLocations()
r.RunTLS(fmt.Sprintf(":%d", port), publicKeyLocation, privateKeyLocation)
}
Expand Down Expand Up @@ -147,7 +147,7 @@ func createAPIYaml(apiCPEvent APICPEvent) string {
apiType := "HTTP"
if apiCPEvent.API.APIType == "GraphQL" {
apiType = "GRAPHQL"
}
}
data := map[string]interface{}{
"type": "api",
"version": "v4.3.0",
Expand Down
2 changes: 2 additions & 0 deletions helm-charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:
app.kubernetes.io/app: "apim-apk-agent"
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/log-conf.yaml") . | sha256sum }}
spec:
serviceAccountName: wso2agent-platform
containers:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ metrics:
agent:
mode: CPtoDP
certmanager:
enabled: true
enabled: false
Loading