Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Should events for Started and Succesfull be emitted twice? #3549

Closed
Bl4d3s opened this issue Nov 20, 2020 · 7 comments
Closed

[Question] Should events for Started and Succesfull be emitted twice? #3549

Bl4d3s opened this issue Nov 20, 2020 · 7 comments

Comments

@Bl4d3s
Copy link

Bl4d3s commented Nov 20, 2020

Hello,

Im not sure wether this is supposed behavior or not:

I get certain events twice, when executing a pipeline. Especially for the Started or Succeeded states.

My problem with this is, I want to use the events (CloudEvents) for triggering certain tasks in an sink.
One example would be sending an email on pipeline finish.

My setup:
OpenShift (v4.6.3) with CodeReadyContainers on Windows (1.19.0)
Tekton Pipelines Version: v0.18.1
Tekton Triggers Version: v0.9.1

See this controller log: (first and last line are the events).

{"level":"info","ts":"2020-11-20T11:30:44.552Z","logger":"tekton.event-broadcaster","caller":"record/event.go:278","msg":"Event(v1.ObjectReference{Kind:\"PipelineRun\", Namespace:\"tekton-pipelines\", Name:\"ba--thesis-sample--test--5pdtp\", UID:\"cef7fcef-c555-4f7c-a403-3cbd42f17911\", APIVersion:\"tekton.dev/v1beta1\", ResourceVersion:\"588103\", FieldPath:\"\"}): type: 'Normal' reason: 'Started' ","commit":"2fbd24b"}
{"level":"info","ts":"2020-11-20T11:30:44.712Z","logger":"tekton","caller":"volumeclaim/pvchandler.go:67","msg":"Created PersistentVolumeClaim pvc-002dc3d32e in namespace tekton-pipelines","commit":"2fbd24b"}
{"level":"info","ts":"2020-11-20T11:30:44.750Z","logger":"tekton.github.com-tektoncd-pipeline-pkg-reconciler-pipelinerun.Reconciler","caller":"pipelinerun/affinity_assistant.go:66","msg":"Created StatefulSet affinity-assistant-002dc3d32e in namespace tekton-pipelines","commit":"2fbd24b","knative.dev/traceid":"8dc90f8b-0a92-437d-9f1a-ba5d05c7b4d3","knative.dev/key":"tekton-pipelines/ba--thesis-sample--test--5pdtp"}
{"level":"info","ts":"2020-11-20T11:30:44.750Z","logger":"tekton.github.com-tektoncd-pipeline-pkg-reconciler-pipelinerun.Reconciler","caller":"pipelinerun/pipelinerun.go:699","msg":"Creating a new TaskRun object ba--thesis-sample--test--5pdtp-load-config-vjr45","commit":"2fbd24b","knative.dev/traceid":"8dc90f8b-0a92-437d-9f1a-ba5d05c7b4d3","knative.dev/key":"tekton-pipelines/ba--thesis-sample--test--5pdtp"}
{"level":"info","ts":"2020-11-20T11:30:44.776Z","logger":"tekton.github.com-tektoncd-pipeline-pkg-reconciler-pipelinerun.Reconciler","caller":"pipelinerun/pipelinerun.go:544","msg":"PipelineRun ba--thesis-sample--test--5pdtp status is being set to &{Succeeded Unknown  {2020-11-20 11:30:44.776378721 +0000 UTC m=+14232.841383463} Running Tasks Completed: 0 (Failed: 0, Cancelled 0), Incomplete: 11, Skipped: 0}","commit":"2fbd24b","knative.dev/traceid":"8dc90f8b-0a92-437d-9f1a-ba5d05c7b4d3","knative.dev/key":"tekton-pipelines/ba--thesis-sample--test--5pdtp"}
{"level":"info","ts":"2020-11-20T11:30:44.778Z","logger":"tekton.event-broadcaster","caller":"record/event.go:278","msg":"Event(v1.ObjectReference{Kind:\"PipelineRun\", Namespace:\"tekton-pipelines\", Name:\"ba--thesis-sample--test--5pdtp\", UID:\"cef7fcef-c555-4f7c-a403-3cbd42f17911\", APIVersion:\"tekton.dev/v1beta1\", ResourceVersion:\"588103\", FieldPath:\"\"}): type: 'Normal' reason: 'Running' Tasks Completed: 0 (Failed: 0, Cancelled 0), Incomplete: 11, Skipped: 0","commit":"2fbd24b"}
{"level":"info","ts":"2020-11-20T11:30:44.789Z","logger":"tekton.event-broadcaster","caller":"record/event.go:278","msg":"Event(v1.ObjectReference{Kind:\"TaskRun\", Namespace:\"tekton-pipelines\", Name:\"ba--thesis-sample--test--5pdtp-load-config-vjr45\", UID:\"0dc17d27-4c59-4bac-8b50-6dbcd44a45c2\", APIVersion:\"tekton.dev/v1beta1\", ResourceVersion:\"588120\", FieldPath:\"\"}): type: 'Normal' reason: 'Started' ","commit":"2fbd24b"}
{"level":"info","ts":"2020-11-20T11:30:44.819Z","logger":"tekton.github.com-tektoncd-pipeline-pkg-reconciler-taskrun.Reconciler","caller":"taskrun/taskrun.go:360","msg":"Cloud Events: []","commit":"2fbd24b","knative.dev/traceid":"2f1cda3d-b69c-402f-8123-01891be49bcd","knative.dev/key":"tekton-pipelines/ba--thesis-sample--test--5pdtp-load-config-vjr45"}
{"level":"warn","ts":"2020-11-20T11:30:44.855Z","logger":"tekton.github.com-tektoncd-pipeline-pkg-reconciler-taskrun.Reconciler","caller":"artifacts/artifacts_storage.go:139","msg":"the configmap key \"location\" is empty","commit":"2fbd24b","knative.dev/traceid":"2f1cda3d-b69c-402f-8123-01891be49bcd","knative.dev/key":"tekton-pipelines/ba--thesis-sample--test--5pdtp-load-config-vjr45"}
{"level":"info","ts":"2020-11-20T11:30:44.935Z","logger":"tekton.github.com-tektoncd-pipeline-pkg-reconciler-pipelinerun.Reconciler","caller":"controller/controller.go:522","msg":"Reconcile succeeded. Time taken: 384.748353ms","commit":"2fbd24b","knative.dev/traceid":"8dc90f8b-0a92-437d-9f1a-ba5d05c7b4d3","knative.dev/key":"tekton-pipelines/ba--thesis-sample--test--5pdtp"}
{"level":"info","ts":"2020-11-20T11:30:44.937Z","logger":"tekton.event-broadcaster","caller":"record/event.go:278","msg":"Event(v1.ObjectReference{Kind:\"PipelineRun\", Namespace:\"tekton-pipelines\", Name:\"ba--thesis-sample--test--5pdtp\", UID:\"cef7fcef-c555-4f7c-a403-3cbd42f17911\", APIVersion:\"tekton.dev/v1beta1\", ResourceVersion:\"588123\", FieldPath:\"\"}): type: 'Normal' reason: 'Started' ","commit":"2fbd24b"}
@afrittoli
Copy link
Member

Hi @Bl4d3s , thank for reporting this.

We do not strictly guarantee uniqueness and order of events, however usually you should be getting events once.
Since the reconciler relies on the informer cache one it's triggered, if the cache is stale we may be getting the pipeline run without the start date set, and thus trigger the "Started" event again.

Do you see this on a regular basis or was it a one off?
If this is a one off I would not be worried, otherwise I think it would be best to dig into what's happening, as we need to be able to rely on the informer caches telling us the right thing most of the times.

@mattmoor fyi

@Bl4d3s
Copy link
Author

Bl4d3s commented Nov 20, 2020

Hi, thanks for the fast feedback.

I see it happen more often then not unfortunately.

Do you need any more input from my end ? Specific logs etc?

@afrittoli
Copy link
Member

afrittoli commented Nov 20, 2020

If you still have the pipeline around, could you post the output of:

kubectl describe pr/ba--thesis-sample--test--5pdtp -n tekton-pipelines

Any special reason for running a pipeline in the tekton-pipelines namespace?
Note that the log lines are about k8s events, but if you have duplicate k8s you could also see duplicate cloud events.

@Bl4d3s
Copy link
Author

Bl4d3s commented Nov 20, 2020

kubectl describe pr/ba--thesis-sample--test--5pdtp -n tekton-pipelines

Output

Output
Name:         ba--thesis-sample--test--5pdtp
Namespace:    tekton-pipelines
Labels:       tekton.dev/pipeline=mvn-default
            triggers.tekton.dev/eventlistener=bitbucket
            triggers.tekton.dev/trigger=pipeline-trigger
            triggers.tekton.dev/triggers-eventid=xzj5v
Annotations:  <none>
API Version:  tekton.dev/v1beta1
Kind:         PipelineRun
Metadata:
Creation Timestamp:  2020-11-20T11:30:44Z
Generation:          1
Managed Fields:
  API Version:  tekton.dev/v1beta1
  Fields Type:  FieldsV1
  fieldsV1:
    f:metadata:
      f:labels:
        .:
        f:triggers.tekton.dev/eventlistener:
        f:triggers.tekton.dev/trigger:
        f:triggers.tekton.dev/triggers-eventid:
    f:spec:
      .:
      f:params:
      f:pipelineRef:
        .:
        f:name:
      f:resources:
      f:serviceAccountName:
      f:workspaces:
  Manager:      eventlistenersink
  Operation:    Update
  Time:         2020-11-20T11:30:44Z
  API Version:  tekton.dev/v1beta1
  Fields Type:  FieldsV1
  fieldsV1:
    f:metadata:
      f:annotations:
        .:
        f:kubectl.kubernetes.io/last-applied-configuration:
      f:labels:
        f:tekton.dev/pipeline:
    f:status:
      .:
      f:completionTime:
      f:conditions:
      f:pipelineSpec:
        .:
        f:description:
        f:finally:
        f:params:
        f:resources:
        f:tasks:
        f:workspaces:
      f:startTime:
      f:taskRuns:
        .:
        f:ba--thesis-sample--test--5pdtp-build-cl8hf:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:resourcesResult:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:resources:
                .:
                f:inputs:
              f:steps:
              f:volumes:
              f:workspaces:
        f:ba--thesis-sample--test--5pdtp-cleanup-dd2rz:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:steps:
              f:workspaces:
        f:ba--thesis-sample--test--5pdtp-dependency-vulnerability-xsqf4:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:resourcesResult:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:resources:
                .:
                f:inputs:
              f:steps:
              f:volumes:
              f:workspaces:
        f:ba--thesis-sample--test--5pdtp-deploy-xnbjm:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:steps:
              f:volumes:
        f:ba--thesis-sample--test--5pdtp-integration-test-jttkq:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:resourcesResult:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:resources:
                .:
                f:inputs:
              f:steps:
              f:volumes:
              f:workspaces:
        f:ba--thesis-sample--test--5pdtp-jenkins-reports-hcdzq:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:resourcesResult:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:resources:
                .:
                f:inputs:
              f:steps:
              f:workspaces:
        f:ba--thesis-sample--test--5pdtp-jqassistant-checks-rqj9w:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:resourcesResult:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:resources:
                .:
                f:inputs:
              f:steps:
              f:volumes:
              f:workspaces:
        f:ba--thesis-sample--test--5pdtp-load-config-vjr45:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:resourcesResult:
            f:startTime:
            f:steps:
            f:taskResults:
            f:taskSpec:
              .:
              f:description:
              f:params:
              f:resources:
                .:
                f:inputs:
              f:results:
              f:steps:
        f:ba--thesis-sample--test--5pdtp-nexus-upload-q4x7b:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:resourcesResult:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:resources:
                .:
                f:inputs:
              f:steps:
              f:volumes:
              f:workspaces:
        f:ba--thesis-sample--test--5pdtp-systemtest-8hjqw:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:steps:
              f:volumes:
        f:ba--thesis-sample--test--5pdtp-unit-test-mddsq:
          .:
          f:pipelineTaskName:
          f:status:
            .:
            f:completionTime:
            f:conditions:
            f:podName:
            f:resourcesResult:
            f:startTime:
            f:steps:
            f:taskSpec:
              .:
              f:params:
              f:resources:
                .:
                f:inputs:
              f:steps:
              f:volumes:
              f:workspaces:
  Manager:         controller
  Operation:       Update
  Time:            2020-11-20T11:41:02Z
Resource Version:  594333
Self Link:         /apis/tekton.dev/v1beta1/namespaces/tekton-pipelines/pipelineruns/ba--thesis-sample--test--5pdtp
UID:               cef7fcef-c555-4f7c-a403-3cbd42f17911
Spec:
Params:
  Name:   trigger-name
  Value:  Thesis
  Name:   trigger-email
  Value:  ****
  Name:   git-branch
  Value:  test
  Name:   git-commit
  Value:  7aea9d34eb7985731525c94adc534d0c126cda95
Pipeline Ref:
  Name:  mvn-default
Resources:
  Name:  git-repo
  Resource Spec:
    Params:
      Name:            url
      Value:           ssh://git@****
      Name:            revision
      Value:           7aea9d34eb7985731525c94adc534d0c126cda95
    Type:              git
Service Account Name:  mvn-default
Timeout:               1h0m0s
Workspaces:
  Name:  maven-workspace
  Volume Claim Template:
    Metadata:
      Creation Timestamp:  <nil>
    Spec:
      Access Modes:
        ReadWriteOnce
      Resources:
        Requests:
          Storage:  1Gi
    Status:
Status:
Completion Time:  2020-11-20T11:41:01Z
Conditions:
  Last Transition Time:  2020-11-20T11:41:01Z
  Message:               Tasks Completed: 11 (Failed: 0, Cancelled 0), Skipped: 0
  Reason:                Succeeded
  Status:                True
  Type:                  Succeeded
Pipeline Spec:
  Description:  Default maven pipeline

  Finally:
    Name:  cleanup
    Params:
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
    Task Ref:
      Kind:  Task
      Name:  clean-ws
    Workspaces:
      Name:       ws-to-clean
      Workspace:  maven-workspace
  Params:
    Description:  Name of account/user who triggered the build
    Name:         trigger-name
    Type:         string
    Description:  Email of account/user who triggered the build
    Name:         trigger-email
    Type:         string
    Description:  Branch the build is running for
    Name:         git-branch
    Type:         string
    Description:  Commit the build is running for
    Name:         git-commit
    Type:         string
  Resources:
    Name:  git-repo
    Type:  git
  Tasks:
    Name:  load-config
    Params:
      Name:   pipeline-name
      Value:  $(context.pipelineRun.name)
      Name:   pipeline-uid
      Value:  $(context.pipelineRun.uid)
    Resources:
      Inputs:
        Name:      source
        Resource:  git-repo
    Task Ref:
      Kind:  Task
      Name:  prepare-config
    Name:    build
    Params:
      Name:  goals
      Value:
        install
      Name:  mvn-params
      Value:
        -B
        -V
        -U
        -DskipTests
        -DskipITs
        -Dci.build=true
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
      Name:   maven-image
      Value:  $(tasks.load-config.results.maven-image)
    Resources:
      Inputs:
        Name:      source
        Resource:  git-repo
    Run After:
      load-config
    Task Ref:
      Kind:  Task
      Name:  run-maven
    Workspaces:
      Name:       maven-repo
      Sub Path:   local-repo
      Workspace:  maven-workspace
      Name:       target
      Sub Path:   target
      Workspace:  maven-workspace
    Name:         unit-test
    Params:
      Name:  goals
      Value:
        org.jacoco:jacoco-maven-plugin:prepare-agent
        surefire:test
        org.jacoco:jacoco-maven-plugin:report
      Name:  mvn-params
      Value:
        -B
        -DskipITs
        -Dmaven.javadoc.skip=true
        -Dmaven.source.skip=true
        -Dci.test.unit=true
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
      Name:   maven-image
      Value:  $(tasks.load-config.results.maven-image)
    Resources:
      Inputs:
        Name:      source
        Resource:  git-repo
    Run After:
      build
    Task Ref:
      Kind:  Task
      Name:  run-maven
    Workspaces:
      Name:       maven-repo
      Sub Path:   local-repo
      Workspace:  maven-workspace
      Name:       target
      Sub Path:   target
      Workspace:  maven-workspace
    Name:         integration-test
    Params:
      Name:  goals
      Value:
        org.jacoco:jacoco-maven-plugin:prepare-agent-integration
        failsafe:integration-test
        failsafe:verify
        org.jacoco:jacoco-maven-plugin:report-integration
      Name:  mvn-params
      Value:
        -B
        -Dmaven.javadoc.skip=true
        -Dmaven.source.skip=true
        -Dci.test.integration=true
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
      Name:   maven-image
      Value:  $(tasks.load-config.results.maven-image)
    Resources:
      Inputs:
        Name:      source
        Resource:  git-repo
    Run After:
      build
    Task Ref:
      Kind:  Task
      Name:  run-maven
    Workspaces:
      Name:       maven-repo
      Sub Path:   local-repo
      Workspace:  maven-workspace
      Name:       target
      Sub Path:   target
      Workspace:  maven-workspace
    Name:         deploy
    Params:
      Name:   hook-name
      Value:  deploy
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
      Name:   image-name
      Value:  $(tasks.load-config.results.deploy-image)
    Run After:
      unit-test
      integration-test
    Task Ref:
      Kind:  Task
      Name:  optional-hook
    Name:    systemtest
    Params:
      Name:   hook-name
      Value:  systemtest
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
      Name:   image-name
      Value:  $(tasks.load-config.results.systemtest-image)
    Run After:
      deploy
    Task Ref:
      Kind:  Task
      Name:  optional-hook
    Name:    dependency-vulnerability
    Params:
      Name:  goals
      Value:
        org.owasp:dependency-check-maven:5.3.1:aggregate
      Name:  mvn-params
      Value:
        -DossindexAnalyzerEnabled=false
        -Dformat=ALL
        -DfailBuildOnCVSS=7
        -DskipProvidedScope=true
        -DfailOnError=false
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
    Resources:
      Inputs:
        Name:      source
        Resource:  git-repo
    Run After:
      systemtest
    Task Ref:
      Kind:  Task
      Name:  run-maven
    Workspaces:
      Name:       maven-repo
      Sub Path:   local-repo
      Workspace:  maven-workspace
      Name:       target
      Sub Path:   target
      Workspace:  maven-workspace
    Name:         jqassistant-checks
    Params:
      Name:  goals
      Value:
        com.buschmais.jqassistant:jqassistant-maven-plugin:scan
        com.buschmais.jqassistant:jqassistant-maven-plugin:analyze
      Name:  mvn-params
      Value:
        -B
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
    Resources:
      Inputs:
        Name:      source
        Resource:  git-repo
    Run After:
      systemtest
    Task Ref:
      Kind:  Task
      Name:  run-maven
    Workspaces:
      Name:       maven-repo
      Sub Path:   local-repo
      Workspace:  maven-workspace
      Name:       target
      Sub Path:   target
      Workspace:  maven-workspace
    Name:         nexus-upload
    Params:
      Name:  goals
      Value:
        deploy
      Name:  mvn-params
      Value:
        -B
        -DskipTests=true
        -Dcodegen.skip=true
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
    Resources:
      Inputs:
        Name:      source
        Resource:  git-repo
    Run After:
      dependency-vulnerability
      jqassistant-checks
    Task Ref:
      Kind:  Task
      Name:  run-maven
    Workspaces:
      Name:       maven-repo
      Sub Path:   local-repo
      Workspace:  maven-workspace
      Name:       target
      Sub Path:   target
      Workspace:  maven-workspace
    Name:         jenkins-reports
    Params:
      Name:   config-map
      Value:  $(context.pipelineRun.name)-config
    Resources:
      Inputs:
        Name:      source
        Resource:  git-repo
    Run After:
      nexus-upload
    Task Ref:
      Kind:  Task
      Name:  jenkins-reports
    Workspaces:
      Name:       target
      Sub Path:   target
      Workspace:  maven-workspace
  Workspaces:
    Name:    maven-workspace
Start Time:  2020-11-20T11:30:44Z
Task Runs:
  ba--thesis-sample--test--5pdtp-build-cl8hf:
    Pipeline Task Name:  build
    Status:
      Completion Time:  2020-11-20T11:31:47Z
      Conditions:
        Last Transition Time:  2020-11-20T11:31:47Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-build-cl8hf-pod-76sd8
      Resources Result:
        Key:            commit
        Resource Name:  source
        Resource Ref:
          Name:         source
        Value:          7aea9d34eb7985731525c94adc534d0c126cda95
        Key:            url
        Resource Name:  source
        Resource Ref:
          Name:    source
        Value:     ssh://git@****
      Start Time:  2020-11-20T11:31:03Z
      Steps:
        Container:  step-git-source-source-gdh5b
        Image ID:   gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:0f535b791c0cb7a698af732ae6c37fa36b6e55181f697cbee3b940ab5358573f
        Name:       git-source-source-gdh5b
        Terminated:
          Container ID:  cri-o://f2287729823152347c92e2f56062f830ef7cdfbd2b69981c7743bd3f42553f9d
          Exit Code:     0
          Finished At:   2020-11-20T11:31:15Z
          Message:       [{"key":"commit","value":"7aea9d34eb7985731525c94adc534d0c126cda95","resourceName":"source","resourceRef":{"name":"source"}},{"key":"url","value":"ssh://git@****","resourceName":"source","resourceRef":{"name":"source"}}]
          Reason:        Completed
          Started At:    2020-11-20T11:31:15Z
        Container:       step-run-mvn
        Image ID:        docker.io/library/maven@sha256:8e8abdcde705f63990359f3747f5201778d9690e7f90ac3707a2048b43f0bdf0
        Name:            run-mvn
        Terminated:
          Container ID:  cri-o://57e618ab274a71dbfcef6795b964ffe24583b483b8b526d4e3bd91b20a1d3c58
          Exit Code:     0
          Finished At:   2020-11-20T11:31:46Z
          Reason:        Completed
          Started At:    2020-11-20T11:31:16Z
      Task Spec:
        Params:
          Default:  maven
          Name:     maven-image
          Type:     string
          Default:
            install
          Name:  goals
          Type:  array
          Default:
          Name:  mvn-params
          Type:  array
          Name:  config-map
          Type:  string
        Resources:
          Inputs:
            Name:  source
            Type:  git
        Steps:
          Args:
            -s
            /mvn-pipeline-config/settings.xml
            -Dmaven.repo.local=$(workspaces.maven-repo.path) $(ADDITIONAL_MVN_PARAMS)
            $(inputs.params.mvn-params)
            $(inputs.params.goals)
          Command:
            mvn
          Env:
            Name:  ADDITIONAL_MVN_PARAMS
            Value From:
              Config Map Key Ref:
                Key:   additional_mvn_params
                Name:  $(inputs.params.config-map)
          Image:       maven
          Name:        run-mvn
          Resources:
          Volume Mounts:
            Mount Path:  /mvn-pipeline-config
            Name:        mvn-pipeline-config-vol
          Working Dir:   /workspace/source
        Volumes:
          Config Map:
            Name:  mvn-pipeline-config
          Name:    mvn-pipeline-config-vol
        Workspaces:
          Name:        maven-repo
          Mount Path:  /workspace/source/target
          Name:        target
  ba--thesis-sample--test--5pdtp-cleanup-dd2rz:
    Pipeline Task Name:  cleanup
    Status:
      Completion Time:  2020-11-20T11:41:00Z
      Conditions:
        Last Transition Time:  2020-11-20T11:41:00Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-cleanup-dd2rz-pod-jmh2v
      Start Time:              2020-11-20T11:40:45Z
      Steps:
        Container:  step-build-sources
        Image ID:   docker.io/library/ubuntu@sha256:1d7b639619bdca2d008eca2d5293e3c43ff84cbee597ff76de3b7a7de3e84956
        Name:       build-sources
        Terminated:
          Container ID:  cri-o://8372e28e4994b132660e4ef0f61c1d5d57051ce3db4aa186feeda690522dfdcf
          Exit Code:     0
          Finished At:   2020-11-20T11:40:59Z
          Reason:        Completed
          Started At:    2020-11-20T11:40:58Z
      Task Spec:
        Params:
          Name:  config-map
          Type:  string
        Steps:
          Env:
            Name:  CLEAN_WORKSPACE
            Value From:
              Config Map Key Ref:
                Key:   clean_workspace
                Name:  $(inputs.params.config-map)
          Image:       ubuntu
          Name:        build-sources
          Resources:
          Script:  #!/bin/bash

if [ $CLEAN_WORKSPACE == "true" ]; then
echo "Removing $(pwd)"
rm -rf *
else
echo "Not cleaning workspace"
fi

          Working Dir:  $(workspaces.ws-to-clean.path)
        Workspaces:
          Name:  ws-to-clean
  ba--thesis-sample--test--5pdtp-dependency-vulnerability-xsqf4:
    Pipeline Task Name:  dependency-vulnerability
    Status:
      Completion Time:  2020-11-20T11:39:58Z
      Conditions:
        Last Transition Time:  2020-11-20T11:39:58Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-dependency-vulnerability-x-hv4v6
      Resources Result:
        Key:            commit
        Resource Name:  source
        Resource Ref:
          Name:         source
        Value:          7aea9d34eb7985731525c94adc534d0c126cda95
        Key:            url
        Resource Name:  source
        Resource Ref:
          Name:    source
        Value:     ssh://git@****
      Start Time:  2020-11-20T11:32:59Z
      Steps:
        Container:  step-git-source-source-q2zhq
        Image ID:   gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:0f535b791c0cb7a698af732ae6c37fa36b6e55181f697cbee3b940ab5358573f
        Name:       git-source-source-q2zhq
        Terminated:
          Container ID:  cri-o://44611e08c177785fba5aa60ee062ae996c002595129c3f5b889374713b315d6a
          Exit Code:     0
          Finished At:   2020-11-20T11:33:16Z
          Message:       [{"key":"commit","value":"7aea9d34eb7985731525c94adc534d0c126cda95","resourceName":"source","resourceRef":{"name":"source"}},{"key":"url","value":"ssh://git@****","resourceName":"source","resourceRef":{"name":"source"}}]
          Reason:        Completed
          Started At:    2020-11-20T11:33:15Z
        Container:       step-run-mvn
        Image ID:        docker.io/library/maven@sha256:8e8abdcde705f63990359f3747f5201778d9690e7f90ac3707a2048b43f0bdf0
        Name:            run-mvn
        Terminated:
          Container ID:  cri-o://b3a69c0a21c6922931bfe2d125931a4321e89cca161bfc35b76629a4484cded1
          Exit Code:     0
          Finished At:   2020-11-20T11:39:57Z
          Reason:        Completed
          Started At:    2020-11-20T11:33:17Z
      Task Spec:
        Params:
          Default:  maven
          Name:     maven-image
          Type:     string
          Default:
            install
          Name:  goals
          Type:  array
          Default:
          Name:  mvn-params
          Type:  array
          Name:  config-map
          Type:  string
        Resources:
          Inputs:
            Name:  source
            Type:  git
        Steps:
          Args:
            -s
            /mvn-pipeline-config/settings.xml
            -Dmaven.repo.local=$(workspaces.maven-repo.path) $(ADDITIONAL_MVN_PARAMS)
            $(inputs.params.mvn-params)
            $(inputs.params.goals)
          Command:
            mvn
          Env:
            Name:  ADDITIONAL_MVN_PARAMS
            Value From:
              Config Map Key Ref:
                Key:   additional_mvn_params
                Name:  $(inputs.params.config-map)
          Image:       maven
          Name:        run-mvn
          Resources:
          Volume Mounts:
            Mount Path:  /mvn-pipeline-config
            Name:        mvn-pipeline-config-vol
          Working Dir:   /workspace/source
        Volumes:
          Config Map:
            Name:  mvn-pipeline-config
          Name:    mvn-pipeline-config-vol
        Workspaces:
          Name:        maven-repo
          Mount Path:  /workspace/source/target
          Name:        target
  ba--thesis-sample--test--5pdtp-deploy-xnbjm:
    Pipeline Task Name:  deploy
    Status:
      Completion Time:  2020-11-20T11:32:43Z
      Conditions:
        Last Transition Time:  2020-11-20T11:32:43Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-deploy-xnbjm-pod-xhgst
      Start Time:              2020-11-20T11:32:29Z
      Steps:
        Container:  step-execute-hook
        Image ID:   docker.io/library/busybox@sha256:a9286defaba7b3a519d585ba0e37d0b2cbee74ebfe590960b0b1d6a5e97d1e1d
        Name:       execute-hook
        Terminated:
          Container ID:  cri-o://e9313237c7345ea23ba0adeae89dd9aa75224c5344cc9e34ece12cbe32052bfd
          Exit Code:     0
          Finished At:   2020-11-20T11:32:43Z
          Reason:        Completed
          Started At:    2020-11-20T11:32:43Z
      Task Spec:
        Params:
          Description:  Configmap containing hook content
          Name:         config-map
          Type:         string
          Description:  Key name to get content for configMap
          Name:         hook-name
          Type:         string
          Description:  Image to execute hook in
          Name:         image-name
          Type:         string
        Steps:
          Image:  $(inputs.params.image-name)
          Name:   execute-hook
          Resources:
          Script:  cp /config/$(inputs.params.hook-name)_hook hook
chmod +x hook

./hook

          Volume Mounts:
            Mount Path:  /config
            Name:        config-volume
        Volumes:
          Config Map:
            Name:  $(params.config-map)
          Name:    config-volume
  ba--thesis-sample--test--5pdtp-integration-test-jttkq:
    Pipeline Task Name:  integration-test
    Status:
      Completion Time:  2020-11-20T11:32:29Z
      Conditions:
        Last Transition Time:  2020-11-20T11:32:29Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-integration-test-jttkq-pod-dsrqt
      Resources Result:
        Key:            commit
        Resource Name:  source
        Resource Ref:
          Name:         source
        Value:          7aea9d34eb7985731525c94adc534d0c126cda95
        Key:            url
        Resource Name:  source
        Resource Ref:
          Name:    source
        Value:     ssh://git@*****
      Start Time:  2020-11-20T11:31:48Z
      Steps:
        Container:  step-git-source-source-ctjj7
        Image ID:   gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:0f535b791c0cb7a698af732ae6c37fa36b6e55181f697cbee3b940ab5358573f
        Name:       git-source-source-ctjj7
        Terminated:
          Container ID:  cri-o://dca320e74744eb4096b2960aa9157b66c337f72e0c6cf1d743b95b7f4b2d0dd8
          Exit Code:     0
          Finished At:   2020-11-20T11:32:08Z
          Message:       [{"key":"commit","value":"7aea9d34eb7985731525c94adc534d0c126cda95","resourceName":"source","resourceRef":{"name":"source"}},{"key":"url","value":"ssh://git@****","resourceName":"source","resourceRef":{"name":"source"}}]
          Reason:        Completed
          Started At:    2020-11-20T11:32:07Z
        Container:       step-run-mvn
        Image ID:        docker.io/library/maven@sha256:8e8abdcde705f63990359f3747f5201778d9690e7f90ac3707a2048b43f0bdf0
        Name:            run-mvn
        Terminated:
          Container ID:  cri-o://6dd8a3b6ea7d9419fa2c71fba17a1f18b3a59a2b864701a81afba4b1095f8460
          Exit Code:     0
          Finished At:   2020-11-20T11:32:28Z
          Reason:        Completed
          Started At:    2020-11-20T11:32:08Z
      Task Spec:
        Params:
          Default:  maven
          Name:     maven-image
          Type:     string
          Default:
            install
          Name:  goals
          Type:  array
          Default:
          Name:  mvn-params
          Type:  array
          Name:  config-map
          Type:  string
        Resources:
          Inputs:
            Name:  source
            Type:  git
        Steps:
          Args:
            -s
            /mvn-pipeline-config/settings.xml
            -Dmaven.repo.local=$(workspaces.maven-repo.path) $(ADDITIONAL_MVN_PARAMS)
            $(inputs.params.mvn-params)
            $(inputs.params.goals)
          Command:
            mvn
          Env:
            Name:  ADDITIONAL_MVN_PARAMS
            Value From:
              Config Map Key Ref:
                Key:   additional_mvn_params
                Name:  $(inputs.params.config-map)
          Image:       maven
          Name:        run-mvn
          Resources:
          Volume Mounts:
            Mount Path:  /mvn-pipeline-config
            Name:        mvn-pipeline-config-vol
          Working Dir:   /workspace/source
        Volumes:
          Config Map:
            Name:  mvn-pipeline-config
          Name:    mvn-pipeline-config-vol
        Workspaces:
          Name:        maven-repo
          Mount Path:  /workspace/source/target
          Name:        target
  ba--thesis-sample--test--5pdtp-jenkins-reports-hcdzq:
    Pipeline Task Name:  jenkins-reports
    Status:
      Completion Time:  2020-11-20T11:40:43Z
      Conditions:
        Last Transition Time:  2020-11-20T11:40:43Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-jenkins-reports-hcdzq-pod-6kmqp
      Resources Result:
        Key:            commit
        Resource Name:  source
        Resource Ref:
          Name:         source
        Value:          7aea9d34eb7985731525c94adc534d0c126cda95
        Key:            url
        Resource Name:  source
        Resource Ref:
          Name:    source
        Value:     ssh://git@****
      Start Time:  2020-11-20T11:40:24Z
      Steps:
        Container:  step-git-source-source-vn797
        Image ID:   gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:0f535b791c0cb7a698af732ae6c37fa36b6e55181f697cbee3b940ab5358573f
        Name:       git-source-source-vn797
        Terminated:
          Container ID:  cri-o://718387b9438d345026b69d4730d543c89f12550e754e98a7a346f129617c2e2a
          Exit Code:     0
          Finished At:   2020-11-20T11:40:41Z
          Message:       [{"key":"commit","value":"7aea9d34eb7985731525c94adc534d0c126cda95","resourceName":"source","resourceRef":{"name":"source"}},{"key":"url","value":"ssh://git@****","resourceName":"source","resourceRef":{"name":"source"}}]
          Reason:        Completed
          Started At:    2020-11-20T11:40:41Z
        Container:       step-print-jacoco-params
        Image ID:        docker.io/library/ubuntu@sha256:1d7b639619bdca2d008eca2d5293e3c43ff84cbee597ff76de3b7a7de3e84956
        Name:            print-jacoco-params
        Terminated:
          Container ID:  cri-o://0585a680e2f839524980978b4683a6b4f00ae052f50ae89b266fec7a4b603220
          Exit Code:     0
          Finished At:   2020-11-20T11:40:42Z
          Reason:        Completed
          Started At:    2020-11-20T11:40:42Z
        Container:       step-print-ws-zip-base64-encoded
        Image ID:        docker.io/bitnami/python@sha256:f1618a27ca4ace418f25d6d0195ef3f2b8ce85eae8f04468e77688abd3ec7d18
        Name:            print-ws-zip-base64-encoded
        Terminated:
          Container ID:  cri-o://e181b31cc76102caddd3a84526900b2bdab8a6292c52195f8aca18e504cba407
          Exit Code:     0
          Finished At:   2020-11-20T11:40:43Z
          Reason:        Completed
          Started At:    2020-11-20T11:40:43Z
      Task Spec:
        Params:
          Name:  config-map
          Type:  string
        Resources:
          Inputs:
            Name:  source
            Type:  git
        Steps:
          Env:
            Name:  JACOCO_EXCLUSION_PATTERN
            Value From:
              Config Map Key Ref:
                Key:   jacoco_exclusion_pattern
                Name:  $(inputs.params.config-map)
            Name:      JACOCO_INCLUSION_PATTERN
            Value From:
              Config Map Key Ref:
                Key:   jacoco_inclusion_pattern
                Name:  $(inputs.params.config-map)
          Image:       ubuntu
          Name:        print-jacoco-params
          Resources:
          Script:  #!/bin/bash

printf "$JACOCO_EXCLUSION_PATTERN\n$JACOCO_INCLUSION_PATTERN"

          Image:  bitnami/python
          Name:   print-ws-zip-base64-encoded
          Resources:
          Script:  #!/usr/bin/env python3        
import shutil
import base64

if "$(inputs.params.binary-file-name)" != '':
  shutil.make_archive('src', 'zip', '.')
  with open("src.zip", 'rb') as in_file:
      encoded = base64.b64encode(in_file.read()).decode('utf-8')
      print(encoded)

          Working Dir:  /workspace/source
        Workspaces:
          Mount Path:  /workspace/source/target
          Name:        target
  ba--thesis-sample--test--5pdtp-jqassistant-checks-rqj9w:
    Pipeline Task Name:  jqassistant-checks
    Status:
      Completion Time:  2020-11-20T11:34:47Z
      Conditions:
        Last Transition Time:  2020-11-20T11:34:47Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-jqassistant-checks-rqj9w-p-sbvmd
      Resources Result:
        Key:            commit
        Resource Name:  source
        Resource Ref:
          Name:         source
        Value:          7aea9d34eb7985731525c94adc534d0c126cda95
        Key:            url
        Resource Name:  source
        Resource Ref:
          Name:    source
        Value:     ssh://git@****
      Start Time:  2020-11-20T11:32:59Z
      Steps:
        Container:  step-git-source-source-n4pw6
        Image ID:   gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:0f535b791c0cb7a698af732ae6c37fa36b6e55181f697cbee3b940ab5358573f
        Name:       git-source-source-n4pw6
        Terminated:
          Container ID:  cri-o://6ed1f8eeba43eb290056cf2341fc7a4c04d6c4295a5fbbb4d279b1eeef018431
          Exit Code:     0
          Finished At:   2020-11-20T11:33:16Z
          Message:       [{"key":"commit","value":"7aea9d34eb7985731525c94adc534d0c126cda95","resourceName":"source","resourceRef":{"name":"source"}},{"key":"url","value":"ssh://git@****","resourceName":"source","resourceRef":{"name":"source"}}]
          Reason:        Completed
          Started At:    2020-11-20T11:33:15Z
        Container:       step-run-mvn
        Image ID:        docker.io/library/maven@sha256:8e8abdcde705f63990359f3747f5201778d9690e7f90ac3707a2048b43f0bdf0
        Name:            run-mvn
        Terminated:
          Container ID:  cri-o://565199a1b40b8957bcadaa5b1633ad08a443f2111e22dc80da28257da2df4a76
          Exit Code:     0
          Finished At:   2020-11-20T11:34:47Z
          Reason:        Completed
          Started At:    2020-11-20T11:33:17Z
      Task Spec:
        Params:
          Default:  maven
          Name:     maven-image
          Type:     string
          Default:
            install
          Name:  goals
          Type:  array
          Default:
          Name:  mvn-params
          Type:  array
          Name:  config-map
          Type:  string
        Resources:
          Inputs:
            Name:  source
            Type:  git
        Steps:
          Args:
            -s
            /mvn-pipeline-config/settings.xml
            -Dmaven.repo.local=$(workspaces.maven-repo.path) $(ADDITIONAL_MVN_PARAMS)
            $(inputs.params.mvn-params)
            $(inputs.params.goals)
          Command:
            mvn
          Env:
            Name:  ADDITIONAL_MVN_PARAMS
            Value From:
              Config Map Key Ref:
                Key:   additional_mvn_params
                Name:  $(inputs.params.config-map)
          Image:       maven
          Name:        run-mvn
          Resources:
          Volume Mounts:
            Mount Path:  /mvn-pipeline-config
            Name:        mvn-pipeline-config-vol
          Working Dir:   /workspace/source
        Volumes:
          Config Map:
            Name:  mvn-pipeline-config
          Name:    mvn-pipeline-config-vol
        Workspaces:
          Name:        maven-repo
          Mount Path:  /workspace/source/target
          Name:        target
  ba--thesis-sample--test--5pdtp-load-config-vjr45:
    Pipeline Task Name:  load-config
    Status:
      Completion Time:  2020-11-20T11:31:01Z
      Conditions:
        Last Transition Time:  2020-11-20T11:31:01Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-load-config-vjr45-pod-gpzkr
      Resources Result:
        Key:            commit
        Resource Name:  source
        Resource Ref:
          Name:         source
        Value:          7aea9d34eb7985731525c94adc534d0c126cda95
        Key:            url
        Resource Name:  source
        Resource Ref:
          Name:    source
        Value:     ssh://git@*****
      Start Time:  2020-11-20T11:30:45Z
      Steps:
        Container:  step-git-source-source-m5xc6
        Image ID:   gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:0f535b791c0cb7a698af732ae6c37fa36b6e55181f697cbee3b940ab5358573f
        Name:       git-source-source-m5xc6
        Terminated:
          Container ID:  cri-o://fdb7b1c9c7acf50dddf116215124f6d824de37075bab303ba699deb5a2a127c6
          Exit Code:     0
          Finished At:   2020-11-20T11:30:57Z
          Message:       [{"key":"commit","value":"7aea9d34eb7985731525c94adc534d0c126cda95","resourceName":"source","resourceRef":{"name":"source"}},{"key":"url","value":"ssh://git@****","resourceName":"source","resourceRef":{"name":"source"}}]
          Reason:        Completed
          Started At:    2020-11-20T11:30:56Z
        Container:       step-check-non-snapshot-version
        Image ID:        ghcr.io/ctron/kubectl@sha256:0193142643e426f42b82f69c055126a01a4b2be67da9a8a6000b3a6dc54a0e92
        Name:            check-non-snapshot-version
        Terminated:
          Container ID:  cri-o://b6d466a72cd4b4cc99b118b63f85b858b7b9f47142ab6e7d67009c50e7445c8a
          Exit Code:     0
          Finished At:   2020-11-20T11:30:58Z
          Reason:        Completed
          Started At:    2020-11-20T11:30:58Z
        Container:       step-create-config-map-with-values
        Image ID:        ghcr.io/ctron/kubectl@sha256:0193142643e426f42b82f69c055126a01a4b2be67da9a8a6000b3a6dc54a0e92
        Name:            create-config-map-with-values
        Terminated:
          Container ID:  cri-o://927a7145fa1d83036ba097a6eebc2b282019e2ffbd71a247c5d1178ca9d9b676
          Exit Code:     0
          Finished At:   2020-11-20T11:31:00Z
          Message:       [{"key":"deploy-image","value":"busybox","type":"TaskRunResult"},{"key":"maven-image","value":"maven","type":"TaskRunResult"},{"key":"systemtest-image","value":"bitnami/python","type":"TaskRunResult"}]
          Reason:        Completed
          Started At:    2020-11-20T11:30:58Z
      Task Results:
        Name:   deploy-image
        Value:  busybox
        Name:   maven-image
        Value:  maven
        Name:   systemtest-image
        Value:  bitnami/python
      Task Spec:
        Description:  - Checks precondition (SNAPSHOT-version)
