diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..e70949d --- /dev/null +++ b/changelog.md @@ -0,0 +1,9 @@ +## Changes + +### Bug Fixes + +* avoid breaking lighthouse job creation (Vincent Behar) + +### Pull Requests + +* [#2](https://github.com/jenkins-x/lighthouse-telemetry-plugin/pull/2) fix: avoid breaking tekton reconciliation diff --git a/charts/lighthouse-telemetry-plugin/Chart.yaml b/charts/lighthouse-telemetry-plugin/Chart.yaml index af57de1..6ea1856 100644 --- a/charts/lighthouse-telemetry-plugin/Chart.yaml +++ b/charts/lighthouse-telemetry-plugin/Chart.yaml @@ -3,7 +3,7 @@ name: lighthouse-telemetry-plugin description: Lighthouse plugin to export telemetry data, including distributed traces icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-website/master/images/logo/jenkinsx-icon-color.svg home: https://github.com/jenkins-x/lighthouse-telemetry-plugin -version: 0.0.1 +version: 0.0.4 appVersion: latest sources: - https://github.com/jenkins-x/lighthouse-telemetry-plugin \ No newline at end of file diff --git a/charts/lighthouse-telemetry-plugin/README.md b/charts/lighthouse-telemetry-plugin/README.md new file mode 100644 index 0000000..1962dfb --- /dev/null +++ b/charts/lighthouse-telemetry-plugin/README.md @@ -0,0 +1,85 @@ +# lighthouse-telemetry-plugin + +![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) + +Lighthouse plugin to export telemetry data, including distributed traces + +**Homepage:** + +## Source Code + +* + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| config.logLevel | string | `"INFO"` | | +| config.resyncInterval | string | `"1h"` | | +| deployment.annotations | object | `{}` | | +| deployment.labels | object | `{}` | | +| deployment.replicas | int | `1` | | +| deployment.revisionHistoryLimit | int | `2` | | +| fullnameOverride | string | `nil` | | +| image.pullPolicy | string | `nil` | | +| image.repository | string | `"gcr.io/jenkinsxio/lighthouse-telemetry-plugin"` | | +| image.tag | string | `nil` | | +| jx.releaseCRD | bool | `true` | | +| nameOverride | string | `nil` | | +| pod.activeDeadlineSeconds | string | `nil` | | +| pod.affinity | object | `{}` | | +| pod.annotations | object | `{}` | | +| pod.enableServiceLinks | bool | `false` | | +| pod.env | object | `{}` | | +| pod.hostAliases | list | `[]` | | +| pod.labels | object | `{}` | | +| pod.nodeSelector | object | `{}` | | +| pod.resources.limits.cpu | string | `"1"` | | +| pod.resources.limits.memory | string | `"512M"` | | +| pod.resources.requests.cpu | string | `"0.2"` | | +| pod.resources.requests.memory | string | `"256M"` | | +| pod.schedulerName | string | `nil` | | +| pod.securityContext.fsGroup | int | `1000` | | +| pod.terminationGracePeriodSeconds | string | `nil` | | +| pod.tolerations | list | `[]` | | +| role.rules[0].apiGroups[0] | string | `"jenkins.io"` | | +| role.rules[0].resources[0] | string | `"pipelineactivities"` | | +| role.rules[0].verbs[0] | string | `"list"` | | +| role.rules[0].verbs[1] | string | `"watch"` | | +| role.rules[0].verbs[2] | string | `"get"` | | +| role.rules[0].verbs[3] | string | `"patch"` | | +| role.rules[1].apiGroups[0] | string | `"tekton.dev"` | | +| role.rules[1].resources[0] | string | `"pipelineruns"` | | +| role.rules[1].resources[1] | string | `"taskruns"` | | +| role.rules[1].verbs[0] | string | `"list"` | | +| role.rules[1].verbs[1] | string | `"watch"` | | +| role.rules[1].verbs[2] | string | `"get"` | | +| role.rules[1].verbs[3] | string | `"patch"` | | +| role.rules[2].apiGroups[0] | string | `"lighthouse.jenkins.io"` | | +| role.rules[2].resources[0] | string | `"lighthousejobs"` | | +| role.rules[2].verbs[0] | string | `"list"` | | +| role.rules[2].verbs[1] | string | `"watch"` | | +| role.rules[2].verbs[2] | string | `"get"` | | +| role.rules[2].verbs[3] | string | `"patch"` | | +| role.rules[3].apiGroups[0] | string | `""` | | +| role.rules[3].resources[0] | string | `"pods"` | | +| role.rules[3].verbs[0] | string | `"list"` | | +| role.rules[3].verbs[1] | string | `"watch"` | | +| role.rules[3].verbs[2] | string | `"get"` | | +| role.rules[3].verbs[3] | string | `"patch"` | | +| role.rules[4].apiGroups[0] | string | `""` | | +| role.rules[4].resources[0] | string | `"events"` | | +| role.rules[4].verbs[0] | string | `"list"` | | +| role.rules[4].verbs[1] | string | `"watch"` | | +| role.rules[4].verbs[2] | string | `"get"` | | +| secrets.lighthouse.hmac.secretKeyRef.key | string | `"hmac"` | | +| secrets.lighthouse.hmac.secretKeyRef.name | string | `"lighthouse-hmac-token"` | | +| service.annotations | object | `{}` | | +| service.labels | object | `{}` | | +| service.loadBalancerIP | string | `nil` | | +| service.port | int | `80` | | +| service.type | string | `nil` | | +| serviceAccount.annotations | object | `{}` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.4.0](https://github.com/norwoodj/helm-docs/releases/v1.4.0) diff --git a/charts/lighthouse-telemetry-plugin/lighthouse-telemetry-plugin-0.0.4.tgz b/charts/lighthouse-telemetry-plugin/lighthouse-telemetry-plugin-0.0.4.tgz new file mode 100644 index 0000000..444c17e Binary files /dev/null and b/charts/lighthouse-telemetry-plugin/lighthouse-telemetry-plugin-0.0.4.tgz differ diff --git a/charts/lighthouse-telemetry-plugin/templates/release.yaml b/charts/lighthouse-telemetry-plugin/templates/release.yaml new file mode 100644 index 0000000..d793d42 --- /dev/null +++ b/charts/lighthouse-telemetry-plugin/templates/release.yaml @@ -0,0 +1,56 @@ +{{- if and (.Capabilities.APIVersions.Has "jenkins.io/v1/Release") (hasKey .Values.jx "releaseCRD") (.Values.jx.releaseCRD)}} +apiVersion: jenkins.io/v1 +kind: Release +metadata: + creationTimestamp: "2021-05-20T13:39:20Z" + deletionTimestamp: null + name: '{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}' +spec: + commits: + - author: + email: v.behar@free.fr + name: Vincent Behar + branch: master + committer: + email: v.behar@free.fr + name: Vincent Behar + issueIds: + - "2" + message: | + fix: avoid breaking lighthouse job creation + + similar as #2 but for lighthouse + + lighthouse creates its jobs in 2 steps: + - for the job with its spec + - and then it updates the status to set the initial state ("triggered") + + if we patch the job in the middle of these 2 steps, the status update will fail, and the job creation will fail, and the pipeline won't be triggered + + the fix is to wait until the state is defined in the status before patching the job + sha: 71de25e6e9c7722c4f487e8f8708569c13f3c99d + gitHttpUrl: https://github.com/jenkins-x/lighthouse-telemetry-plugin + gitOwner: jenkins-x + gitRepository: lighthouse-telemetry-plugin + name: '{{ .Chart.Name }}' + pullRequests: + - body: "on old tekton v0.11.3 (used in jx v2), the pipelinerun reconciliation might + fail because the tekton controller can't update the pipelinerun, because it + has been changed (by our patching operation).\r\nthis is turn result in multiple + taskruns being created (1 for each reconciliation attempt).\r\n\r\nthe \"fix\" + is to wait until the initial reconciliation is finished, which is after the + tekton controller has updated the PR labels, adding the `tekton.dev/pipeline` + label.\r\nwhich is why here we are now waiting until this label is present before + handling the PR." + creationTimestamp: "2021-05-17T13:49:34Z" + id: "2" + labels: + - url: approved + - url: size/XS + state: closed + title: 'fix: avoid breaking tekton reconciliation' + url: https://github.com/jenkins-x/lighthouse-telemetry-plugin/pull/2 + version: 0.0.4 +status: {} + +{{- end }} diff --git a/charts/lighthouse-telemetry-plugin/values.yaml b/charts/lighthouse-telemetry-plugin/values.yaml index b53ce2c..21693de 100644 --- a/charts/lighthouse-telemetry-plugin/values.yaml +++ b/charts/lighthouse-telemetry-plugin/values.yaml @@ -21,7 +21,7 @@ jx: image: repository: gcr.io/jenkinsxio/lighthouse-telemetry-plugin # If no tag, fallback to the Chart's AppVersion - tag: + tag: 0.0.4 pullPolicy: deployment: