serverless / serverless-kubeless

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

Unable to deploy function with camelCase kafka topic as trigger #162

Closed dimagoldin closed 5 years ago

dimagoldin commented 5 years ago

Used the following serverless.yaml to deploy function:

# Welcome to Serverless!
#
# For full config options, check the kubeless plugin docs:
#    https://github.com/serverless/serverless-kubeless
#
# For documentation on kubeless itself:
#    http://kubeless.io

# Update the service name below with your own service name
service: kubeless-python-functions

# Please ensure the serverless-kubeless provider plugin is installed globally.
# $ npm install -g serverless-kubeless
#
# ...before installing project dependencies to register this provider.
# $ npm install

provider:
  name: kubeless
  runtime: python3.6

plugins:
  - serverless-kubeless

functions:
  my-function-py:
    handler: handler.handle
    events:
      - trigger: 'CamelCaseTopicName'

Received This Error:

Found errors while processing the given functions:
KafkaTrigger.kubeless.io "my-function-py-CamelCaseTopicName" is invalid: metadata.name: Invalid value: "my-function-py-CamelCaseTopicName": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

The Problem: I have a kafka topic which is camelCase named, which i cannot rename, so i am unable to deploy functions with this topic as trigger using the serverless framework.

Expected Behavior: trigger name would be automatically changed to a valid name

P.S Opening this issue to get an issue ID for the PR i made