- loads ConfigMap based on pipeline_config.properties file in Git-Repository
- provides image names for hook based steps as result

        Params:
          Description:  Name of the PipelineRun
          Name:         pipeline-name
          Type:         string
          Description:  UID of the PipelineRun
          Name:         pipeline-uid
          Type:         string
        Resources:
          Inputs:
            Description:  Git-Repository of the project to build
            Name:         source
            Type:         git
        Results:
          Description:  Comma-separated list of optional steps to be executed
          Name:         optional-tasks
          Description:  Name of docker image to execute maven tasks in
          Name:         maven-image
          Description:  Name of docker image to execute deploy hook in (defaults to empty)
          Name:         deploy-image
          Description:  Name of docker image to execute systemtest hook in (defaults to empty)
          Name:         systemtest-image
        Steps:
          Image:  ghcr.io/ctron/kubectl:latest
          Name:   check-non-snapshot-version
          Resources:
          Script:  #!/bin/bash

version=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)

if [[ "$version" != *-SNAPSHOT ]]; then
read -r -d '' CANCEL << EOF 
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: "$(inputs.params.pipeline-name)"
spec:
status: "PipelineRunCancelled"
EOF

printf "$CANCEL" | kubectl apply -f -
fi
printf "Running on SNAPSHOT version, continuing"

          Working Dir:  /workspace/source
          Image:        ghcr.io/ctron/kubectl:latest
          Name:         create-config-map-with-values
          Resources:
          Script:  #!/bin/bash

source ./pipeline_config.properties
   
# prepend script lines with yaml intendation
deploy_hook=$(printf "$deploy_hook" | sed 's/.*/        &/')
systemtest_hook=$(printf "$systemtest_hook" | sed 's/.*/        &/')

# load defaults (non empty)
: "${maven_image:=maven}"
: "${jacoco_exclusion_pattern:=**/test*/**/*.class,**/gen/**/*.class}"
: "${jacoco_inclusion_pattern:=de/..../**/*.class}"
: "${clean_workspace:=true}"

read -r -d '' MAP << EOF 
apiVersion: v1
kind: ConfigMap
metadata:
ownerReferences:
  - apiVersion: tekton.dev/v1beta1
    kind: PipelineRun
    name: "$(inputs.params.pipeline-name)"
    uid:  "$(inputs.params.pipeline-uid)"
name: "$(inputs.params.pipeline-name)-config"  
data:
maven_image: "$maven_image"
additional_mvn_params: "$additional_mvn_params"
deploy_hook: |$deploy_hook
deploy_image: "$deploy_image"
systemtest_hook: |$systemtest_hook
systemtest_image: "$systemtest_image"
sonar_id: "$sonar_id"
jacoco_exclusion_pattern: "$jacoco_exclusion_pattern"
jacoco_inclusion_pattern: "$jacoco_inclusion_pattern" 
clean_workspace: "$clean_workspace"
EOF

printf "$MAP" | kubectl create -f -

printf "$maven_image" > $(results.maven-image.path)
printf "$deploy_image" > $(results.deploy-image.path)
printf "$systemtest_image" > $(results.systemtest-image.path)

          Working Dir:  /workspace/source
  ba--thesis-sample--test--5pdtp-nexus-upload-q4x7b:
    Pipeline Task Name:  nexus-upload
    Status:
      Completion Time:  2020-11-20T11:40:24Z
      Conditions:
        Last Transition Time:  2020-11-20T11:40:24Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-nexus-upload-q4x7b-pod-9szpl
      Resources Result:
        Key:            commit
        Resource Name:  source
        Resource Ref:
          Name:         source
        Value:          7aea9d34eb7985731525c94adc534d0c126cda95
        Key:            url
        Resource Name:  source
        Resource Ref:
          Name:    source
        Value:     ssh://git@****
      Start Time:  2020-11-20T11:39:58Z
      Steps:
        Container:  step-git-source-source-thvvf
        Image ID:   gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:0f535b791c0cb7a698af732ae6c37fa36b6e55181f697cbee3b940ab5358573f
        Name:       git-source-source-thvvf
        Terminated:
          Container ID:  cri-o://26ad854f251e50d4b02a03886a23eca1d561d7c78a1877698958adb7ee875105
          Exit Code:     0
          Finished At:   2020-11-20T11:40:11Z
          Message:       [{"key":"commit","value":"7aea9d34eb7985731525c94adc534d0c126cda95","resourceName":"source","resourceRef":{"name":"source"}},{"key":"url","value":"ssh://git@*****","resourceName":"source","resourceRef":{"name":"source"}}]
          Reason:        Completed
          Started At:    2020-11-20T11:40:11Z
        Container:       step-run-mvn
        Image ID:        docker.io/library/maven@sha256:8e8abdcde705f63990359f3747f5201778d9690e7f90ac3707a2048b43f0bdf0
        Name:            run-mvn
        Terminated:
          Container ID:  cri-o://07240400a772a43c32dae9080ee2c147ab8549eb05427b7b16c7b57afd8d7a0b
          Exit Code:     0
          Finished At:   2020-11-20T11:40:23Z
          Reason:        Completed
          Started At:    2020-11-20T11:40:12Z
      Task Spec:
        Params:
          Default:  maven
          Name:     maven-image
          Type:     string
          Default:
            install
          Name:  goals
          Type:  array
          Default:
          Name:  mvn-params
          Type:  array
          Name:  config-map
          Type:  string
        Resources:
          Inputs:
            Name:  source
            Type:  git
        Steps:
          Args:
            -s
            /mvn-pipeline-config/settings.xml
            -Dmaven.repo.local=$(workspaces.maven-repo.path) $(ADDITIONAL_MVN_PARAMS)
            $(inputs.params.mvn-params)
            $(inputs.params.goals)
          Command:
            mvn
          Env:
            Name:  ADDITIONAL_MVN_PARAMS
            Value From:
              Config Map Key Ref:
                Key:   additional_mvn_params
                Name:  $(inputs.params.config-map)
          Image:       maven
          Name:        run-mvn
          Resources:
          Volume Mounts:
            Mount Path:  /mvn-pipeline-config
            Name:        mvn-pipeline-config-vol
          Working Dir:   /workspace/source
        Volumes:
          Config Map:
            Name:  mvn-pipeline-config
          Name:    mvn-pipeline-config-vol
        Workspaces:
          Name:        maven-repo
          Mount Path:  /workspace/source/target
          Name:        target
  ba--thesis-sample--test--5pdtp-systemtest-8hjqw:
    Pipeline Task Name:  systemtest
    Status:
      Completion Time:  2020-11-20T11:32:57Z
      Conditions:
        Last Transition Time:  2020-11-20T11:32:57Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-systemtest-8hjqw-pod-rqnbn
      Start Time:              2020-11-20T11:32:45Z
      Steps:
        Container:  step-execute-hook
        Image ID:   docker.io/bitnami/python@sha256:f1618a27ca4ace418f25d6d0195ef3f2b8ce85eae8f04468e77688abd3ec7d18
        Name:       execute-hook
        Terminated:
          Container ID:  cri-o://aed0b3ca6ac3052448b62fac1541dde09f61428d5def2e4c5dc65bf7fae48c63
          Exit Code:     0
          Finished At:   2020-11-20T11:32:56Z
          Reason:        Completed
          Started At:    2020-11-20T11:32:56Z
      Task Spec:
        Params:
          Description:  Configmap containing hook content
          Name:         config-map
          Type:         string
          Description:  Key name to get content for configMap
          Name:         hook-name
          Type:         string
          Description:  Image to execute hook in
          Name:         image-name
          Type:         string
        Steps:
          Image:  $(inputs.params.image-name)
          Name:   execute-hook
          Resources:
          Script:  cp /config/$(inputs.params.hook-name)_hook hook
chmod +x hook

./hook

          Volume Mounts:
            Mount Path:  /config
            Name:        config-volume
        Volumes:
          Config Map:
            Name:  $(params.config-map)
          Name:    config-volume
  ba--thesis-sample--test--5pdtp-unit-test-mddsq:
    Pipeline Task Name:  unit-test
    Status:
      Completion Time:  2020-11-20T11:32:29Z
      Conditions:
        Last Transition Time:  2020-11-20T11:32:29Z
        Message:               All Steps have completed executing
        Reason:                Succeeded
        Status:                True
        Type:                  Succeeded
      Pod Name:                ba--thesis-sample--test--5pdtp-unit-test-mddsq-pod-kgszl
      Resources Result:
        Key:            commit
        Resource Name:  source
        Resource Ref:
          Name:         source
        Value:          7aea9d34eb7985731525c94adc534d0c126cda95
        Key:            url
        Resource Name:  source
        Resource Ref:
          Name:    source
        Value:     ssh://git@****
      Start Time:  2020-11-20T11:31:48Z
      Steps:
        Container:  step-git-source-source-ph6bt
        Image ID:   gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:0f535b791c0cb7a698af732ae6c37fa36b6e55181f697cbee3b940ab5358573f
        Name:       git-source-source-ph6bt
        Terminated:
          Container ID:  cri-o://f8a36c360bfc833360b9d73a1d4a2ed018c083a3dfc386297d24877bbbf814fd
          Exit Code:     0
          Finished At:   2020-11-20T11:32:08Z
          Message:       [{"key":"commit","value":"7aea9d34eb7985731525c94adc534d0c126cda95","resourceName":"source","resourceRef":{"name":"source"}},{"key":"url","value":"ssh://git@****","resourceName":"source","resourceRef":{"name":"source"}}]
          Reason:        Completed
          Started At:    2020-11-20T11:32:07Z
        Container:       step-run-mvn
        Image ID:        docker.io/library/maven@sha256:8e8abdcde705f63990359f3747f5201778d9690e7f90ac3707a2048b43f0bdf0
        Name:            run-mvn
        Terminated:
          Container ID:  cri-o://718d82d8a5aa7e18a34ccb33fec1781937584539170bfede4747727d668d288a
          Exit Code:     0
          Finished At:   2020-11-20T11:32:28Z
          Reason:        Completed
          Started At:    2020-11-20T11:32:08Z
      Task Spec:
        Params:
          Default:  maven
          Name:     maven-image
          Type:     string
          Default:
            install
          Name:  goals
          Type:  array
          Default:
          Name:  mvn-params
          Type:  array
          Name:  config-map
          Type:  string
        Resources:
          Inputs:
            Name:  source
            Type:  git
        Steps:
          Args:
            -s
            /mvn-pipeline-config/settings.xml
            -Dmaven.repo.local=$(workspaces.maven-repo.path) $(ADDITIONAL_MVN_PARAMS)
            $(inputs.params.mvn-params)
            $(inputs.params.goals)
          Command:
            mvn
          Env:
            Name:  ADDITIONAL_MVN_PARAMS
            Value From:
              Config Map Key Ref:
                Key:   additional_mvn_params
                Name:  $(inputs.params.config-map)
          Image:       maven
          Name:        run-mvn
          Resources:
          Volume Mounts:
            Mount Path:  /mvn-pipeline-config
            Name:        mvn-pipeline-config-vol
          Working Dir:   /workspace/source
        Volumes:
          Config Map:
            Name:  mvn-pipeline-config
          Name:    mvn-pipeline-config-vol
        Workspaces:
          Name:        maven-repo
          Mount Path:  /workspace/source/target
          Name:        target
Events:
Type    Reason     Age                    From         Message
----    ------     ----                   ----         -------
Normal  Started    3h42m (x2 over 3h42m)  PipelineRun  
Normal  Running    3h42m (x2 over 3h42m)  PipelineRun  Tasks Completed: 0 (Failed: 0, Cancelled 0), Incomplete: 11, Skipped: 0
Normal  Running    3h42m                  PipelineRun  Tasks Completed: 1 (Failed: 0, Cancelled 0), Incomplete: 10, Skipped: 0
Normal  Running    3h41m                  PipelineRun  Tasks Completed: 2 (Failed: 0, Cancelled 0), Incomplete: 9, Skipped: 0
Normal  Running    3h40m (x2 over 3h40m)  PipelineRun  Tasks Completed: 4 (Failed: 0, Cancelled 0), Incomplete: 7, Skipped: 0
Normal  Running    3h40m (x2 over 3h40m)  PipelineRun  Tasks Completed: 5 (Failed: 0, Cancelled 0), Incomplete: 6, Skipped: 0
Normal  Running    3h40m                  PipelineRun  Tasks Completed: 6 (Failed: 0, Cancelled 0), Incomplete: 5, Skipped: 0
Normal  Running    3h38m                  PipelineRun  Tasks Completed: 7 (Failed: 0, Cancelled 0), Incomplete: 4, Skipped: 0
Normal  Running    3h33m                  PipelineRun  Tasks Completed: 8 (Failed: 0, Cancelled 0), Incomplete: 3, Skipped: 0
Normal  Running    3h32m (x2 over 3h32m)  PipelineRun  Tasks Completed: 9 (Failed: 0, Cancelled 0), Incomplete: 2, Skipped: 0
Normal  Running    3h32m (x2 over 3h32m)  PipelineRun  (combined from similar events): Tasks Completed: 10 (Failed: 0, Cancelled 0), Incomplete: 1, Skipped: 0
Normal  Succeeded  3h32m (x2 over 3h32m)  PipelineRun  Tasks Completed: 11 (Failed: 0, Cancelled 0), Skipped: 0

Attached Pipeline is not that simple unfortunately.
I can try to make an minimal example next week if needed?

Any special reason for running a pipeline in the tekton-pipelines namespace?

Nope, just havent changed it yet. Will do so next week. Thanks for pointing it out.

@Bl4d3s
Copy link
Author

Bl4d3s commented Nov 24, 2020

I have updated my application to save if an event was already handled. So my issue is solved.

@Bl4d3s Bl4d3s closed this as completed Nov 24, 2020
@afrittoli
Copy link
Member

Thanks for the update on this issue, I'm glad you found a solution.

@GregDritschler found out that a change to the taskrun / pipelinerun, for instance adding a label, will trigger another reconcile. If the timing is right the informer cache may be stale, thus making it more likely to have duplicate start events - see #3558.

I don't see any extra label or annotation in your pipeline, so perhaps your issue is a different one, but I wanted to let you know anyways.

Even without updates with labels, there is a slight chance that the informer cache may be out of sync when a new reconcile start, so @GregDritschler is also working on fixing the case where this could lead to duplicate taskrun creation. It will not solve the case of duplicate start events, so it's good that you handle that on your side.

It would be interesting to understand why this happens so often for you. Could you perhaps share more information about what is your process for creating a pipelinerun?

@Bl4d3s
Copy link
Author

Bl4d3s commented Nov 24, 2020

I did try to add some additional information via a patch on the pipelinerun (either annotation or label). Probably this triggered the additional reconcile run.

Use case was the following:

  • Pipeline starts
  • another task is started with the started event, the Id of this was added as Label to be able to retrieve it later on other events more easily.

I solved it for me by caching it in the sink and not adding it to the pipelinerun as it's not needed there specifically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants