Skip to content

Incompatibility with WSO2 AM 4.1.0 for API creation #621

@MioOgbeni

Description

@MioOgbeni

Description:
Im using WSO2 APIM 4.1.0 deployed in K8S cluster and I want to use k8s-api-operator for creation of WSO2 APIs from K8S CRDs. When I configured all needed credentials and endpoint and want to let k8s-api-operator to create API in WSO2 APIM . Then I found out that k8s-api-operator using hard-coded publisher endpoint [here] API v2 for listing APIs but in WSO2 APIM 4.1.0 is only avilable publisher API v3.

Affected Product Version:
2.0.3

OS, DB, other environment details and versions:
WSO2 APIM 4.1.0 installed from single instance helm chart here
WSO2 k8s-api-operator 2.0.3 installed form manifest here
Deployed to K8S 1.25.5

Steps to reproduce:

  • Deploy APIM 4.1.0
  • Deploy k8s-api-operator 2.0.3
  • Configure valid in-cluster apimKeymanagerEndpoint, apimPublisherEndpoint, apimTokenEndpoint and WSO2 APIM secrets for k8s-api-operator
  • Deploy swagger openApi definition as CM into cluster for desired application.
  • Deploy API resource with spec swaggerConfigMapName
  • In k8s-api-operator logs will be displayed this
    {"level":"info","ts":1675420439.1297846,"logger":"api.controller","msg":"Reconciling API","request_namespace":"tn-playground-wso2","request_name":"ruian-api"}
    {"level":"info","ts":1675420439.2181957,"logger":"apim.login","msg":"Getting clientId and clientSecret from memory"}
    {"level":"info","ts":1675420439.3174286,"logger":"apim.import","msg":"Importing API using swagger"}
    {"level":"info","ts":1675420439.323991,"logger":"swagger","msg":"Swagger version","version":"3.0.1"}
    {"level":"error","ts":1675420439.354647,"logger":"apim.import","msg":"Error when importing the API using swagger","error":"Unable to GET APIs. Status:404 ","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/ubuntu/go/pkg/mod/github.com/go-logr/zapr@v0.2.0/zapr.go:132\ngithub.com/wso2/k8s-api-operator/api-operator/pkg/apim.ImportAPI\n\tapi-operator/pkg/apim/importAPI.go:94\ngithub.com/wso2/k8s-api-operator/api-operator/pkg/controller/api.(*ReconcileAPI).Reconcile\n\tapi-operator/pkg/controller/api/api_controller.go:180\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/ubuntu/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/ubuntu/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/home/ubuntu/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/home/ubuntu/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/home/ubuntu/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/ubuntu/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/home/ubuntu/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/util/wait/wait.go:90"}
    E0203 10:33:59.354787       1 event.go:334] Unsupported event type: 'Error'
    {"level":"error","ts":1675420439.3548555,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"api-controller","request":"tn-playground-wso2/ruian-api","error":"Unable to GET APIs. Status:404 ","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/ubuntu/go/pkg/mod/github.com/go-logr/zapr@v0.2.0/zapr.go:132\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/ubuntu/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/ubuntu/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/home/ubuntu/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.6.0/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/home/ubuntu/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/home/ubuntu/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/ubuntu/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/home/ubuntu/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/util/wait/wait.go:90"}
    

Can be also reproduced from Postman

  • GET request to http://WSO2_APIM_HOST:WSO2_APIM_PORT/api/am/publisher/v2/apis will end with status code 404
  • GET request to http://WSO2_APIM_HOST:WSO2_APIM_PORT/api/am/publisher/v3/apis will end with status code 200 and return list of APIs

For now I will downgrade my WSO2 APIM to version 4.0.0 as quick fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions