kabanero-io / kabanero-pipelines

Default Kabanero Pipelines. This repo will be archived soon.
Apache License 2.0
14 stars 18 forks source link

The CRD is not updating the StackId #395

Closed oiricaud closed 4 years ago

oiricaud commented 4 years ago

Kabanero: 0.6.1

In the docs we can see

"When the product operator activates the CRD, it associates the pipelines in the pipelines archive with each of the stacks in the stack hub. The default pipelines are intended to work with all the stacks in the stack hub in the previous example. All of the pipeline-related resources (such as the tasks, trigger bindings, and pipelines) prefix the name of the resource with the keyword StackId. When the operator activates these resources, it replaces the keyword with the name of the stack it is activating."

But upon creating a new pipeline resource such as

apiVersion: tekton.dev/v1alpha1
kind: TriggerBinding
metadata:
  name: StackId-mcm-pl-pullrequest-binding

I get

\"StackId-mcm-pl\" is invalid: metadata.name: Invalid value: \"StackId-mcm-pl\": 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])?)*')} 

It appears the Regex only accepts lower case letters.

I added a new pipeline object with id nodejs-mcm in my CRD


    stacks:
      repositories:
      - https:
          name: central
          url: https://github.com/kabanero-io/kabanero-stack-hub/releases/download/0.6.3/kabanero-stack-hub-index.yaml
      - https:
          name: custom-node-stack
          url: https://github.com/odrodrig/custom-node-stack/releases/download/0.5.0/custom-node-stack-index.yaml
      pipelines:
      - https:
          url: https://github.com/kabanero-io/kabanero-pipelines/releases/download/0.6.1/default-kabanero-pipelines.tar.gz
        id: default
        sha256: 64aee2805d36127c2f1e0e5f0fc6fdae5cef19360c1bb506137584f3bd0988cc
      - https:
          url: https://github.com/oiricaud/devops-demo-kabanero-pipelines/releases/download/v1.31/default-kabanero-pipelines.tar.gz
        id: nodejs-mcm
        sha256: cfbe25c9650304601273fac167521a1c1c73e4ea2de2dd672d574abf0c033a9a

I am not sure if this is a bug or if I am missing a step, but it appears the operator is not activating these resources nor replacing the keyword name with the stack id.

I merely edited the kabanero.yaml file and changed the version and included the sha256

kvijai82 commented 4 years ago

@oiricaud you will need to specify #Kabanero! on activate substitute StackId for text 'StackId' on the first line of the yaml files where you want this substitution to happen.

oiricaud commented 4 years ago

Thank you @kvijai82 didn't realized I need to specify a comment or do you mean I need to replace StackId with the actual stack id i.e nodejs.

Do you mean a)

apiVersion: tekton.dev/v1alpha1
kind: TriggerBinding
metadata:
  name: 'StackId'-mcm-pl-pullrequest-binding

b)

apiVersion: tekton.dev/v1alpha1
kind: TriggerBinding
metadata:
  name: nodejs-mcm-pl-pullrequest-binding

c)

#Kabanero! on activate substitute StackId for text 'StackId' 
apiVersion: tekton.dev/v1alpha1
kind: TriggerBinding
metadata:
  name: StackId-mcm-pl-pullrequest-binding
kvijai82 commented 4 years ago

You can do either. If you want the pipeline you are writing to get activated individually for all the stacks in your stackhub, adding that comment will get you a separate pipeline for each stack with the StackId replaced by the stack name. If you only want one instance of your pipeline to be activated, you can just replace StackId in your pipeline name with just nodejs or not specify a stack name at all if it applies to multiple stacks.

On Thu, Jun 4, 2020 at 12:11 PM Oscar Ricaud notifications@github.com wrote:

Thank you @kvijai82 https://github.com/kvijai82 didn't realized I need to specify a comment or do you mean I need to replace StackId with the actual stack id i.e nodejs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kabanero-io/kabanero-pipelines/issues/395#issuecomment-638955595, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBUMTKNFOZV2XGZC36QXB3RU7BSFANCNFSM4NSX3XKQ .

oiricaud commented 4 years ago

Thanks you are a legend!

Screen Shot 2020-06-04 at 12 08 46 PM
kvijai82 commented 4 years ago

Glad it worked out!

On Thu, Jun 4, 2020 at 1:09 PM Oscar Ricaud notifications@github.com wrote:

Closed #395 https://github.com/kabanero-io/kabanero-pipelines/issues/395 .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kabanero-io/kabanero-pipelines/issues/395#event-3407888269, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADBUMTLG2X54WYVBNNG75S3RU7ILJANCNFSM4NSX3XKQ .