serverless / serverless-kubeless

This plugin enables support for Kubeless within the Serverless Framework.
Apache License 2.0
303 stars 80 forks source link

--package option does not work for individualy packaged deployments #190

Closed ddoowa closed 4 years ago

ddoowa commented 4 years ago

I have my build to package individually and built using webpack. when doing a serverless deploy everything works fine, as it picks up the artifact needed to deploy via setting that's injected during the package phase, how ever. when running serverless deploy -p .serverless/ or `serverless deploy --package .serverless/' i get an error.

however doing serverless deploy -p .serverless/func1.zip happly deploys func1 to ALL the functions, so func2 and 3 have func1 as there base encoded zip.

it seems that the --p and --package only support a single zip package deployment and does not cater for individually packaged deployments, as inspected in the deployFunction logic below

kubelessConfig.init().then(() => {
        _.each(this.serverless.service.functions, (description, name) => {

          const pkg = this.options.package ||
            this.serverless.service.package.path ||
            this.serverless.service.package.artifact ||
            description.package.artifact ||
            this.serverless.config.serverless.service.artifact;
andresmgot commented 4 years ago

That's correct, right now that's not supported. At the moment, we don't have the bandwidth to work on this but we welcome any PR or contribution possible! Let me know if you can give this a try, I can help you with any issue you find.

ddoowa commented 4 years ago

Thanks @andresmgot , just working on it now, will raise a PR very soon, is there any prerequisites i should know about

andresmgot commented 4 years ago

not really, the CI will pick up your changes and test them. We can take it from there.