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

Incompatibility with WSO2 AM 4.1.0 for API creation #621

Open
MioOgbeni opened this issue Feb 3, 2023 · 0 comments
Open

Incompatibility with WSO2 AM 4.1.0 for API creation #621

MioOgbeni opened this issue Feb 3, 2023 · 0 comments

Comments

@MioOgbeni
Copy link

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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/home/ubuntu/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/home/ubuntu/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/ubuntu/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/home/ubuntu/go/pkg/mod/k8s.io/[email protected]/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/[email protected]/zapr.go:132\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/ubuntu/go/pkg/mod/sigs.k8s.io/[email protected]/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/[email protected]/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/[email protected]/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/home/ubuntu/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/home/ubuntu/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/ubuntu/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/home/ubuntu/go/pkg/mod/k8s.io/[email protected]/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant