kubeless icon indicating copy to clipboard operation
kubeless copied to clipboard

BUG - .Net Core 2.1 - Does not handle class name casing....

Open natiki opened this issue 4 years ago • 0 comments

Hi,

Pinging @allantargino.

  • Kubeless version: v1.0.4-dirty

kubeless function deploy hw --from-file Hw.cs --handler Module.handler --dependencies Function.HelloWorld.csproj --runtime dotnetcore2.1

with Hw.cs (no namespaces):

using Kubeless.Functions;

    public class Module
    {
        public object handler(Event k8Event, Context k8Context)
        {
            return $"Hw - {k8Event.Data}";
        }
}

produces the following pod error:

Unhandled Exception: System.InvalidOperationException: Your module (Module) was not found in this assembly. at Kubeless.Core.Invokers.CompiledFunctionInvoker.TryGetType(Assembly assembly, String moduleName, Int32 namespacesCount) in /app/Kubeless.Core/Invokers/CompiledFunctionInvoker.cs:line 55 at Kubeless.Core.Invokers.CompiledFunctionInvoker.GetFunctionType(IFunction function) in /app/Kubeless.Core/Invokers/CompiledFunctionInvoker.cs:line 40 at Kubeless.WebAPI.Startup.ConfigureServices(IServiceCollection services) in /app/Kubeless.WebAPI/Startup.cs:line 31 --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services) at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices() at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize() at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at Kubeless.WebAPI.Program.Main(String[] args) in /app/Kubeless.WebAPI/Program.cs:line 18

Appears that the parser does not take case into account for the class name as module all lower works fine. It needs to allow for casing of classes.

natiki avatar Jul 10 '19 12:07 natiki