ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

Kubernetes Artifact Generation Fails when Client Initializes with Secure Socket Config #7116

Open DimuthuMadushan opened 4 months ago

DimuthuMadushan commented 4 months ago

Description: Kubernetes and Docker artifact generation failed when the client initializes with secure socket configs. This affects to Ballerina component build in Choreo as it uses k8s build option internally.

import ballerina/http;

final http:Client extClient = check new ("http://localhost:8080", secureSocket = {
    cert: "../resources/certs/ftmt.crt"
});

service on new http:Listener(9090) {
    resource function get user(string id) returns string|error {
        http:Response res = check extClient->get("/user/" + id);
        return check res.getTextPayload();
    }
}

Error:

error: compilation failed: The compiler extension in package 'ballerina:cloud:2.11.3' failed to complete. class io.ballerina.compiler.syntax.tree.FieldAccessExpressionNode cannot be cast to class io.ballerina.compiler.syntax.tree.MappingConstructorExpressionNode (io.ballerina.compiler.syntax.tree.FieldAccessExpressionNode and io.ballerina.compiler.syntax.tree.MappingConstructorExpressionNode are in unnamed module of loader 'app')

Affected version: 2201.8.6