From 84e243a213ffba86eddd51ccc4bf4dbd61140069 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Tue, 29 Aug 2023 09:22:12 +0200 Subject: [PATCH 01/78] feat: monorepo setup for lifecycle-operator, scheduler and runtimes (#1857) Co-authored-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Co-authored-by: Giovanni Liva --- .../actions/deploy-klt-on-cluster/action.yml | 4 +- .github/workflows/CI.yaml | 10 +- .github/workflows/integration-test.yml | 2 +- .github/workflows/load-test.yml | 2 +- .github/workflows/performance-test.yml | 2 +- .github/workflows/release.yml | 245 +++--------------- .github/workflows/security-scans.yml | 1 + .github/workflows/validate-semantic-pr.yml | 3 +- Makefile | 4 - docs/content/en/docs/install/install.md | 8 +- .../content/en/docs/snippets/tasks/install.md | 59 ----- .../en/docs/yaml-crd-ref/taskdefinition.md | 4 +- examples/sample-app/base/app-post-deploy.yaml | 2 +- examples/sample-app/base/python-task.yaml | 2 +- .../sample-app/version-1/app-pre-deploy.yaml | 2 +- .../sample-app/version-2/app-pre-deploy.yaml | 2 +- .../sample-app/version-3/app-pre-deploy.yaml | 2 +- .../check_entry.yaml | 2 +- helm/chart/README.md | 58 ++--- helm/chart/doc.yaml | 8 +- helm/chart/values.yaml | 2 +- klt-cert-manager/Makefile | 1 - lifecycle-operator/Makefile | 1 - .../config/manager/manager.yaml | 4 +- .../taskdefinition_function_upstream.yaml | 2 +- ...efinition_function_upstream_scheduler.yaml | 2 +- ...askdefinition_function_upstream_slack.yaml | 2 +- ...efinition_pyfunction_upstream_hellopy.yaml | 2 +- metrics-operator/Makefile | 1 - release-please-config.json | 63 ++++- renovate.json | 4 - .../deno-runtime}/Dockerfile | 0 .../deno-runtime}/README.md | 16 +- .../deno-runtime}/entrypoint.sh | 0 .../deno-runtime}/samples/ts/dns.ts | 0 .../deno-runtime}/samples/ts/hello-world.ts | 0 .../deno-runtime}/samples/ts/http.ts | 0 .../deno-runtime}/samples/ts/prometheus.ts | 0 .../deno-runtime}/samples/ts/schedule.ts | 0 .../deno-runtime}/samples/ts/slack.ts | 0 .../python-runtime}/Dockerfile | 0 .../python-runtime}/README.md | 10 +- .../python-runtime}/entrypoint.sh | 0 .../python-runtime}/samples/args.py | 0 .../python-runtime}/samples/hellopy.py | 0 .../python-runtime}/samples/secrets.py | 0 .../app-failing-pre-task/00-install.yaml | 2 +- .../podtato-head-application/00-install.yaml | 2 +- .../restartable-app/00-install.yaml | 2 +- .../00-install.yaml | 2 +- 50 files changed, 181 insertions(+), 359 deletions(-) delete mode 100644 docs/content/en/docs/snippets/tasks/install.md rename {functions-runtime => runtimes/deno-runtime}/Dockerfile (100%) rename {functions-runtime => runtimes/deno-runtime}/README.md (83%) rename {functions-runtime => runtimes/deno-runtime}/entrypoint.sh (100%) rename {functions-runtime => runtimes/deno-runtime}/samples/ts/dns.ts (100%) rename {functions-runtime => runtimes/deno-runtime}/samples/ts/hello-world.ts (100%) rename {functions-runtime => runtimes/deno-runtime}/samples/ts/http.ts (100%) rename {functions-runtime => runtimes/deno-runtime}/samples/ts/prometheus.ts (100%) rename {functions-runtime => runtimes/deno-runtime}/samples/ts/schedule.ts (100%) rename {functions-runtime => runtimes/deno-runtime}/samples/ts/slack.ts (100%) rename {python-runtime => runtimes/python-runtime}/Dockerfile (100%) rename {python-runtime => runtimes/python-runtime}/README.md (81%) rename {python-runtime => runtimes/python-runtime}/entrypoint.sh (100%) rename {python-runtime => runtimes/python-runtime}/samples/args.py (100%) rename {python-runtime => runtimes/python-runtime}/samples/hellopy.py (100%) rename {python-runtime => runtimes/python-runtime}/samples/secrets.py (100%) diff --git a/.github/actions/deploy-klt-on-cluster/action.yml b/.github/actions/deploy-klt-on-cluster/action.yml index d072e7ca3af..8bf2768a593 100644 --- a/.github/actions/deploy-klt-on-cluster/action.yml +++ b/.github/actions/deploy-klt-on-cluster/action.yml @@ -62,7 +62,7 @@ runs: run: | echo "Installing KLT using manifests" sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' ~/download/artifacts/lifecycle-operator-manifest-test/release.yaml - sed -i 's/ghcr.io\/keptn\/functions-runtime:.*/localhost:5000\/keptn\/functions-runtime:${{ inputs.runtime_tag }}/g' \ + sed -i 's/ghcr.io\/keptn\/deno-runtime:.*/localhost:5000\/keptn\/deno-runtime:${{ inputs.runtime_tag }}/g' \ ~/download/artifacts/lifecycle-operator-manifest-test/release.yaml sed -i 's/ghcr.io\/keptn\/python-runtime:.*/localhost:5000\/keptn\/python-runtime:${{ inputs.runtime_tag }}/g' \ ~/download/artifacts/lifecycle-operator-manifest-test/release.yaml @@ -100,7 +100,7 @@ runs: --set metricsOperator.manager.imagePullPolicy=Never \ --set metricsOperator.manager.image.tag=${{ inputs.runtime_tag }} \ --set metricsOperator.manager.image.repository="localhost:5000/keptn/metrics-operator" \ - --set lifecycleOperator.manager.env.functionRunnerImage=localhost:5000/keptn/functions-runtime:${{ inputs.runtime_tag }} \ + --set lifecycleOperator.manager.env.functionRunnerImage=localhost:5000/keptn/deno-runtime:${{ inputs.runtime_tag }} \ --set lifecycleOperator.manager.env.pythonRunnerImage=localhost:5000/keptn/python-runtime:${{ inputs.runtime_tag }} \ --set certificateOperator.manager.imagePullPolicy=Never \ --set certificateOperator.manager.image.tag=${{ inputs.runtime_tag }} \ diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 875c9f855d6..8cd7a2ddfb2 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -130,10 +130,10 @@ jobs: folder: "metrics-operator/" - name: "scheduler" folder: "scheduler/" - - name: "functions-runtime" - folder: "functions-runtime/" + - name: "deno-runtime" + folder: "runtimes/deno-runtime/" - name: "python-runtime" - folder: "python-runtime/" + folder: "runtimes/python-runtime/" - name: "certificate-operator" folder: "klt-cert-manager/" steps: @@ -186,14 +186,14 @@ jobs: run: make controller-gen - name: Generate release.yaml - if: matrix.config.name != 'functions-runtime' && matrix.config.name != 'python-runtime' + if: matrix.config.name != 'deno-runtime' && matrix.config.name != 'python-runtime' working-directory: ./${{ matrix.config.folder }} env: CHART_APPVERSION: dev-${{ env.DATETIME }} run: make release-manifests - name: Upload release.yaml for tests - if: matrix.config.name != 'functions-runtime' && matrix.config.name != 'python-runtime' + if: matrix.config.name != 'deno-runtime' && matrix.config.name != 'python-runtime' uses: actions/upload-artifact@v3 with: name: ${{ matrix.config.name }}-manifest-test diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 36869055f6e..039c68bf460 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -3,7 +3,7 @@ on: workflow_call: inputs: runtime_tag: - description: "Tag for the functions runner image" + description: "Tag for the deno and python runner images" type: "string" required: true helm-install: diff --git a/.github/workflows/load-test.yml b/.github/workflows/load-test.yml index 01d42f0c112..97579689957 100644 --- a/.github/workflows/load-test.yml +++ b/.github/workflows/load-test.yml @@ -3,7 +3,7 @@ on: workflow_call: inputs: runtime_tag: - description: "Tag for the functions runner image" + description: "Tag for the runner images" type: "string" required: true env: diff --git a/.github/workflows/performance-test.yml b/.github/workflows/performance-test.yml index 3c20546e834..3099566d449 100644 --- a/.github/workflows/performance-test.yml +++ b/.github/workflows/performance-test.yml @@ -3,7 +3,7 @@ on: workflow_call: inputs: runtime_tag: - description: "Tag for the functions runner image" + description: "Tag for the runner images" type: "string" required: true env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a20aad7edef..5f1b4837423 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,7 @@ env: # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools CONTROLLER_TOOLS_VERSION: "v0.12.1" SCHEDULER_COMPATIBLE_K8S_VERSION: "v0.24.3" + PUBLISHABLE_ITEMS: '[".", "lifecycle-operator", "metrics-operator", "klt-cert-manager", "runtimes/deno-runtime", "runtimes/python-runtime"]' jobs: release-please: @@ -45,71 +46,53 @@ jobs: default-branch: main signoff: "keptn-bot <86361500+keptn-bot@users.noreply.github.com>" - - name: Release Info - run: | - echo "Release KLT: ${{ steps.release.outputs.release_created }}" - echo "Release KLT Cert Manager: ${{ steps.release.outputs.klt-cert-manager--release_created }}" - echo "Release KLT Metrics Operator: ${{ steps.release.outputs.metrics-operator--release_created }}" - echo "Anything to release: ${{ steps.release.outputs.releases_created }}" - echo "Paths to be released: ${{ steps.release.outputs.paths_released }}" - - - name: Create build matrix + - name: Create release matrix id: build-matrix uses: actions/github-script@v6 env: - RELEASE_KLT: ${{ steps.release.outputs.release_created }} - RELEASE_CERT_MANAGER: ${{ steps.release.outputs.klt-cert-manager--release_created }} - RELEASE_METRICS_OPERATOR: ${{ steps.release.outputs.metrics-operator--release_created }} + CHANGED_ITEMS: ${{ steps.release.outputs.paths_released }} KLT_TAG: ${{ steps.release.outputs.tag_name }} - CERT_MANAGER_TAG: ${{ steps.release.outputs.klt-cert-manager--tag_name }} - METRICS_OPERATOR_TAG: ${{ steps.release.outputs.metrics-operator--tag_name }} + ARTIFACT_TAG_NAME: ${{ steps.release.outputs[format('{0}--tag_name', steps.release.outputs.paths_released[0])] }} with: script: | - const { RELEASE_KLT, RELEASE_CERT_MANAGER, RELEASE_METRICS_OPERATOR, KLT_TAG, CERT_MANAGER_TAG, METRICS_OPERATOR_TAG } = process.env - - var result = [] - if (RELEASE_KLT === "true") { - result.push(...[ - { - name: "lifecycle-operator", - folder: "lifecycle-operator/", - tagName: KLT_TAG - }, - { - name: "scheduler", - folder: "scheduler/", - tagName: KLT_TAG - }, - { - name: "functions-runtime", - folder: "functions-runtime/", - tagName: KLT_TAG - }, - { - name: "python-runtime", - folder: "python-runtime/", - tagName: KLT_TAG + const changedItems = JSON.parse(process.env.CHANGED_ITEMS || '[]'); + console.log("changed items", changedItems); + const eligibleItems = JSON.parse(process.env.PUBLISHABLE_ITEMS || '[]'); + console.log("eligible items", eligibleItems); + const itemsToPublish = changedItems.filter(i => eligibleItems.includes(i)); + console.log("items to publish", itemsToPublish); + + console.log("setting up build matrix..."); + const releaseMatrix = itemsToPublish.map(item => { + switch (item) { + case "lifecycle-operator": + return [ + { + name: item, + folder: item, + tagName: process.env.ARTIFACT_TAG_NAME + }, + { + name: "scheduler", + folder: "scheduler/", + tagName: process.env.ARTIFACT_TAG_NAME + } + ]; + case "metrics-operator": + case "klt-cert-manager": + case "runtimes/deno-runtime": + case "runtimes/python-runtime": + return [{ + name: item, + folder: item, + tagName: process.env.ARTIFACT_TAG_NAME + }]; + case ".": + default: + return []; } - ]) - } - - if (RELEASE_CERT_MANAGER === "true") { - result.push({ - name: "certificate-operator", - folder: "klt-cert-manager/", - tagName: CERT_MANAGER_TAG - }) - } - - if (RELEASE_METRICS_OPERATOR === "true") { - result.push({ - name: "metrics-operator", - folder: "metrics-operator/", - tagName: METRICS_OPERATOR_TAG - }) - } - - return { config: result } + }); + return releaseMatrix; build-release: if: needs.release-please.outputs.releases-created == 'true' @@ -200,152 +183,6 @@ jobs: tag_name: ${{ matrix.config.tagName }} files: ./sbom-${{ matrix.config.name }}.spdx.json - release-manifests: - if: needs.release-please.outputs.releases-created == 'true' - needs: - - release-please - - build-release - runs-on: ubuntu-22.04 - steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - - name: Checkout - uses: actions/checkout@v3 - - - name: Cache build tools lifecycle-operator - if: needs.release-please.outputs.klt-release-created == 'true' - id: cache-build-tools-lifecycle-operator - uses: actions/cache@v3 - with: - path: ./lifecycle-operator/bin - key: build-tools-${{ github.ref_name }} - - - name: Cache build tools metrics-operator - if: needs.release-please.outputs.metrics-operator-release-created == 'true' - id: cache-build-tools-metrics-operator - uses: actions/cache@v3 - with: - path: ./metrics-operator/bin - key: build-tools-${{ github.ref_name }} - - - name: Cache build tools scheduler - if: needs.release-please.outputs.klt-release-created == 'true' - id: cache-build-tools-scheduler - uses: actions/cache@v3 - with: - path: ./scheduler/bin - key: build-tools-${{ github.ref_name }} - - - name: Cache build tools cert-manager - if: needs.release-please.outputs.cert-manager-release-created == 'true' - id: cache-build-tools-klt-cert-manager - uses: actions/cache@v3 - with: - path: ./klt-cert-manager/bin - key: build-tools-${{ github.ref_name }} - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: ${{ env.GO_VERSION }} - check-latest: true - - - name: Create KLT manifest - if: needs.release-please.outputs.klt-release-created == 'true' - env: - RELEASE_REGISTRY: ghcr.io/keptn - CHART_APPVERSION: ${{ needs.release-please.outputs.klt-tag-name }} - run: | - cd scheduler - make release-manifests - cd ../lifecycle-operator - make controller-gen release-manifests - cd ../klt-cert-manager - make controller-gen release-manifests - cd ../metrics-operator - make controller-gen release-manifests - cd .. - echo "---" >> lifecycle-operator/config/rendered/release.yaml - echo "---" >> scheduler/config/rendered/release.yaml - echo "---" >> klt-cert-manager/config/rendered/release.yaml - cat >> namespace.yaml << EOF - --- - apiVersion: v1 - kind: Namespace - metadata: - name: keptn-lifecycle-toolkit-system - --- - EOF - cat namespace.yaml \ - lifecycle-operator/config/rendered/release.yaml \ - scheduler/config/rendered/release.yaml \ - klt-cert-manager/config/rendered/release.yaml \ - metrics-operator/config/rendered/release.yaml > klt-manifest.yaml - - - name: Create Cert-Manager manifest - if: needs.release-please.outputs.cert-manager-release-created == 'true' - env: - RELEASE_REGISTRY: ghcr.io/keptn - CHART_APPVERSION: ${{ needs.release-please.outputs.cert-manager-tag-name }} - run: | - cd klt-cert-manager - make controller-gen release-manifests - cd .. - echo "---" >> klt-cert-manager/config/rendered/release.yaml - cat >> namespace.yaml << EOF - --- - apiVersion: v1 - kind: Namespace - metadata: - name: keptn-lifecycle-toolkit-system - --- - EOF - cat namespace.yaml \ - klt-cert-manager/config/rendered/release.yaml > cert-manager-manifest.yaml - - - name: Create Metrics Operator manifest - if: needs.release-please.outputs.metrics-operator-release-created == 'true' - env: - RELEASE_REGISTRY: ghcr.io/keptn - CHART_APPVERSION: ${{ needs.release-please.outputs.metrics-operator-tag-name }} - run: | - cd metrics-operator - make controller-gen release-manifests - cd .. - echo "---" >> metrics-operator/config/rendered/release.yaml - cat >> namespace.yaml << EOF - --- - apiVersion: v1 - kind: Namespace - metadata: - name: keptn-lifecycle-toolkit-system - --- - EOF - cat namespace.yaml \ - metrics-operator/config/rendered/release.yaml > metrics-operator-manifest.yaml - - - name: Attach KLT release assets - if: needs.release-please.outputs.klt-release-created == 'true' - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ needs.release-please.outputs.klt-tag-name }} - files: klt-manifest.yaml - - - name: Attach Cert-Manager release assets - if: needs.release-please.outputs.cert-manager-release-created == 'true' - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ needs.release-please.outputs.cert-manager-tag-name }} - files: cert-manager-manifest.yaml - - - name: Attach Metrics Operator release assets - if: needs.release-please.outputs.metrics-operator-release-created == 'true' - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ needs.release-please.outputs.metrics-operator-tag-name }} - files: metrics-operator-manifest.yaml - update-docs: name: Update Documentation needs: diff --git a/.github/workflows/security-scans.yml b/.github/workflows/security-scans.yml index 886971b65b6..f0b8e05630d 100644 --- a/.github/workflows/security-scans.yml +++ b/.github/workflows/security-scans.yml @@ -200,6 +200,7 @@ jobs: matrix: image: - "functions-runtime" + - "deno-runtime" - "python-runtime" - "lifecycle-operator" - "metrics-operator" diff --git a/.github/workflows/validate-semantic-pr.yml b/.github/workflows/validate-semantic-pr.yml index 018f4b228a9..ac32215f905 100644 --- a/.github/workflows/validate-semantic-pr.yml +++ b/.github/workflows/validate-semantic-pr.yml @@ -36,12 +36,13 @@ jobs: test deps scopes: | + main helm-chart scheduler lifecycle-operator cert-manager metrics-operator - functions-runtime + deno-runtime python-runtime dashboards examples diff --git a/Makefile b/Makefile index 44ff29bfeb4..40157016503 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,6 @@ integration-test: # to run a single test by name use --test eg. --test=expose-ke kubectl kuttl test --start-kind=false ./test/integration/ --config=kuttl-test.yaml kubectl kuttl test --start-kind=false ./test/testcertificate/ --config=kuttl-test.yaml - - .PHONY: integration-test-local #these tests should run on a real cluster! integration-test-local: install-prometheus kubectl kuttl test --start-kind=false ./test/integration/ --config=kuttl-test-local.yaml @@ -51,8 +49,6 @@ install-prometheus: kubectl wait --for=condition=available deployment/kube-state-metrics -n monitoring --timeout=120s kubectl wait pod/prometheus-k8s-0 --for=condition=ready --timeout=120s -n monitoring - - .PHONY: cleanup-manifests cleanup-manifests: rm -rf manifests diff --git a/docs/content/en/docs/install/install.md b/docs/content/en/docs/install/install.md index 2fa1b2617b0..35e435f600f 100644 --- a/docs/content/en/docs/install/install.md +++ b/docs/content/en/docs/install/install.md @@ -19,8 +19,7 @@ Two methods are supported for installing the Keptn Lifecycle Toolkit (KLT): the [Helm Chart](#use-helm-chart). This is the preferred strategy because it allows you to customize your cluster. -* All releases can be installed using - the [manifests](#use-manifests). +* See the [use manifests](#use-manifests) section for more information on installing via manifest. This is the less-preferred way because it does not support customization. After KLT is installed, you must @@ -109,10 +108,9 @@ For more information,see ## Use manifests -All versions of the Lifecycle Toolkit can be installed using manifests, +Versions v0.10.0 and earlier of the Lifecycle Toolkit can be installed using manifests, although we recommend that you use Helm Charts -to install Version 0.7.0 and later -because the Helm Charts allow you to customize your configuration. +because they allow you to easily customize your configuration. Versions 0.6.0 and earlier can only be installed using manifests. diff --git a/docs/content/en/docs/snippets/tasks/install.md b/docs/content/en/docs/snippets/tasks/install.md deleted file mode 100644 index 7e3ee88434c..00000000000 --- a/docs/content/en/docs/snippets/tasks/install.md +++ /dev/null @@ -1,59 +0,0 @@ -# Installation Instructions - -## Install version 0.7.0 and above - -In version 0.7.0 and later, you can install the Lifecycle Toolkit using either helm charts or manifests. - -For installing the Lifecycle Toolkit via Helm chart: - -```shell -helm repo add klt https://charts.lifecycle.keptn.sh -helm repo update -helm upgrade --install keptn klt/klt -n keptn-lifecycle-toolkit-system --create-namespace --wait -``` - -To install a specific version, use the `--version ` flag as part of the -`helm upgrade --install` command. - -To list available versions: - -```shell -helm repo update -helm search repo keptn-lifecycle-toolkit -``` - -The `helm upgrade --install` command offers a flag called `--set`, which can be used to specify -configuration options using the format key1=value1,key2=value2,.... - -Or you could download the chart value file and modify it using - -```shell -helm get values RELEASE_NAME [flags] > values.yaml -``` - -and install adding `--values=values.yaml` to your `helm upgrade` command (official documentation -available [here](https://helm.sh/docs/helm/helm_get_values/)). - -The full list of available flags can be found in the [helm-charts](https://github.com/keptn/lifecycle-toolkit/blob/main/helm/chart/README.md). - -> **Note** -Installation of the Lifecycle Toolkit version 0.6.0 and lower is not supported via helm charts. - -
-Install Keptn using Manifests - -All versions of the Lifecycle Toolkit can be installed using manifests, -with a command like the following: - - - -```shell -kubectl apply -f https://github.com/keptn/lifecycle-toolkit/releases/download/v0.8.1/manifest.yaml -kubectl wait --for=condition=Available deployment/lifecycle-operator -n keptn-lifecycle-toolkit-system --timeout=120s -``` - - - -The Lifecycle Toolkit and its dependencies are now installed and ready to use. - -
diff --git a/docs/content/en/docs/yaml-crd-ref/taskdefinition.md b/docs/content/en/docs/yaml-crd-ref/taskdefinition.md index 2182ca35725..1f85022d1e2 100644 --- a/docs/content/en/docs/yaml-crd-ref/taskdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/taskdefinition.md @@ -150,7 +150,7 @@ spec: * **spec** * **deno** -- Specify that the task uses the `deno-runtime` and is expressed as a [Deno](https://deno.land/) script. - Refer to [function runtime](https://github.com/keptn/lifecycle-toolkit/tree/main/functions-runtime) + Refer to [deno runtime](https://github.com/keptn/lifecycle-toolkit/tree/main/runtimes/deno-runtime) for more information about this runner. The task can be defined as one of the following: @@ -580,7 +580,7 @@ This example prints data stored in the parameters map: You can refer to code stored online. For example, we have a few examples available in the -[python-runtime samples](https://github.com/keptn/lifecycle-toolkit/tree/main/python-runtime/samples) +[python-runtime samples](https://github.com/keptn/lifecycle-toolkit/tree/main/runtimes/python-runtime/samples) tree. Consider the following: diff --git a/examples/sample-app/base/app-post-deploy.yaml b/examples/sample-app/base/app-post-deploy.yaml index 744a4e501d4..f939eba9206 100644 --- a/examples/sample-app/base/app-post-deploy.yaml +++ b/examples/sample-app/base/app-post-deploy.yaml @@ -6,6 +6,6 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-controller/main/functions-runtime/samples/ts/slack.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-controller/main/runtimes/deno-runtime/samples/ts/slack.ts secureParameters: secret: slack-secret diff --git a/examples/sample-app/base/python-task.yaml b/examples/sample-app/base/python-task.yaml index 22ab5e4f358..334f2ec3931 100644 --- a/examples/sample-app/base/python-task.yaml +++ b/examples/sample-app/base/python-task.yaml @@ -6,7 +6,7 @@ metadata: spec: python: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-controller/main/python-runtime/samples/secrets.py + url: https://raw.githubusercontent.com/keptn/lifecycle-controller/main/runtimes/python-runtime/samples/secrets.py parameters: map: user: "myuser" diff --git a/examples/sample-app/version-1/app-pre-deploy.yaml b/examples/sample-app/version-1/app-pre-deploy.yaml index 6dd21ae0e9d..36a243ec2ef 100644 --- a/examples/sample-app/version-1/app-pre-deploy.yaml +++ b/examples/sample-app/version-1/app-pre-deploy.yaml @@ -6,7 +6,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/functions-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-frontend.podtato-kubectl.svc.cluster.local:8080 diff --git a/examples/sample-app/version-2/app-pre-deploy.yaml b/examples/sample-app/version-2/app-pre-deploy.yaml index 6dd21ae0e9d..36a243ec2ef 100644 --- a/examples/sample-app/version-2/app-pre-deploy.yaml +++ b/examples/sample-app/version-2/app-pre-deploy.yaml @@ -6,7 +6,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/functions-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-frontend.podtato-kubectl.svc.cluster.local:8080 diff --git a/examples/sample-app/version-3/app-pre-deploy.yaml b/examples/sample-app/version-3/app-pre-deploy.yaml index 6dd21ae0e9d..36a243ec2ef 100644 --- a/examples/sample-app/version-3/app-pre-deploy.yaml +++ b/examples/sample-app/version-3/app-pre-deploy.yaml @@ -6,7 +6,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/functions-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-frontend.podtato-kubectl.svc.cluster.local:8080 diff --git a/examples/support/observability/assets/podtatohead-deployment-evaluation/check_entry.yaml b/examples/support/observability/assets/podtatohead-deployment-evaluation/check_entry.yaml index 61f8a2773d9..6d449511637 100644 --- a/examples/support/observability/assets/podtatohead-deployment-evaluation/check_entry.yaml +++ b/examples/support/observability/assets/podtatohead-deployment-evaluation/check_entry.yaml @@ -6,7 +6,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-entry.podtato-kubectl.svc.cluster.local:9000 diff --git a/helm/chart/README.md b/helm/chart/README.md index 80c105f6645..1e3f2d1cf69 100644 --- a/helm/chart/README.md +++ b/helm/chart/README.md @@ -13,7 +13,7 @@ checks | `scheduler.scheduler.containerSecurityContext` | Sets security context | | | `scheduler.scheduler.env.otelCollectorUrl` | sets url for open telemetry collector | `otel-collector:4317` | | `scheduler.scheduler.image.repository` | set image repository for scheduler | `ghcr.io/keptn/scheduler` | -| `scheduler.scheduler.image.tag` | set image tag for scheduler | `v0.8.1` | +| `scheduler.scheduler.image.tag` | set image tag for scheduler | `v0.8.1` | | `scheduler.scheduler.imagePullPolicy` | set image pull policy for scheduler | `Always` | | `scheduler.scheduler.livenessProbe` | customizable liveness probe for the scheduler | | | `scheduler.scheduler.readinessProbe` | customizable readiness probe for the scheduler | | @@ -71,34 +71,34 @@ checks ### Keptn Lifecycle Operator controller -| Name | Description | Value | -| ----------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------- | -| `lifecycleOperator.manager.containerSecurityContext` | Sets security context privileges | | -| `lifecycleOperator.manager.containerSecurityContext.allowPrivilegeEscalation` | | `false` | -| `lifecycleOperator.manager.containerSecurityContext.capabilities.drop` | | `["ALL"]` | -| `lifecycleOperator.manager.containerSecurityContext.privileged` | | `false` | -| `lifecycleOperator.manager.containerSecurityContext.runAsGroup` | | `65532` | -| `lifecycleOperator.manager.containerSecurityContext.runAsNonRoot` | | `true` | -| `lifecycleOperator.manager.containerSecurityContext.runAsUser` | | `65532` | -| `lifecycleOperator.manager.containerSecurityContext.seccompProfile.type` | | `RuntimeDefault` | -| `lifecycleOperator.manager.env.keptnAppControllerLogLevel` | sets the log level of Keptn App Controller | `0` | -| `lifecycleOperator.manager.env.keptnAppCreationRequestControllerLogLevel` | sets the log level of Keptn App Creation Request Controller | `0` | -| `lifecycleOperator.manager.env.keptnAppVersionControllerLogLevel` | sets the log level of Keptn AppVersion Controller | `0` | -| `lifecycleOperator.manager.env.keptnEvaluationControllerLogLevel` | sets the log level of Keptn Evaluation Controller | `0` | -| `lifecycleOperator.manager.env.keptnTaskControllerLogLevel` | sets the log level of Keptn Task Controller | `0` | -| `lifecycleOperator.manager.env.keptnTaskDefinitionControllerLogLevel` | sets the log level of Keptn TaskDefinition Controller | `0` | -| `lifecycleOperator.manager.env.keptnWorkloadControllerLogLevel` | sets the log level of Keptn Workload Controller | `0` | -| `lifecycleOperator.manager.env.keptnWorkloadInstanceControllerLogLevel` | sets the log level of Keptn WorkloadInstance Controller | `0` | -| `lifecycleOperator.manager.env.optionsControllerLogLevel` | sets the log level of Keptn Options Controller | `0` | -| `lifecycleOperator.manager.env.otelCollectorUrl` | Sets the URL for the open telemetry collector | `otel-collector:4317` | -| `lifecycleOperator.manager.env.functionRunnerImage` | specify image for deno task runtime | `ghcr.io/keptn/functions-runtime:v0.8.1` | -| `lifecycleOperator.manager.env.pythonRunnerImage` | specify image for python task runtime | `ghcr.io/keptn/python-runtime:v0.8.1` | -| `lifecycleOperator.manager.image.repository` | specify registry for manager image | `ghcr.io/keptn/lifecycle-operator` | -| `lifecycleOperator.manager.image.tag` | select tag for manager image | `v0.8.1` | -| `lifecycleOperator.manager.imagePullPolicy` | specify pull policy for manager image | `Always` | -| `lifecycleOperator.manager.livenessProbe` | custom livenessprobe for manager container | | -| `lifecycleOperator.manager.readinessProbe` | custom readinessprobe for manager container | | -| `lifecycleOperator.manager.resources` | specify limits and requests for manager container | | +| Name | Description | Value | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------- | +| `lifecycleOperator.manager.containerSecurityContext` | Sets security context privileges | | +| `lifecycleOperator.manager.containerSecurityContext.allowPrivilegeEscalation` | | `false` | +| `lifecycleOperator.manager.containerSecurityContext.capabilities.drop` | | `["ALL"]` | +| `lifecycleOperator.manager.containerSecurityContext.privileged` | | `false` | +| `lifecycleOperator.manager.containerSecurityContext.runAsGroup` | | `65532` | +| `lifecycleOperator.manager.containerSecurityContext.runAsNonRoot` | | `true` | +| `lifecycleOperator.manager.containerSecurityContext.runAsUser` | | `65532` | +| `lifecycleOperator.manager.containerSecurityContext.seccompProfile.type` | | `RuntimeDefault` | +| `lifecycleOperator.manager.env.keptnAppControllerLogLevel` | sets the log level of Keptn App Controller | `0` | +| `lifecycleOperator.manager.env.keptnAppCreationRequestControllerLogLevel` | sets the log level of Keptn App Creation Request Controller | `0` | +| `lifecycleOperator.manager.env.keptnAppVersionControllerLogLevel` | sets the log level of Keptn AppVersion Controller | `0` | +| `lifecycleOperator.manager.env.keptnEvaluationControllerLogLevel` | sets the log level of Keptn Evaluation Controller | `0` | +| `lifecycleOperator.manager.env.keptnTaskControllerLogLevel` | sets the log level of Keptn Task Controller | `0` | +| `lifecycleOperator.manager.env.keptnTaskDefinitionControllerLogLevel` | sets the log level of Keptn TaskDefinition Controller | `0` | +| `lifecycleOperator.manager.env.keptnWorkloadControllerLogLevel` | sets the log level of Keptn Workload Controller | `0` | +| `lifecycleOperator.manager.env.keptnWorkloadInstanceControllerLogLevel` | sets the log level of Keptn WorkloadInstance Controller | `0` | +| `lifecycleOperator.manager.env.optionsControllerLogLevel` | sets the log level of Keptn Options Controller | `0` | +| `lifecycleOperator.manager.env.otelCollectorUrl` | Sets the URL for the open telemetry collector | `otel-collector:4317` | +| `lifecycleOperator.manager.env.functionRunnerImage` | specify image for deno task runtime | `ghcr.io/keptn/deno-runtime:v0.8.1` | +| `lifecycleOperator.manager.env.pythonRunnerImage` | specify image for python task runtime | `ghcr.io/keptn/python-runtime:v0.8.1` | +| `lifecycleOperator.manager.image.repository` | specify registry for manager image | `ghcr.io/keptn/lifecycle-operator` | +| `lifecycleOperator.manager.image.tag` | select tag for manager image | `v0.8.1` | +| `lifecycleOperator.manager.imagePullPolicy` | specify pull policy for manager image | `Always` | +| `lifecycleOperator.manager.livenessProbe` | custom livenessprobe for manager container | | +| `lifecycleOperator.manager.readinessProbe` | custom readinessprobe for manager container | | +| `lifecycleOperator.manager.resources` | specify limits and requests for manager container | | ### Keptn Metrics Operator common diff --git a/helm/chart/doc.yaml b/helm/chart/doc.yaml index bdef4ff48cc..c6a29380198 100644 --- a/helm/chart/doc.yaml +++ b/helm/chart/doc.yaml @@ -12,7 +12,7 @@ ## @param scheduler.scheduler.env.otelCollectorUrl sets url for open telemetry collector ## @param scheduler.scheduler.image.repository set image repository for scheduler -## @param scheduler.scheduler.image.tag set image tag for scheduler +## @param scheduler.scheduler.image.tag set image tag for scheduler ## @param scheduler.scheduler.imagePullPolicy set image pull policy for scheduler ## @extra scheduler.scheduler.livenessProbe customizable liveness probe for the scheduler @@ -132,11 +132,11 @@ ## @param lifecycleOperator.manager.env.optionsControllerLogLevel sets the log level of Keptn Options Controller ## @param lifecycleOperator.manager.env.otelCollectorUrl Sets the URL for the open telemetry collector -## @param lifecycleOperator.manager.env.functionRunnerImage specify image for deno task runtime -## @param lifecycleOperator.manager.env.pythonRunnerImage specify image for python task runtime +## @param lifecycleOperator.manager.env.functionRunnerImage specify image for deno task runtime +## @param lifecycleOperator.manager.env.pythonRunnerImage specify image for python task runtime ## @param lifecycleOperator.manager.image.repository specify registry for manager image -## @param lifecycleOperator.manager.image.tag select tag for manager image +## @param lifecycleOperator.manager.image.tag select tag for manager image ## @param lifecycleOperator.manager.imagePullPolicy specify pull policy for manager image ## @extra lifecycleOperator.manager.livenessProbe custom livenessprobe for manager container diff --git a/helm/chart/values.yaml b/helm/chart/values.yaml index 57efdc75244..b5e388356b9 100644 --- a/helm/chart/values.yaml +++ b/helm/chart/values.yaml @@ -67,7 +67,7 @@ lifecycleOperator: seccompProfile: type: RuntimeDefault env: - functionRunnerImage: ghcr.io/keptn/functions-runtime:v0.8.1 + functionRunnerImage: ghcr.io/keptn/deno-runtime:v0.8.1 keptnAppControllerLogLevel: "0" keptnAppCreationRequestControllerLogLevel: "0" keptnAppVersionControllerLogLevel: "0" diff --git a/klt-cert-manager/Makefile b/klt-cert-manager/Makefile index 8dab68ee18e..61414a78291 100644 --- a/klt-cert-manager/Makefile +++ b/klt-cert-manager/Makefile @@ -34,7 +34,6 @@ SHELL = /usr/bin/env bash -o pipefail .PHONY: all all: build - #### developer build #### .PHONY: clean clean: diff --git a/lifecycle-operator/Makefile b/lifecycle-operator/Makefile index 914d92a746f..fa7b4a219c8 100644 --- a/lifecycle-operator/Makefile +++ b/lifecycle-operator/Makefile @@ -191,7 +191,6 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. $(ENVTEST): $(LOCALBIN) test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest - #### developer build #### .PHONY: clean clean: diff --git a/lifecycle-operator/config/manager/manager.yaml b/lifecycle-operator/config/manager/manager.yaml index 2fd16dec30f..3468446b73e 100644 --- a/lifecycle-operator/config/manager/manager.yaml +++ b/lifecycle-operator/config/manager/manager.yaml @@ -60,9 +60,9 @@ spec: fieldRef: fieldPath: metadata.name - name: FUNCTION_RUNNER_IMAGE - value: ghcr.io/keptn/functions-runtime:v0.8.1 # x-release-please-version + value: ghcr.io/keptn/deno-runtime:v0.8.1 - name: PYTHON_RUNNER_IMAGE - value: ghcr.io/keptn/python-runtime:v0.8.1 # x-release-please-version + value: ghcr.io/keptn/python-runtime:v0.8.1 - name: OTEL_COLLECTOR_URL value: otel-collector:4317 - name: KEPTN_APP_CONTROLLER_LOG_LEVEL diff --git a/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream.yaml b/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream.yaml index 04b39c960a9..056c70f9cae 100644 --- a/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream.yaml +++ b/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream.yaml @@ -5,4 +5,4 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/slack.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/slack.ts diff --git a/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream_scheduler.yaml b/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream_scheduler.yaml index af2cc884332..adf2b170684 100644 --- a/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream_scheduler.yaml +++ b/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream_scheduler.yaml @@ -5,4 +5,4 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/schedule.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/schedule.ts diff --git a/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream_slack.yaml b/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream_slack.yaml index 04b39c960a9..056c70f9cae 100644 --- a/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream_slack.yaml +++ b/lifecycle-operator/config/samples/function_execution/taskdefinition_function_upstream_slack.yaml @@ -5,4 +5,4 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/slack.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/slack.ts diff --git a/lifecycle-operator/config/samples/python_execution/taskdefinition_pyfunction_upstream_hellopy.yaml b/lifecycle-operator/config/samples/python_execution/taskdefinition_pyfunction_upstream_hellopy.yaml index 29f89a376f6..298b40d94ba 100644 --- a/lifecycle-operator/config/samples/python_execution/taskdefinition_pyfunction_upstream_hellopy.yaml +++ b/lifecycle-operator/config/samples/python_execution/taskdefinition_pyfunction_upstream_hellopy.yaml @@ -5,4 +5,4 @@ metadata: spec: python: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/python-runtime/samples/hellopy.py + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/python-runtime/samples/hellopy.py diff --git a/metrics-operator/Makefile b/metrics-operator/Makefile index 78c1025d1ab..aca503a0627 100644 --- a/metrics-operator/Makefile +++ b/metrics-operator/Makefile @@ -152,7 +152,6 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. $(ENVTEST): $(LOCALBIN) test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest - #### developer build #### .PHONY: clean clean: diff --git a/release-please-config.json b/release-please-config.json index 543fce77c13..9b9d57efb1c 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -12,15 +12,19 @@ "prerelease": false, "monorepo-tags": "klt", "draft": false, - "exclude-paths": ["klt-cert-manager", "metrics-operator"], + "exclude-paths": [ + "klt-cert-manager", + "lifecycle-operator", + "metrics-operator", + "scheduler", + "runtimes/deno-runtime", + "runtimes/python-runtime" + ], "extra-files": [ "README.md", "operator/config/manager/manager.yaml", "helm/chart/Chart.yaml", "Makefile", - "operator/Makefile", - "scheduler/Makefile", - "docs/content/en/docs/snippets/tasks/install.md", "helm/chart/values.yaml", "helm/chart/README.md" ] @@ -36,6 +40,30 @@ "Makefile" ] }, + "lifecycle-operator": { + "package-name": "lifecycle-operator", + "component": "lifecycle-operator", + "changelog-path": "CHANGELOG.md", + "release-type": "go", + "monorepo-tags": "lifecycle-operator", + "prerelease": false, + "draft": false, + "extra-files": [ + "Makefile" + ] + }, + "scheduler": { + "package-name": "scheduler", + "component": "scheduler", + "changelog-path": "CHANGELOG.md", + "release-type": "go", + "monorepo-tags": "scheduler", + "prerelease": false, + "draft": false, + "extra-files": [ + "Makefile" + ] + }, "metrics-operator": { "package-name": "metrics-operator", "changelog-path": "CHANGELOG.md", @@ -46,8 +74,35 @@ "extra-files": [ "Makefile" ] + }, + "runtimes/python-runtime": { + "package-name": "python-runtime", + "changelog-path": "CHANGELOG.md", + "release-type": "go", + "monorepo-tags": "python-runtime", + "prerelease": false, + "draft": false + }, + "runtimes/deno-runtime": { + "package-name": "deno-runtime", + "changelog-path": "CHANGELOG.md", + "release-type": "go", + "monorepo-tags": "deno-runtime", + "prerelease": false, + "draft": false } }, + "plugins": [ + { + "type": "linked-versions", + "groupName": "lifecycle-operator-and-scheduler", + "components": [ + "lifecycle-operator", + "scheduler" + ], + "merge": true + } + ], "changelog-sections": [ { "type": "feat", diff --git a/renovate.json b/renovate.json index 31260204536..3dd72b42464 100644 --- a/renovate.json +++ b/renovate.json @@ -23,10 +23,6 @@ "**/tests/**" ], "ignoreDeps": [ - "ghcr.io/keptn/lifecycle-operator", - "ghcr.io/keptn/scheduler", - "ghcr.io/keptn/functions-runtime", - "ghcr.io/keptn/python-runtime", "ghcr.io/keptn/metrics-operator" ], "packageRules": [ diff --git a/functions-runtime/Dockerfile b/runtimes/deno-runtime/Dockerfile similarity index 100% rename from functions-runtime/Dockerfile rename to runtimes/deno-runtime/Dockerfile diff --git a/functions-runtime/README.md b/runtimes/deno-runtime/README.md similarity index 83% rename from functions-runtime/README.md rename to runtimes/deno-runtime/README.md index 3d2076d1ef5..2216282303a 100644 --- a/functions-runtime/README.md +++ b/runtimes/deno-runtime/README.md @@ -1,4 +1,4 @@ -# Keptn Lifecycle Controller - Function Runtime +# Keptn Lifecycle Controller - Deno Runtime ## Build @@ -8,7 +8,7 @@ docker build -t keptnsandbox/klc-runtime:${VERSION} . ## Usage -The Keptn function runtime uses [Deno](https://deno.land/) +The Keptn deno runtime uses [Deno](https://deno.land/) to execute Javascript/Typescript code. The Keptn Lifecycle Toolkit uses this runtime to run [KeptnTask](https://lifecycle.keptn.sh/docs/tasks/write-tasks/) for pre- and post-checks. @@ -29,14 +29,14 @@ console.log(secret); Replace `${VERSION}` with the KLT version of your choice. ```sh -docker run -v $(pwd)/test.ts:/test.ts -e SCRIPT=/test.ts -e DATA='{ "url":"http://localhost:9090" }' -e SECURE_DATA='{ "token": "myToken"}' -it ghcr.io/keptn/functions-runtime:${VERSION} +docker run -v $(pwd)/test.ts:/test.ts -e SCRIPT=/test.ts -e DATA='{ "url":"http://localhost:9090" }' -e SECURE_DATA='{ "token": "myToken"}' -it ghcr.io/keptn/deno-runtime:${VERSION} ``` ### Docker with function on webserver (function in this repo) ```shell docker run \ - -e SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/hello-world.ts \ + -e SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/hello-world.ts \ -it \ keptnsandbox/klc-runtime:${VERSION} ``` @@ -45,7 +45,7 @@ docker run \ ```shell docker run \ - -e SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/scheduler.ts \ + -e SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/scheduler.ts \ -e DATA='{ "targetDate":"2025-04-16T06:55:31.820Z" }' \ -it \ keptnsandbox/klc-runtime:${VERSION} @@ -55,7 +55,7 @@ docker run \ ```shell docker run \ - -e SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/slack.ts \ + -e SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/slack.ts \ -e SECURE_DATA='{ "slack_hook":"hook/parts","text":"this is my test message" }' \ -it \ keptnsandbox/klc-runtime:${VERSION} @@ -65,10 +65,10 @@ docker run \ ```shell docker run \ - -e SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/prometheus.ts \ + -e SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/prometheus.ts \ -e DATA='{ "url":"http://localhost:9090", "metrics": "up{service=\"kubernetes\"}", "expected_value": "1" }' \ -it \ - ghcr.io/keptn/functions-runtime:${VERSION} + ghcr.io/keptn/deno-runtime:${VERSION} ``` diff --git a/functions-runtime/entrypoint.sh b/runtimes/deno-runtime/entrypoint.sh similarity index 100% rename from functions-runtime/entrypoint.sh rename to runtimes/deno-runtime/entrypoint.sh diff --git a/functions-runtime/samples/ts/dns.ts b/runtimes/deno-runtime/samples/ts/dns.ts similarity index 100% rename from functions-runtime/samples/ts/dns.ts rename to runtimes/deno-runtime/samples/ts/dns.ts diff --git a/functions-runtime/samples/ts/hello-world.ts b/runtimes/deno-runtime/samples/ts/hello-world.ts similarity index 100% rename from functions-runtime/samples/ts/hello-world.ts rename to runtimes/deno-runtime/samples/ts/hello-world.ts diff --git a/functions-runtime/samples/ts/http.ts b/runtimes/deno-runtime/samples/ts/http.ts similarity index 100% rename from functions-runtime/samples/ts/http.ts rename to runtimes/deno-runtime/samples/ts/http.ts diff --git a/functions-runtime/samples/ts/prometheus.ts b/runtimes/deno-runtime/samples/ts/prometheus.ts similarity index 100% rename from functions-runtime/samples/ts/prometheus.ts rename to runtimes/deno-runtime/samples/ts/prometheus.ts diff --git a/functions-runtime/samples/ts/schedule.ts b/runtimes/deno-runtime/samples/ts/schedule.ts similarity index 100% rename from functions-runtime/samples/ts/schedule.ts rename to runtimes/deno-runtime/samples/ts/schedule.ts diff --git a/functions-runtime/samples/ts/slack.ts b/runtimes/deno-runtime/samples/ts/slack.ts similarity index 100% rename from functions-runtime/samples/ts/slack.ts rename to runtimes/deno-runtime/samples/ts/slack.ts diff --git a/python-runtime/Dockerfile b/runtimes/python-runtime/Dockerfile similarity index 100% rename from python-runtime/Dockerfile rename to runtimes/python-runtime/Dockerfile diff --git a/python-runtime/README.md b/runtimes/python-runtime/README.md similarity index 81% rename from python-runtime/README.md rename to runtimes/python-runtime/README.md index bf7cab3cbd9..7e9548e5ea0 100644 --- a/python-runtime/README.md +++ b/runtimes/python-runtime/README.md @@ -3,7 +3,7 @@ ## Build ```shell -docker build -t lifecycle-toolkit/python-runtime:${VERSION} . +docker build -t lifecycle-toolkit/runtimes/python-runtime:${VERSION} . ``` ## Usage @@ -23,7 +23,7 @@ Replace `${VERSION}` with the KLT version of your choice. ### mounting a python file ```shell -docker run -v $(pwd)/samples/hellopy.py:/hellopy.py -e "SCRIPT=hellopy.py" -it lifecycle-toolkit/python-runtime:${VERSION} +docker run -v $(pwd)/samples/hellopy.py:/hellopy.py -e "SCRIPT=hellopy.py" -it lifecycle-toolkit/runtimes/python-runtime:${VERSION} ``` Where the file in sample/hellopy.py contains python3 code: @@ -48,7 +48,7 @@ You can pass python command line arguments by specifying `CMD_ARGS`. The following example will print the help of python3: ```shell -docker run -e "CMD_ARGS= -help" -it lifecycle-toolkit/python-runtime:${VERSION} +docker run -e "CMD_ARGS= -help" -it lifecycle-toolkit/runtimes/python-runtime:${VERSION} ``` ### Pass arguments to your python script @@ -56,7 +56,7 @@ docker run -e "CMD_ARGS= -help" -it lifecycle-toolkit/python-runtime:${VERSION} In this example we pass one argument (-i test.txt) to the script ```shell -docker run -v $(pwd)/samples/args.py:/args.py -e "SCRIPT=args.py -i test.txt" -it lifecycle-toolkit/python-runtime:${VERSION} +docker run -v $(pwd)/samples/args.py:/args.py -e "SCRIPT=args.py -i test.txt" -it lifecycle-toolkit/runtimes/python-runtime:${VERSION} ``` ### Use a script from url @@ -64,7 +64,7 @@ docker run -v $(pwd)/samples/args.py:/args.py -e "SCRIPT=args.py -i test.txt" - We can call the hellopy.py script downloading it directly from github ```shell -docker run -e "SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/python-runtime/samples/hellopy.py" -it lifecycle-toolkit/python-runtime:${VERSION} +docker run -e "SCRIPT=https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/python-runtime/samples/hellopy.py" -it lifecycle-toolkit/runtimes/python-runtime:${VERSION} ``` diff --git a/python-runtime/entrypoint.sh b/runtimes/python-runtime/entrypoint.sh similarity index 100% rename from python-runtime/entrypoint.sh rename to runtimes/python-runtime/entrypoint.sh diff --git a/python-runtime/samples/args.py b/runtimes/python-runtime/samples/args.py similarity index 100% rename from python-runtime/samples/args.py rename to runtimes/python-runtime/samples/args.py diff --git a/python-runtime/samples/hellopy.py b/runtimes/python-runtime/samples/hellopy.py similarity index 100% rename from python-runtime/samples/hellopy.py rename to runtimes/python-runtime/samples/hellopy.py diff --git a/python-runtime/samples/secrets.py b/runtimes/python-runtime/samples/secrets.py similarity index 100% rename from python-runtime/samples/secrets.py rename to runtimes/python-runtime/samples/secrets.py diff --git a/test/integration/app-failing-pre-task/00-install.yaml b/test/integration/app-failing-pre-task/00-install.yaml index adcf6300632..c6789f72a7e 100644 --- a/test/integration/app-failing-pre-task/00-install.yaml +++ b/test/integration/app-failing-pre-task/00-install.yaml @@ -47,7 +47,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-entry:9000 diff --git a/test/integration/podtato-head-application/00-install.yaml b/test/integration/podtato-head-application/00-install.yaml index b8a6f95c688..4bfec55e075 100644 --- a/test/integration/podtato-head-application/00-install.yaml +++ b/test/integration/podtato-head-application/00-install.yaml @@ -344,7 +344,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-entry:9000 diff --git a/test/integration/restartable-app/00-install.yaml b/test/integration/restartable-app/00-install.yaml index 5c2ea28dedc..fabe8ee5506 100644 --- a/test/integration/restartable-app/00-install.yaml +++ b/test/integration/restartable-app/00-install.yaml @@ -327,7 +327,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-entry:9000 diff --git a/test/integration/workload-instance-failing-pre-task/00-install.yaml b/test/integration/workload-instance-failing-pre-task/00-install.yaml index aa5f060f740..0a0fbcf724f 100644 --- a/test/integration/workload-instance-failing-pre-task/00-install.yaml +++ b/test/integration/workload-instance-failing-pre-task/00-install.yaml @@ -17,7 +17,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/functions-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-entry:9000 From 9a995c447e65a4a96d4d3dca53f40a0c1c383b70 Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:41:58 +0200 Subject: [PATCH 02/78] chore: release python-runtime 1.0.0 (#1969) Signed-off-by: keptn-bot <86361500+keptn-bot@users.noreply.github.com> --- .release-please-manifest.json | 2 +- runtimes/python-runtime/CHANGELOG.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 runtimes/python-runtime/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1fb4b4b1ab4..dea214652b1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.0.0"} +{".":"0.8.1","klt-cert-manager":"1.0.0","runtimes/python-runtime":"1.0.0"} diff --git a/runtimes/python-runtime/CHANGELOG.md b/runtimes/python-runtime/CHANGELOG.md new file mode 100644 index 00000000000..c11e53ef3c5 --- /dev/null +++ b/runtimes/python-runtime/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 1.0.0 (2023-08-29) + + +### Features + +* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) From cd4cb9f57623947d086549e164ec256631442727 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Tue, 29 Aug 2023 10:20:32 +0200 Subject: [PATCH 03/78] ci: fix release matrix (#1973) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f1b4837423..7fa98366b03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,7 +92,7 @@ jobs: return []; } }); - return releaseMatrix; + return { config: releaseMatrix }; build-release: if: needs.release-please.outputs.releases-created == 'true' From 9c9929c6f0cf1d51baedc6ddb40f0b0f25ddc228 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Tue, 29 Aug 2023 11:48:30 +0200 Subject: [PATCH 04/78] feat(metrics-operator): introduce SLO -> AnalysisDefinition converter (#1955) Signed-off-by: odubajDT Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com> Co-authored-by: Florian Bacher Co-authored-by: RealAnna <89971034+RealAnna@users.noreply.github.com> --- .../api/v1alpha3/analysisdefinition_types.go | 38 +- .../converter/sli_converter_test.go | 2 +- metrics-operator/converter/slo_converter.go | 268 ++++++ .../converter/slo_converter_test.go | 904 ++++++++++++++++++ metrics-operator/go.mod | 2 +- metrics-operator/main.go | 36 +- 6 files changed, 1228 insertions(+), 22 deletions(-) create mode 100644 metrics-operator/converter/slo_converter.go create mode 100644 metrics-operator/converter/slo_converter_test.go diff --git a/metrics-operator/api/v1alpha3/analysisdefinition_types.go b/metrics-operator/api/v1alpha3/analysisdefinition_types.go index 044e6a950ae..d6952c80887 100644 --- a/metrics-operator/api/v1alpha3/analysisdefinition_types.go +++ b/metrics-operator/api/v1alpha3/analysisdefinition_types.go @@ -24,9 +24,9 @@ import ( // AnalysisDefinitionSpec defines the desired state of AnalysisDefinition type AnalysisDefinitionSpec struct { // Objectives defines a list of objectives to evaluate for an analysis - Objectives []Objective `json:"objectives,omitempty"` + Objectives []Objective `json:"objectives,omitempty" yaml:"objectives,omitempty"` // TotalScore defines the required score for an analysis to be successful - TotalScore TotalScore `json:"totalScore"` + TotalScore TotalScore `json:"totalScore" yaml:"totalScore"` } // TotalScore defines the required score for an analysis to be successful @@ -34,53 +34,53 @@ type TotalScore struct { // PassPercentage defines the threshold to reach for an analysis to pass // +kubebuilder:validation:Minimum:=0 // +kubebuilder:validation:Maximum:=100 - PassPercentage int `json:"passPercentage"` + PassPercentage int `json:"passPercentage" yaml:"passPercentage"` // WarningPercentage defines the threshold to reach for an analysis to pass with a 'warning' status // +kubebuilder:validation:Minimum:=0 // +kubebuilder:validation:Maximum:=100 - WarningPercentage int `json:"warningPercentage"` + WarningPercentage int `json:"warningPercentage" yaml:"warningPercentage"` } // Objective defines an objective for analysis type Objective struct { // AnalysisValueTemplateRef refers to the appropriate AnalysisValueTemplate - AnalysisValueTemplateRef ObjectReference `json:"analysisValueTemplateRef"` + AnalysisValueTemplateRef ObjectReference `json:"analysisValueTemplateRef" yaml:"analysisValueTemplateRef"` // Target defines failure or warning criteria - Target Target `json:"target,omitempty"` + Target Target `json:"target,omitempty" yaml:"target,omitempty"` // Weight can be used to emphasize the importance of one Objective over the others // +kubebuilder:default:=1 - Weight int `json:"weight,omitempty"` + Weight int `json:"weight,omitempty" yaml:"weight,omitempty"` // KeyObjective defines whether the whole analysis fails when this objective's target is not met // +kubebuilder:default:=false - KeyObjective bool `json:"keyObjective,omitempty"` + KeyObjective bool `json:"keyObjective,omitempty" yaml:"keyObjective,omitempty"` } // Target defines the failure and warning criteria type Target struct { // Failure defines limits up to which an analysis fails - Failure *Operator `json:"failure,omitempty"` + Failure *Operator `json:"failure,omitempty" yaml:"failure,omitempty"` // Warning defines limits where the result does not pass or fail - Warning *Operator `json:"warning,omitempty"` + Warning *Operator `json:"warning,omitempty" yaml:"warning,omitempty"` } // OperatorValue represents the value to which the result is compared type OperatorValue struct { // FixedValue defines the value for comparison - FixedValue resource.Quantity `json:"fixedValue"` + FixedValue resource.Quantity `json:"fixedValue" yaml:"fixedValue"` } // Operator specifies the supported operators for value comparisons type Operator struct { // LessThanOrEqual represents '<=' operator - LessThanOrEqual *OperatorValue `json:"lessThanOrEqual,omitempty"` + LessThanOrEqual *OperatorValue `json:"lessThanOrEqual,omitempty" yaml:"lessThanOrEqual,omitempty"` // LessThan represents '<' operator - LessThan *OperatorValue `json:"lessThan,omitempty"` + LessThan *OperatorValue `json:"lessThan,omitempty" yaml:"lessThan,omitempty"` // GreaterThan represents '>' operator - GreaterThan *OperatorValue `json:"greaterThan,omitempty"` + GreaterThan *OperatorValue `json:"greaterThan,omitempty" yaml:"greaterThan,omitempty"` // GreaterThanOrEqual represents '>=' operator - GreaterThanOrEqual *OperatorValue `json:"greaterThanOrEqual,omitempty"` + GreaterThanOrEqual *OperatorValue `json:"greaterThanOrEqual,omitempty" yaml:"greaterThanOrEqual,omitempty"` // EqualTo represents '==' operator - EqualTo *OperatorValue `json:"equalTo,omitempty"` + EqualTo *OperatorValue `json:"equalTo,omitempty" yaml:"equalTo,omitempty"` } //+kubebuilder:object:root=true @@ -88,10 +88,10 @@ type Operator struct { // AnalysisDefinition is the Schema for the analysisdefinitions APIs type AnalysisDefinition struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"` - Spec AnalysisDefinitionSpec `json:"spec,omitempty"` + Spec AnalysisDefinitionSpec `json:"spec,omitempty" yaml:"spec,omitempty"` // unused field Status string `json:"status,omitempty"` } diff --git a/metrics-operator/converter/sli_converter_test.go b/metrics-operator/converter/sli_converter_test.go index 2cf6e65a8d8..011e0481a21 100644 --- a/metrics-operator/converter/sli_converter_test.go +++ b/metrics-operator/converter/sli_converter_test.go @@ -117,7 +117,7 @@ func TestConvertSLI(t *testing.T) { require.Contains(t, res, expectedOutput2) } -func TestConvertQuary(t *testing.T) { +func TestConvertQuery(t *testing.T) { tests := []struct { name string in string diff --git a/metrics-operator/converter/slo_converter.go b/metrics-operator/converter/slo_converter.go new file mode 100644 index 00000000000..b4c66cecccc --- /dev/null +++ b/metrics-operator/converter/slo_converter.go @@ -0,0 +1,268 @@ +package converter + +import ( + "fmt" + "math" + "strconv" + "strings" + + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "gopkg.in/inf.v0" + "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/yaml" +) + +type SLOConverter struct { +} + +func NewSLOConverter() *SLOConverter { + return &SLOConverter{} +} + +type SLO struct { + Objectives []*Objective `yaml:"objectives" json:"objectives"` + TotalScore Score `yaml:"total_score" json:"total_score"` +} + +type Score struct { + Pass string `yaml:"pass" json:"pass"` + Warning string `yaml:"warning" json:"warning"` +} + +type Objective struct { + Name string `yaml:"sli" json:"sli"` + KeySLI bool `yaml:"key_sli,omitempty" json:"key_sli,omitempty"` + Weight int `yaml:"weight,omitempty" json:"weight,omitempty"` + Warning []Criteria `yaml:"warning,omitempty" json:"warning,omitempty"` + Pass []Criteria `yaml:"pass,omitempty" json:"pass,omitempty"` +} + +type Criteria struct { + Operators []string `yaml:"criteria,omitempty" json:"criteria,omitempty"` +} + +func (o *Objective) hasSupportedCriteria() bool { + return len(o.Pass) > 1 || len(o.Warning) > 1 +} + +func (c *SLOConverter) Convert(fileContent []byte, analysisDef string, namespace string) (string, error) { + //check that provider and namespace is set + if analysisDef == "" || namespace == "" { + return "", fmt.Errorf("missing arguments: 'definition' and 'namespace' needs to be set for conversion") + } + + // unmarshall content + content := &SLO{} + err := yaml.Unmarshal(fileContent, content) + if err != nil { + return "", fmt.Errorf("error unmarshalling file content: %s", err.Error()) + } + + // convert + analysisDefinition, err := c.convertSLO(content, analysisDef, namespace) + if err != nil { + return "", err + } + + // marshal AnalysisDefinition to Yaml + yamlData, err := yaml.Marshal(analysisDefinition) + if err != nil { + return "", fmt.Errorf("error marshalling data: %s", err.Error()) + } + + return string(yamlData), nil +} + +func (c *SLOConverter) convertSLO(sloContent *SLO, name string, namespace string) (*metricsapi.AnalysisDefinition, error) { + // define resulting AnalysisDefinition with easy conversions + passPercentage, err := removePercentage(sloContent.TotalScore.Pass) + if err != nil { + return nil, err + } + warnPercentage, err := removePercentage(sloContent.TotalScore.Warning) + if err != nil { + return nil, err + } + definition := &metricsapi.AnalysisDefinition{ + TypeMeta: v1.TypeMeta{ + Kind: "AnalysisDefinition", + APIVersion: "metrics.keptn.sh/v1alpha3", + }, + ObjectMeta: v1.ObjectMeta{ + Name: name, + }, + Spec: metricsapi.AnalysisDefinitionSpec{ + TotalScore: metricsapi.TotalScore{ + PassPercentage: passPercentage, + WarningPercentage: warnPercentage, + }, + // create a slice of size of len(sloContent.Objectives), but reserve capacity for + // double the size, as some objectives may be twice there (conversion of criteria with logical AND) + Objectives: make([]metricsapi.Objective, len(sloContent.Objectives), len(sloContent.Objectives)*2), + }, + } + + // convert objectives one after another + indexObjectives := 0 + for _, o := range sloContent.Objectives { + target, err := setupTarget(o) + if err != nil { + return nil, err + } + objective := metricsapi.Objective{ + AnalysisValueTemplateRef: metricsapi.ObjectReference{ + Name: o.Name, + Namespace: namespace, + }, + KeyObjective: o.KeySLI, + Weight: o.Weight, + Target: *target, + } + definition.Spec.Objectives[indexObjectives] = objective + indexObjectives++ + } + return definition, nil +} + +// removes % symbol from the scoring values and converts to numeric value +func removePercentage(str string) (int, error) { + t := strings.ReplaceAll(str, "%", "") + f, err := strconv.ParseFloat(t, 64) + if err != nil { + return 0, err + } + return int(math.Round(f)), nil +} + +// creates and sets up the target struct from objective +// TODO refactor this function in a follow-up + weight distribution +// nolint:gocognit,gocyclo +func setupTarget(o *Objective) (*metricsapi.Target, error) { + target := &metricsapi.Target{} + // remove criteria, which contain % in their operators + o = cleanupObjective(o) + // skip objective target conversion if it has criteria combined with logical OR -> not supported + // this way the SLO will become "informative" + if o.hasSupportedCriteria() { + return target, nil + } + + // if warning criteria are not defined, negate the pass criteria to create fail criteria + if len(o.Warning) == 0 { + if len(o.Pass) > 0 { + if len(o.Pass[0].Operators) > 0 { + // TODO cover use cases with multiple operators (create new objectives) + op, err := newOperator(o.Pass[0].Operators[0]) + if err != nil { + return target, err + } + target.Failure = op + return target, nil + } + } + } + + // if warning criteria are defined, create new criteria with the following logic: + // !(warn criteria) -> fail criteria + // !(pass criteria) -> warn criteria + var err error + if len(o.Pass) > 0 { + if len(o.Pass[0].Operators) > 0 { + // TODO cover use cases with multiple operators (create new objectives) + op, err := newOperator(o.Pass[0].Operators[0]) + if err != nil { + return target, err + } + target.Warning = op + } + if len(o.Warning[0].Operators) > 0 { + // TODO cover use cases with multiple operators (create new objectives) + op, err := newOperator(o.Warning[0].Operators[0]) + if err != nil { + return target, err + } + target.Failure = op + } + } + + return target, err +} + +func cleanupObjective(o *Objective) *Objective { + o.Pass = cleanupCriteria(o.Pass) + o.Warning = cleanupCriteria(o.Warning) + return o +} + +// remove % operators from criterium structure +// if criteria did have only % operators, remove it from strucutre +func cleanupCriteria(criteria []Criteria) []Criteria { + newCriteria := make([]Criteria, 0, len(criteria)) + for _, c := range criteria { + operators := make([]string, 0, len(c.Operators)) + for _, op := range c.Operators { + // keep only criteria with real values, not percentage + if !strings.Contains(op, "%") { + operators = append(operators, op) + } + } + // if criterium does have operator, store it + if len(operators) > 0 { + newCriteria = append(newCriteria, Criteria{Operators: operators}) + } + } + + return newCriteria +} + +// create operator for Target +func newOperator(op string) (*metricsapi.Operator, error) { + // remove whitespaces + op = strings.Replace(op, " ", "", -1) + + operators := []string{"<=", "<", ">=", ">"} + for _, operator := range operators { + if strings.HasPrefix(op, operator) { + return createOperator(operator, strings.TrimPrefix(op, operator)) + } + } + + return &metricsapi.Operator{}, fmt.Errorf("invalid operator: '%s'", op) +} + +// checks and negates the existing operator +func createOperator(op string, value string) (*metricsapi.Operator, error) { + dec := inf.NewDec(1, 0) + _, ok := dec.SetString(value) + if !ok { + return nil, fmt.Errorf("unable to convert value '%s' to decimal", value) + } + if op == "<=" { + return &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, nil + } else if op == "<" { + return &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, nil + } else if op == ">=" { + return &metricsapi.Operator{ + LessThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, nil + } else if op == ">" { + return &metricsapi.Operator{ + LessThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, nil + } + + return &metricsapi.Operator{}, fmt.Errorf("invalid operator: '%s'", op) +} diff --git a/metrics-operator/converter/slo_converter_test.go b/metrics-operator/converter/slo_converter_test.go new file mode 100644 index 00000000000..4ea47846df7 --- /dev/null +++ b/metrics-operator/converter/slo_converter_test.go @@ -0,0 +1,904 @@ +package converter + +import ( + "testing" + + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "github.com/stretchr/testify/require" + "gopkg.in/inf.v0" + "k8s.io/apimachinery/pkg/api/resource" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const SLOContent = `--- +spec_version: "0.1.1" +comparison: + aggregate_function: "avg" + compare_with: "single_result" + include_result_with_score: "pass" + number_of_comparison_results: 1 +filter: +objectives: + - sli: "response_time_p95" + key_sli: false + pass: + - criteria: + - "<=+75%" + - "<800" + warning: + - criteria: + - "<=1000" + - "<=+100%" + weight: 1 + - sli: "cpu" + pass: + - criteria: + - "<=+100%" + - ">=80" + - criteria: + - "<=+100%" + - ">=80" + - sli: "throughput" + pass: + - criteria: + - "<=+100%" + - ">=-80%" + - sli: "error_rate" +total_score: + pass: "100%" + warning: "65%"` + +const expectedOutput = `apiVersion: metrics.keptn.sh/v1alpha3 +kind: AnalysisDefinition +metadata: + creationTimestamp: null + name: defname +spec: + objectives: + - analysisValueTemplateRef: + name: response_time_p95 + namespace: default + target: + failure: + greaterThan: + fixedValue: 1k + warning: + greaterThanOrEqual: + fixedValue: "800" + weight: 1 + - analysisValueTemplateRef: + name: cpu + namespace: default + target: {} + - analysisValueTemplateRef: + name: throughput + namespace: default + target: {} + - analysisValueTemplateRef: + name: error_rate + namespace: default + target: {} + totalScore: + passPercentage: 100 + warningPercentage: 65 +` + +func TestConvert(t *testing.T) { + c := NewSLOConverter() + // no provider nor namespace + res, err := c.Convert([]byte(SLOContent), "", "") + require.NotNil(t, err) + require.Equal(t, "", res) + + // invalid file content + res, err = c.Convert([]byte("invalid"), "dynatrace", "keptn") + require.NotNil(t, err) + require.Equal(t, "", res) + + // happy path + res, err = c.Convert([]byte(SLOContent), "defname", "default") + require.Nil(t, err) + require.Equal(t, expectedOutput, res) +} + +func TestCreateOperator(t *testing.T) { + dec := inf.NewDec(1, 0) + _, ok := dec.SetString("1") + require.True(t, ok) + + tests := []struct { + name string + op string + value string + out *metricsapi.Operator + wantErr bool + }{ + { + name: "invalid int value", + op: "", + value: "val", + out: nil, + wantErr: true, + }, + { + name: "unsupported operator", + op: "", + value: "1", + out: nil, + wantErr: true, + }, + { + name: "lessEqual operator", + op: "<=", + value: "1", + out: &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "less operator", + op: "<", + value: "1", + out: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "greaterEqual operator", + op: ">=", + value: "1", + out: &metricsapi.Operator{ + LessThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "greater operator", + op: ">", + value: "1", + out: &metricsapi.Operator{ + LessThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + res, err := createOperator(tt.op, tt.value) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.out, res) + } + }) + + } +} + +func TestSetupOperator(t *testing.T) { + dec := inf.NewDec(1, 0) + _, ok := dec.SetString("1") + require.True(t, ok) + + tests := []struct { + name string + op string + out *metricsapi.Operator + wantErr bool + }{ + { + name: "unsupported operator", + op: "", + out: nil, + wantErr: true, + }, + { + name: "lessEqual operator", + op: "<=1", + out: &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "less operator", + op: "<1", + out: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "greaterEqual operator", + op: ">=1", + out: &metricsapi.Operator{ + LessThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "greater operator", + op: ">1", + out: &metricsapi.Operator{ + LessThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + res, err := newOperator(tt.op) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.out, res) + } + }) + + } +} + +func TestShouldIgnoreObjective(t *testing.T) { + tests := []struct { + name string + o *Objective + want bool + }{ + { + name: "empty criteria", + o: &Objective{ + Pass: []Criteria{}, + Warning: []Criteria{}, + }, + want: false, + }, + { + name: "valid criteria", + o: &Objective{ + Pass: []Criteria{ + { + Operators: []string{}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{}, + }, + }, + }, + want: false, + }, + { + name: "OR criteria", + o: &Objective{ + Pass: []Criteria{ + { + Operators: []string{}, + }, + { + Operators: []string{}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{}, + }, + }, + }, + want: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.want, tt.o.hasSupportedCriteria()) + }) + + } +} + +func TestRemovePercentage(t *testing.T) { + tests := []struct { + name string + val string + want int + wantErr bool + }{ + { + name: "no percentage", + val: "1", + want: 1, + wantErr: false, + }, + { + name: "percentage", + val: "1%", + want: 1, + wantErr: false, + }, + { + name: "percentage with float - round down", + val: "1.333333%", + want: 1, + wantErr: false, + }, + { + name: "percentage with float - round up", + val: "1.833333%", + want: 2, + wantErr: false, + }, + { + name: "only percentage", + val: "%", + want: 0, + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + res, err := removePercentage(tt.val) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.want, res) + } + }) + } +} + +func TestCleanupCriteria(t *testing.T) { + tests := []struct { + name string + in []Criteria + out []Criteria + }{ + { + name: "empty criteria", + in: []Criteria{}, + out: []Criteria{}, + }, + { + name: "no criteria to clean up", + in: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + out: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + }, + { + name: "criteria to clean up", + in: []Criteria{ + { + Operators: []string{"<100", "<10%"}, + }, + }, + out: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + }, + { + name: "multiple criteria to clean up", + in: []Criteria{ + { + Operators: []string{"<100", "<10%"}, + }, + { + Operators: []string{"<10%"}, + }, + }, + out: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + }, + { + name: "all criteria to clean up", + in: []Criteria{ + { + Operators: []string{"<10%"}, + }, + { + Operators: []string{"<10%"}, + }, + }, + out: []Criteria{}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.out, cleanupCriteria(tt.in)) + }) + } +} + +func TestCleanupObjective(t *testing.T) { + tests := []struct { + name string + in *Objective + out *Objective + }{ + { + name: "pass criteria to clean up", + in: &Objective{ + Pass: []Criteria{ + { + Operators: []string{"<100", "<10%"}, + }, + { + Operators: []string{"<10%"}, + }, + }, + }, + out: &Objective{ + Pass: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + Warning: []Criteria{}, + }, + }, + { + name: "warning criteria to clean up", + in: &Objective{ + Warning: []Criteria{ + { + Operators: []string{"<100", "<10%"}, + }, + { + Operators: []string{"<10%"}, + }, + }, + }, + out: &Objective{ + Warning: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + Pass: []Criteria{}, + }, + }, + { + name: "no criteria to clean up", + in: &Objective{ + Warning: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + }, + out: &Objective{ + Warning: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + Pass: []Criteria{}, + }, + }, + { + name: "no criteria", + in: &Objective{}, + out: &Objective{ + Warning: []Criteria{}, + Pass: []Criteria{}, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.out, cleanupObjective(tt.in)) + }) + } +} + +func TestSetupTarget(t *testing.T) { + dec10 := inf.NewDec(1, 0) + _, ok := dec10.SetString("10") + require.True(t, ok) + + dec15 := inf.NewDec(1, 0) + _, ok = dec15.SetString("15") + require.True(t, ok) + + tests := []struct { + name string + o *Objective + want *metricsapi.Target + wantErr bool + }{ + { + name: "informative slo", + o: &Objective{ + Name: "informative", + }, + want: &metricsapi.Target{}, + wantErr: false, + }, + { + name: "logical OR criteria -> informative slo", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + { + Operators: []string{">1"}, + }, + }, + }, + want: &metricsapi.Target{}, + wantErr: false, + }, + { + name: "criteria with % -> informative slo", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"<10%"}, + }, + }, + }, + want: &metricsapi.Target{}, + wantErr: false, + }, + { + name: "no warn criteria - conversion", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + }, + }, + want: &metricsapi.Target{ + Failure: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + }, + }, + }, + wantErr: false, + }, + { + name: "no warn criteria - error", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"10"}, + }, + }, + }, + want: &metricsapi.Target{}, + wantErr: true, + }, + { + name: "with warn criteria - conversion", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{"<=15"}, + }, + }, + }, + want: &metricsapi.Target{ + Failure: &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), + }, + }, + Warning: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + }, + }, + }, + wantErr: false, + }, + { + name: "with warn criteria - error pass", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"10"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{"<=15"}, + }, + }, + }, + want: &metricsapi.Target{}, + wantErr: true, + }, + { + name: "with warn criteria - error warn", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{"15"}, + }, + }, + }, + want: &metricsapi.Target{}, + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + res, err := setupTarget(tt.o) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.want, res) + } + }) + } +} + +func TestConvertSLO(t *testing.T) { + dec10 := inf.NewDec(1, 0) + _, ok := dec10.SetString("10") + require.True(t, ok) + + dec15 := inf.NewDec(1, 0) + _, ok = dec15.SetString("15") + require.True(t, ok) + + c := NewSLOConverter() + + tests := []struct { + name string + slo *SLO + defName string + namespace string + out *metricsapi.AnalysisDefinition + wantErr bool + }{ + { + name: "removePercentage pass - error", + slo: &SLO{ + TotalScore: Score{ + Pass: "hhh", + }, + }, + defName: "defName", + namespace: "default", + out: &metricsapi.AnalysisDefinition{}, + wantErr: true, + }, + { + name: "removePercentage warn - error", + slo: &SLO{ + TotalScore: Score{ + Pass: "10", + Warning: "hhh", + }, + }, + defName: "defName", + namespace: "default", + out: &metricsapi.AnalysisDefinition{}, + wantErr: true, + }, + { + name: "no objectives", + slo: &SLO{ + TotalScore: Score{ + Pass: "50", + Warning: "20", + }, + }, + defName: "defName", + namespace: "default", + out: &metricsapi.AnalysisDefinition{ + TypeMeta: v1.TypeMeta{ + Kind: "AnalysisDefinition", + APIVersion: "metrics.keptn.sh/v1alpha3", + }, + ObjectMeta: v1.ObjectMeta{ + Name: "defName", + }, + Spec: metricsapi.AnalysisDefinitionSpec{ + TotalScore: metricsapi.TotalScore{ + PassPercentage: 50, + WarningPercentage: 20, + }, + Objectives: []metricsapi.Objective{}, + }, + }, + wantErr: false, + }, + { + name: "objectives conversion", + slo: &SLO{ + TotalScore: Score{ + Pass: "50", + Warning: "20", + }, + Objectives: []*Objective{ + { + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{"<=15"}, + }, + }, + KeySLI: true, + Weight: 10, + }, + { + Name: "criteria2", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + }, + Weight: 5, + }, + }, + }, + defName: "defName", + namespace: "default", + out: &metricsapi.AnalysisDefinition{ + TypeMeta: v1.TypeMeta{ + Kind: "AnalysisDefinition", + APIVersion: "metrics.keptn.sh/v1alpha3", + }, + ObjectMeta: v1.ObjectMeta{ + Name: "defName", + }, + Spec: metricsapi.AnalysisDefinitionSpec{ + TotalScore: metricsapi.TotalScore{ + PassPercentage: 50, + WarningPercentage: 20, + }, + Objectives: []metricsapi.Objective{ + { + Target: metricsapi.Target{ + Failure: &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), + }, + }, + Warning: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + }, + }, + }, + Weight: 10, + KeyObjective: true, + AnalysisValueTemplateRef: metricsapi.ObjectReference{ + Name: "criteria", + Namespace: "default", + }, + }, + { + Target: metricsapi.Target{ + Failure: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + }, + }, + }, + Weight: 5, + AnalysisValueTemplateRef: metricsapi.ObjectReference{ + Name: "criteria2", + Namespace: "default", + }, + }, + }, + }, + }, + wantErr: false, + }, + { + name: "objectives conversion - setupTarget error", + slo: &SLO{ + TotalScore: Score{ + Pass: "50", + Warning: "20", + }, + Objectives: []*Objective{ + { + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{"15"}, + }, + }, + KeySLI: true, + Weight: 10, + }, + { + Name: "criteria2", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + }, + Weight: 5, + }, + }, + }, + defName: "defName", + namespace: "default", + out: &metricsapi.AnalysisDefinition{}, + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + res, err := c.convertSLO(tt.slo, tt.defName, tt.namespace) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.out, res) + } + }) + } + +} diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index 90298069161..bb221e571c9 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -14,6 +14,7 @@ require ( github.com/prometheus/client_golang v1.16.0 github.com/prometheus/common v0.44.0 github.com/stretchr/testify v1.8.4 + gopkg.in/inf.v0 v0.9.1 k8s.io/api v0.26.7 k8s.io/apiextensions-apiserver v0.26.7 k8s.io/apimachinery v0.26.7 @@ -108,7 +109,6 @@ require ( google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd // indirect google.golang.org/grpc v1.52.3 // indirect google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/metrics-operator/main.go b/metrics-operator/main.go index 030a1147fbb..7bfa322bab5 100644 --- a/metrics-operator/main.go +++ b/metrics-operator/main.go @@ -81,12 +81,17 @@ func main() { var SLIFilePath string var provider string var namespace string + var SLOFilePath string + var analysisDefinition string var enableLeaderElection bool var disableWebhook bool var probeAddr string - flag.StringVar(&SLIFilePath, "convert-sli", "", "The path the the SLI fiel to be converted") + flag.StringVar(&SLIFilePath, "convert-sli", "", "The path the the SLI file to be converted") flag.StringVar(&provider, "sli-provider", "", "The name of KeptnMetricsProvider referenced in KeptnValueTemplates") flag.StringVar(&namespace, "sli-namespace", "", "The namespace of the referenced KeptnMetricsProvider") + flag.StringVar(&SLOFilePath, "convert-slo", "", "The path the the SLO file to be converted") + flag.StringVar(&analysisDefinition, "definition", "", "The name of AnalysisDefinition to be created") + flag.StringVar(&namespace, "slo-namespace", "", "The namespace of the referenced AnalysisValueTemplate") flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") flag.BoolVar(&disableWebhook, "disable-webhook", false, "Disable the registration of webhooks.") @@ -113,6 +118,18 @@ func main() { return } + if SLOFilePath != "" { + // convert + content, err := convertSLO(SLOFilePath, analysisDefinition, namespace) + if err != nil { + log.Fatalf(err.Error()) + return + } + // write out converted result + fmt.Print(content) + return + } + // Start the custom metrics adapter go startCustomMetricsAdapter(env.PodNamespace) @@ -235,3 +252,20 @@ func convertSLI(SLIFilePath, provider, namespace string) (string, error) { return content, nil } + +func convertSLO(SLOFilePath, analysisDefinition, namespace string) (string, error) { + //read file content + fileContent, err := os.ReadFile(SLOFilePath) + if err != nil { + return "", fmt.Errorf("error reading file content: %s", err.Error()) + } + + // convert + c := converter.NewSLOConverter() + content, err := c.Convert(fileContent, analysisDefinition, namespace) + if err != nil { + return "", err + } + + return content, nil +} From 8df9ca4840201106361b8ab8d2e7765d946b5ed2 Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Tue, 29 Aug 2023 14:07:50 +0200 Subject: [PATCH 05/78] chore: release deno-runtime 1.0.0 (#1975) --- .release-please-manifest.json | 2 +- runtimes/deno-runtime/CHANGELOG.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 runtimes/deno-runtime/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dea214652b1..5a73263c8e4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.0.0","runtimes/python-runtime":"1.0.0"} +{".":"0.8.1","klt-cert-manager":"1.0.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.0"} diff --git a/runtimes/deno-runtime/CHANGELOG.md b/runtimes/deno-runtime/CHANGELOG.md new file mode 100644 index 00000000000..c11e53ef3c5 --- /dev/null +++ b/runtimes/deno-runtime/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 1.0.0 (2023-08-29) + + +### Features + +* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) From c989a6c5a0d0498d9157380018c3c19013a9cd30 Mon Sep 17 00:00:00 2001 From: Adam Gardner <26523841+agardnerIT@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:55:58 +1000 Subject: [PATCH 06/78] fix: fix Go badge (#1983) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d628fc62e2c..3e0c80bdb85 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![build](https://img.shields.io/github/actions/workflow/status/keptn/lifecycle-toolkit/CI.yaml?branch=main) ![Codecov](https://img.shields.io/codecov/c/github/keptn/lifecycle-toolkit?token=KPGfrBb2sA) -![goversion](https://img.shields.io/github/go-mod/go-version/keptn/lifecycle-toolkit?filename=operator%2Fgo.mod) +![goversion](https://img.shields.io/github/go-mod/go-version/keptn/lifecycle-toolkit?filename=lifecycle-operator/go.mod) ![version](https://img.shields.io/github/v/release/keptn/lifecycle-toolkit) [![GitHub Discussions](https://img.shields.io/github/discussions/keptn/lifecycle-toolkit)](https://github.com/keptn/lifecycle-toolkit/discussions) From 65092c330ad7d0be404cdf679a251b80cace890a Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Wed, 30 Aug 2023 09:17:43 +0200 Subject: [PATCH 07/78] ci: fix release pipeline again (#1980) --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7fa98366b03..97f2cc20b63 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,13 +46,31 @@ jobs: default-branch: main signoff: "keptn-bot <86361500+keptn-bot@users.noreply.github.com>" + - name: Debug info + env: + CHANGED_ITEMS: ${{ steps.release.outputs.paths_released }} + KLT_TAG: ${{ steps.release.outputs.tag_name }} + PATHS_RELEASED: ${{ steps.release.outputs.paths_released }} + ARTIFACT_TAG_NAME: ${{ steps.release.outputs[format('{0}--tag_name', fromJson(steps.release.outputs.paths_released)[0])] }} + FULL_RELEASE_OUTPUT: ${{ toJSON(steps.release.outputs) }} + run: | + echo "PATHS_RELEASE_JSON: ${PATHS_RELEASE_JSON}" + echo "FULL RELEASE OUTPUT: ${FULL_RELEASE_OUTPUT}" + echo "CHANGED_ITEMS: ${CHANGED_ITEMS}" + echo "KLT_TAG: ${KLT_TAG}" + echo "ARTIFACT_TAG_NAME: ${ARTIFACT_TAG_NAME}" + echo "PATHS_RELEASED: ${PATHS_RELEASED}" + echo "CERT_MANAGER_TAG_NAME: ${{ steps.release.outputs.klt-cert-manager--tag_name }}" + echo "KLT_TAG_NAME: ${{ steps.release.outputs.tag_name }}" + echo "METRICS_OPERATOR_TAG_NAME: ${{ steps.release.outputs.metrics-operator--tag_name }}" + - name: Create release matrix id: build-matrix uses: actions/github-script@v6 env: CHANGED_ITEMS: ${{ steps.release.outputs.paths_released }} KLT_TAG: ${{ steps.release.outputs.tag_name }} - ARTIFACT_TAG_NAME: ${{ steps.release.outputs[format('{0}--tag_name', steps.release.outputs.paths_released[0])] }} + ARTIFACT_TAG_NAME: ${{ steps.release.outputs[format('{0}--tag_name', fromJson(steps.release.outputs.paths_released)[0])] }} with: script: | const changedItems = JSON.parse(process.env.CHANGED_ITEMS || '[]'); @@ -80,10 +98,15 @@ jobs: ]; case "metrics-operator": case "klt-cert-manager": + return [{ + name: item, + folder: item, + tagName: process.env.ARTIFACT_TAG_NAME + }]; case "runtimes/deno-runtime": case "runtimes/python-runtime": return [{ - name: item, + name: item.replace("runtimes/", ""), folder: item, tagName: process.env.ARTIFACT_TAG_NAME }]; From bb133cfd2ac3207e8a4006eb7a9390dc58737465 Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Wed, 30 Aug 2023 09:23:36 +0200 Subject: [PATCH 08/78] chore: release cert-manager 1.1.0 (#1972) --- .release-please-manifest.json | 2 +- klt-cert-manager/CHANGELOG.md | 7 +++++++ klt-cert-manager/Makefile | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5a73263c8e4..012f3669bc1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.0.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.0"} +{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.0"} diff --git a/klt-cert-manager/CHANGELOG.md b/klt-cert-manager/CHANGELOG.md index 6f38472ca2e..503fd87b33b 100644 --- a/klt-cert-manager/CHANGELOG.md +++ b/klt-cert-manager/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.0](https://github.com/keptn/lifecycle-toolkit/compare/cert-manager-v1.0.0...cert-manager-v1.1.0) (2023-08-30) + + +### Features + +* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) + ## 1.0.0 (2023-08-28) diff --git a/klt-cert-manager/Makefile b/klt-cert-manager/Makefile index 61414a78291..84f85ad6588 100644 --- a/klt-cert-manager/Makefile +++ b/klt-cert-manager/Makefile @@ -6,7 +6,7 @@ RELEASE_REGISTRY?=ghcr.io/keptn RELEASE_TIME=$(shell date +%Y%m%d%s) BUILD_TIME=$(shell date -u "+%F_%T") RELEASE_VERSION?=$(RELEASE_TIME)-v0.24.3#$(shell git describe --tags --match "v*") -TAG?="v1.0.0" # x-release-please-version +TAG?="v1.1.0" # x-release-please-version RELEASE_IMAGE:=certificate-operator:$(TAG) CHART_APPVERSION?="" From c7697bf54d5fe18b7c62c5b11801c6c83079b0a3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 30 Aug 2023 10:07:05 +0200 Subject: [PATCH 09/78] deps: update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to bb133cf (#1963) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- lifecycle-operator/go.mod | 2 +- lifecycle-operator/go.sum | 4 ++-- metrics-operator/go.mod | 2 +- metrics-operator/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lifecycle-operator/go.mod b/lifecycle-operator/go.mod index 9ff84fe51b3..e87db664dc3 100644 --- a/lifecycle-operator/go.mod +++ b/lifecycle-operator/go.mod @@ -9,7 +9,7 @@ require ( github.com/cloudevents/sdk-go/v2 v2.14.0 github.com/go-logr/logr v1.2.4 github.com/kelseyhightower/envconfig v1.4.0 - github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230807110601-88a54f97c157 + github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3 github.com/magiconair/properties v1.8.7 github.com/onsi/ginkgo/v2 v2.11.0 github.com/onsi/gomega v1.27.10 diff --git a/lifecycle-operator/go.sum b/lifecycle-operator/go.sum index 8cc52e49cae..97bc53fb2f5 100644 --- a/lifecycle-operator/go.sum +++ b/lifecycle-operator/go.sum @@ -210,8 +210,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230807110601-88a54f97c157 h1:qEhM16/Ce2+eeeSyJEIDU7a7UVlM2uBPDFQgXneA/7Y= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230807110601-88a54f97c157/go.mod h1:c4dEFwlXo62YVmFw4I5cxgSC/gK96NeE9mDxayHasV0= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3 h1:YkozPCcc6yNx1ET5HiM/yj2AziVG+uX90uved8h/YjQ= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3/go.mod h1:8L3D7pL1WWNHfp0Fm0hGroIlNWaEDeCA35wlFDPSEMo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index bb221e571c9..528ed325e27 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-logr/logr v1.2.4 github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230807110601-88a54f97c157 + github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3 github.com/open-feature/go-sdk v1.7.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 diff --git a/metrics-operator/go.sum b/metrics-operator/go.sum index ba41736531d..628021208ca 100644 --- a/metrics-operator/go.sum +++ b/metrics-operator/go.sum @@ -267,8 +267,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230807110601-88a54f97c157 h1:qEhM16/Ce2+eeeSyJEIDU7a7UVlM2uBPDFQgXneA/7Y= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230807110601-88a54f97c157/go.mod h1:c4dEFwlXo62YVmFw4I5cxgSC/gK96NeE9mDxayHasV0= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3 h1:YkozPCcc6yNx1ET5HiM/yj2AziVG+uX90uved8h/YjQ= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3/go.mod h1:8L3D7pL1WWNHfp0Fm0hGroIlNWaEDeCA35wlFDPSEMo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= From 7fb8952c514909ce2c0202e01f1cf501de2c8d55 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:05:57 +0200 Subject: [PATCH 10/78] feat(metrics-operator): introduce range operators in AnalysisDefinition (#1976) Signed-off-by: odubajDT --- .../scripts/.helm-tests/default/result.yaml | 100 ++++++++++++++++++ .../docs/crd-ref/metrics/v1alpha3/_index.md | 17 +++ .../templates/analysisdefinition-crd.yaml | 100 ++++++++++++++++++ .../api/v1alpha3/analysisdefinition_types.go | 12 +++ .../v1alpha3/analysisdefinition_webhook.go | 20 ++++ .../analysisdefinition_webhook_test.go | 63 +++++++++++ .../api/v1alpha3/zz_generated.deepcopy.go | 27 +++++ .../metrics.keptn.sh_analysisdefinitions.yaml | 100 ++++++++++++++++++ .../metrics_v1alpha3_analysisdefinition.yaml | 5 +- .../common/analysis/operator_evaluator.go | 4 + .../analysis/operator_evaluator_test.go | 77 ++++++++++++++ 11 files changed, 523 insertions(+), 2 deletions(-) diff --git a/.github/scripts/.helm-tests/default/result.yaml b/.github/scripts/.helm-tests/default/result.yaml index 84c21719337..23a061dafed 100644 --- a/.github/scripts/.helm-tests/default/result.yaml +++ b/.github/scripts/.helm-tests/default/result.yaml @@ -373,6 +373,56 @@ spec: required: - fixedValue type: object + inRange: + description: InRange represents operator checking the + value is inclusively in the defined range, e.g. 2 + <= x <= 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object + notInRange: + description: NotInRange represents operator checking + the value is exclusively out of the defined range, + e.g. x < 2 AND x > 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object type: object warning: description: Warning defines limits where the result does @@ -443,6 +493,56 @@ spec: required: - fixedValue type: object + inRange: + description: InRange represents operator checking the + value is inclusively in the defined range, e.g. 2 + <= x <= 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object + notInRange: + description: NotInRange represents operator checking + the value is exclusively out of the defined range, + e.g. x < 2 AND x > 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object type: object type: object weight: diff --git a/docs/content/en/docs/crd-ref/metrics/v1alpha3/_index.md b/docs/content/en/docs/crd-ref/metrics/v1alpha3/_index.md index e9e86a6880a..8e33f0f64a4 100644 --- a/docs/content/en/docs/crd-ref/metrics/v1alpha3/_index.md +++ b/docs/content/en/docs/crd-ref/metrics/v1alpha3/_index.md @@ -342,6 +342,8 @@ _Appears in:_ | `greaterThan` _[OperatorValue](#operatorvalue)_ | GreaterThan represents '>' operator | | `greaterThanOrEqual` _[OperatorValue](#operatorvalue)_ | GreaterThanOrEqual represents '>=' operator | | `equalTo` _[OperatorValue](#operatorvalue)_ | EqualTo represents '==' operator | +| `inRange` _[RangeValue](#rangevalue)_ | InRange represents operator checking the value is inclusively in the defined range, e.g. 2 <= x <= 5 | +| `notInRange` _[RangeValue](#rangevalue)_ | NotInRange represents operator checking the value is exclusively out of the defined range, e.g. x < 2 AND x > 5 | #### OperatorValue @@ -388,6 +390,21 @@ _Appears in:_ | `aggregation` _string_ | Aggregation defines the type of aggregation function to be applied on the data. Accepted values: p90, p95, p99, max, min, avg, median | +#### RangeValue + + + +RangeValue represents a range which the value should fit + +_Appears in:_ +- [Operator](#operator) + +| Field | Description | +| --- | --- | +| `lowBound` _Quantity_ | LowBound defines the lower bound of the range | +| `highBound` _Quantity_ | HighBound defines the higher bound of the range | + + #### Target diff --git a/helm/chart/templates/analysisdefinition-crd.yaml b/helm/chart/templates/analysisdefinition-crd.yaml index 79e7d6684cb..4d2a8898a00 100644 --- a/helm/chart/templates/analysisdefinition-crd.yaml +++ b/helm/chart/templates/analysisdefinition-crd.yaml @@ -134,6 +134,56 @@ spec: required: - fixedValue type: object + inRange: + description: InRange represents operator checking the + value is inclusively in the defined range, e.g. 2 + <= x <= 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object + notInRange: + description: NotInRange represents operator checking + the value is exclusively out of the defined range, + e.g. x < 2 AND x > 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object type: object warning: description: Warning defines limits where the result does @@ -204,6 +254,56 @@ spec: required: - fixedValue type: object + inRange: + description: InRange represents operator checking the + value is inclusively in the defined range, e.g. 2 + <= x <= 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object + notInRange: + description: NotInRange represents operator checking + the value is exclusively out of the defined range, + e.g. x < 2 AND x > 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object type: object type: object weight: diff --git a/metrics-operator/api/v1alpha3/analysisdefinition_types.go b/metrics-operator/api/v1alpha3/analysisdefinition_types.go index d6952c80887..ab98d3651db 100644 --- a/metrics-operator/api/v1alpha3/analysisdefinition_types.go +++ b/metrics-operator/api/v1alpha3/analysisdefinition_types.go @@ -69,6 +69,14 @@ type OperatorValue struct { FixedValue resource.Quantity `json:"fixedValue" yaml:"fixedValue"` } +// RangeValue represents a range which the value should fit +type RangeValue struct { + // LowBound defines the lower bound of the range + LowBound resource.Quantity `json:"lowBound"` + // HighBound defines the higher bound of the range + HighBound resource.Quantity `json:"highBound"` +} + // Operator specifies the supported operators for value comparisons type Operator struct { // LessThanOrEqual represents '<=' operator @@ -81,6 +89,10 @@ type Operator struct { GreaterThanOrEqual *OperatorValue `json:"greaterThanOrEqual,omitempty" yaml:"greaterThanOrEqual,omitempty"` // EqualTo represents '==' operator EqualTo *OperatorValue `json:"equalTo,omitempty" yaml:"equalTo,omitempty"` + // InRange represents operator checking the value is inclusively in the defined range, e.g. 2 <= x <= 5 + InRange *RangeValue `json:"inRange,omitempty" yaml:"inRange,omitempty"` + // NotInRange represents operator checking the value is exclusively out of the defined range, e.g. x < 2 AND x > 5 + NotInRange *RangeValue `json:"notInRange,omitempty" yaml:"notInRange,omitempty"` } //+kubebuilder:object:root=true diff --git a/metrics-operator/api/v1alpha3/analysisdefinition_webhook.go b/metrics-operator/api/v1alpha3/analysisdefinition_webhook.go index b2acdcf9081..d3892adc899 100644 --- a/metrics-operator/api/v1alpha3/analysisdefinition_webhook.go +++ b/metrics-operator/api/v1alpha3/analysisdefinition_webhook.go @@ -100,6 +100,7 @@ func (t *Target) validate() error { return nil } +//nolint:gocyclo func (o *Operator) validate() error { counter := 0 if o.LessThan != nil { @@ -117,11 +118,30 @@ func (o *Operator) validate() error { if o.EqualTo != nil { counter++ } + if o.InRange != nil { + counter++ + } + if o.NotInRange != nil { + counter++ + } if counter > 1 { return fmt.Errorf("Operator: multiple operators can not be set") } if counter == 0 { return fmt.Errorf("Operator: no operator set") } + if o.InRange != nil { + return o.InRange.validate() + } + if o.NotInRange != nil { + return o.NotInRange.validate() + } + return nil +} + +func (r *RangeValue) validate() error { + if r.LowBound.AsApproximateFloat64() >= r.HighBound.AsApproximateFloat64() { + return fmt.Errorf("RangeValue: lower bound of the range needs to be smaller than higher bound") + } return nil } diff --git a/metrics-operator/api/v1alpha3/analysisdefinition_webhook_test.go b/metrics-operator/api/v1alpha3/analysisdefinition_webhook_test.go index 1fc66479ae8..b533cb2de8e 100644 --- a/metrics-operator/api/v1alpha3/analysisdefinition_webhook_test.go +++ b/metrics-operator/api/v1alpha3/analysisdefinition_webhook_test.go @@ -28,9 +28,33 @@ func TestOperator_validate(t *testing.T) { LessThan: &OperatorValue{ FixedValue: *resource.NewQuantity(5, resource.DecimalSI), }, + InRange: &RangeValue{ + LowBound: *resource.NewQuantity(5, resource.DecimalSI), + HighBound: *resource.NewQuantity(15, resource.DecimalSI), + }, }, wantErr: fmt.Errorf("Operator: multiple operators can not be set"), }, + { + name: "in range - fail validation", + operator: Operator{ + InRange: &RangeValue{ + LowBound: *resource.NewQuantity(25, resource.DecimalSI), + HighBound: *resource.NewQuantity(15, resource.DecimalSI), + }, + }, + wantErr: fmt.Errorf("RangeValue: lower bound of the range needs to be smaller than higher bound"), + }, + { + name: "not in range - fail validation", + operator: Operator{ + NotInRange: &RangeValue{ + LowBound: *resource.NewQuantity(25, resource.DecimalSI), + HighBound: *resource.NewQuantity(15, resource.DecimalSI), + }, + }, + wantErr: fmt.Errorf("RangeValue: lower bound of the range needs to be smaller than higher bound"), + }, { name: "happy path", operator: Operator{ @@ -49,6 +73,45 @@ func TestOperator_validate(t *testing.T) { } } +func TestRangeValue_validate(t *testing.T) { + tests := []struct { + name string + r RangeValue + wantErr error + }{ + { + name: "happy path", + r: RangeValue{ + LowBound: *resource.NewQuantity(5, resource.DecimalSI), + HighBound: *resource.NewQuantity(15, resource.DecimalSI), + }, + wantErr: nil, + }, + { + name: "equal bounds", + r: RangeValue{ + LowBound: *resource.NewQuantity(5, resource.DecimalSI), + HighBound: *resource.NewQuantity(5, resource.DecimalSI), + }, + wantErr: fmt.Errorf("RangeValue: lower bound of the range needs to be smaller than higher bound"), + }, + { + name: "lower greater that higher bound", + r: RangeValue{ + LowBound: *resource.NewQuantity(15, resource.DecimalSI), + HighBound: *resource.NewQuantity(5, resource.DecimalSI), + }, + wantErr: fmt.Errorf("RangeValue: lower bound of the range needs to be smaller than higher bound"), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.wantErr, tt.r.validate()) + }) + } +} + func TestScore_validate(t *testing.T) { tests := []struct { name string diff --git a/metrics-operator/api/v1alpha3/zz_generated.deepcopy.go b/metrics-operator/api/v1alpha3/zz_generated.deepcopy.go index 214894b69b2..052d20177a4 100644 --- a/metrics-operator/api/v1alpha3/zz_generated.deepcopy.go +++ b/metrics-operator/api/v1alpha3/zz_generated.deepcopy.go @@ -497,6 +497,16 @@ func (in *Operator) DeepCopyInto(out *Operator) { *out = new(OperatorValue) (*in).DeepCopyInto(*out) } + if in.InRange != nil { + in, out := &in.InRange, &out.InRange + *out = new(RangeValue) + (*in).DeepCopyInto(*out) + } + if in.NotInRange != nil { + in, out := &in.NotInRange, &out.NotInRange + *out = new(RangeValue) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Operator. @@ -555,6 +565,23 @@ func (in *RangeSpec) DeepCopy() *RangeSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RangeValue) DeepCopyInto(out *RangeValue) { + *out = *in + out.LowBound = in.LowBound.DeepCopy() + out.HighBound = in.HighBound.DeepCopy() +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RangeValue. +func (in *RangeValue) DeepCopy() *RangeValue { + if in == nil { + return nil + } + out := new(RangeValue) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Target) DeepCopyInto(out *Target) { *out = *in diff --git a/metrics-operator/config/crd/bases/metrics.keptn.sh_analysisdefinitions.yaml b/metrics-operator/config/crd/bases/metrics.keptn.sh_analysisdefinitions.yaml index 6d26b70ba5f..e077f6d01d3 100644 --- a/metrics-operator/config/crd/bases/metrics.keptn.sh_analysisdefinitions.yaml +++ b/metrics-operator/config/crd/bases/metrics.keptn.sh_analysisdefinitions.yaml @@ -106,6 +106,31 @@ spec: required: - fixedValue type: object + inRange: + description: InRange represents operator checking the + value is inclusively in the defined range, e.g. 2 + <= x <= 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound + of the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object lessThan: description: LessThan represents '<' operator properties: @@ -132,6 +157,31 @@ spec: required: - fixedValue type: object + notInRange: + description: NotInRange represents operator checking + the value is exclusively out of the defined range, + e.g. x < 2 AND x > 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound + of the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object type: object warning: description: Warning defines limits where the result does @@ -176,6 +226,31 @@ spec: required: - fixedValue type: object + inRange: + description: InRange represents operator checking the + value is inclusively in the defined range, e.g. 2 + <= x <= 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound + of the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object lessThan: description: LessThan represents '<' operator properties: @@ -202,6 +277,31 @@ spec: required: - fixedValue type: object + notInRange: + description: NotInRange represents operator checking + the value is exclusively out of the defined range, + e.g. x < 2 AND x > 5 + properties: + highBound: + anyOf: + - type: integer + - type: string + description: HighBound defines the higher bound + of the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + lowBound: + anyOf: + - type: integer + - type: string + description: LowBound defines the lower bound of + the range + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - highBound + - lowBound + type: object type: object type: object weight: diff --git a/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml b/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml index 9898bb5892b..247870f8c54 100644 --- a/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml +++ b/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml @@ -12,8 +12,9 @@ spec: lessThan: fixedValue: 600 warning: - greaterThanOrEqual: - fixedValue: 800 + inRange: + lowBound: 300 + highBound: 500 weight: 1 keyObjective: false totalScore: diff --git a/metrics-operator/controllers/common/analysis/operator_evaluator.go b/metrics-operator/controllers/common/analysis/operator_evaluator.go index 9681beb1b4b..cae29bece22 100644 --- a/metrics-operator/controllers/common/analysis/operator_evaluator.go +++ b/metrics-operator/controllers/common/analysis/operator_evaluator.go @@ -23,6 +23,10 @@ func (te *OperatorEvaluator) Evaluate(val float64, t *v1alpha3.Operator) types.O result.Fulfilled = (val >= t.GreaterThanOrEqual.GetFloatValue()) } else if t.GreaterThan != nil { result.Fulfilled = (val > t.GreaterThan.GetFloatValue()) + } else if t.InRange != nil { + result.Fulfilled = (val >= t.InRange.LowBound.AsApproximateFloat64() && val <= t.InRange.HighBound.AsApproximateFloat64()) + } else if t.NotInRange != nil { + result.Fulfilled = (val < t.NotInRange.LowBound.AsApproximateFloat64() || val > t.NotInRange.HighBound.AsApproximateFloat64()) } return result diff --git a/metrics-operator/controllers/common/analysis/operator_evaluator_test.go b/metrics-operator/controllers/common/analysis/operator_evaluator_test.go index 075ab09a5fd..93dc1e39a7e 100644 --- a/metrics-operator/controllers/common/analysis/operator_evaluator_test.go +++ b/metrics-operator/controllers/common/analysis/operator_evaluator_test.go @@ -11,6 +11,7 @@ import ( func TestOperatorEvaluator_Evaluate(t *testing.T) { compValue := resource.NewQuantity(15, resource.DecimalSI) + compValue2 := resource.NewQuantity(25, resource.DecimalSI) tests := []struct { name string val float64 @@ -187,6 +188,82 @@ func TestOperatorEvaluator_Evaluate(t *testing.T) { Fulfilled: false, }, }, + { + name: "in range - fulfilled", + val: 20.0, + o: v1alpha3.Operator{ + InRange: &v1alpha3.RangeValue{ + LowBound: *compValue, + HighBound: *compValue2, + }, + }, + want: types.OperatorResult{ + Operator: v1alpha3.Operator{ + InRange: &v1alpha3.RangeValue{ + LowBound: *compValue, + HighBound: *compValue2, + }, + }, + Fulfilled: true, + }, + }, + { + name: "in range - not fulfilled", + val: 30.0, + o: v1alpha3.Operator{ + InRange: &v1alpha3.RangeValue{ + LowBound: *compValue, + HighBound: *compValue2, + }, + }, + want: types.OperatorResult{ + Operator: v1alpha3.Operator{ + InRange: &v1alpha3.RangeValue{ + LowBound: *compValue, + HighBound: *compValue2, + }, + }, + Fulfilled: false, + }, + }, + { + name: "not in range - fulfilled", + val: 30.0, + o: v1alpha3.Operator{ + NotInRange: &v1alpha3.RangeValue{ + LowBound: *compValue, + HighBound: *compValue2, + }, + }, + want: types.OperatorResult{ + Operator: v1alpha3.Operator{ + NotInRange: &v1alpha3.RangeValue{ + LowBound: *compValue, + HighBound: *compValue2, + }, + }, + Fulfilled: true, + }, + }, + { + name: "not in range - not fulfilled", + val: 20.0, + o: v1alpha3.Operator{ + NotInRange: &v1alpha3.RangeValue{ + LowBound: *compValue, + HighBound: *compValue2, + }, + }, + want: types.OperatorResult{ + Operator: v1alpha3.Operator{ + NotInRange: &v1alpha3.RangeValue{ + LowBound: *compValue, + HighBound: *compValue2, + }, + }, + Fulfilled: false, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From eb23359939bf0207ccdf978d1326cd378c664813 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Wed, 30 Aug 2023 12:31:08 +0200 Subject: [PATCH 11/78] ci: fix release pipeline one more time (#1987) Signed-off-by: Moritz Wiesinger --- .github/workflows/release.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97f2cc20b63..13dda0a2ed7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,9 +31,6 @@ jobs: releases-created: ${{ steps.release.outputs.releases_created }} build-matrix: ${{ steps.build-matrix.outputs.result }} steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Checkout uses: actions/checkout@v3 @@ -81,10 +78,11 @@ jobs: console.log("items to publish", itemsToPublish); console.log("setting up build matrix..."); - const releaseMatrix = itemsToPublish.map(item => { + const releaseMatrix = []; + itemsToPublish.forEach(item => { switch (item) { case "lifecycle-operator": - return [ + releaseMatrix.push(...[ { name: item, folder: item, @@ -95,26 +93,30 @@ jobs: folder: "scheduler/", tagName: process.env.ARTIFACT_TAG_NAME } - ]; + ]); + break; case "metrics-operator": case "klt-cert-manager": - return [{ + releaseMatrix.push({ name: item, folder: item, tagName: process.env.ARTIFACT_TAG_NAME - }]; + }); + break; case "runtimes/deno-runtime": case "runtimes/python-runtime": - return [{ + releaseMatrix.push({ name: item.replace("runtimes/", ""), folder: item, tagName: process.env.ARTIFACT_TAG_NAME - }]; + }); + break; case ".": default: - return []; + break; } }); + console.log("release matrix: " + JSON.stringify({ config: releaseMatrix })); return { config: releaseMatrix }; build-release: @@ -131,9 +133,6 @@ jobs: env: IMAGE_NAME: ghcr.io/keptn/${{ matrix.config.name }} steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Checkout uses: actions/checkout@v3 with: @@ -161,6 +160,10 @@ jobs: # Remove artifact prefix from tag so that we get clean image tags temp="${IMAGE_TAG##klt-}" temp="${temp##cert-manager-}" + temp="${temp##python-runtime-}" + temp="${temp##deno-runtime-}" + temp="${temp##scheduler-}" + temp="${temp##lifecycle-operator-}" echo "IMAGE_TAG=${temp##metrics-operator-}" >> "$GITHUB_OUTPUT" - name: Build Docker Image From da95b4025775b399084b2937b4ea0c0c360ec86c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:55:29 +0200 Subject: [PATCH 12/78] deps: update denoland/deno docker tag to alpine-1.36.3 (#1944) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- runtimes/deno-runtime/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtimes/deno-runtime/Dockerfile b/runtimes/deno-runtime/Dockerfile index 5beea27d1cd..ea6d8e048f7 100644 --- a/runtimes/deno-runtime/Dockerfile +++ b/runtimes/deno-runtime/Dockerfile @@ -1,4 +1,4 @@ -FROM denoland/deno:alpine-1.36.1 AS production +FROM denoland/deno:alpine-1.36.3 AS production LABEL org.opencontainers.image.source="https://github.com/keptn/lifecycle-toolkit" \ org.opencontainers.image.url="https://keptn.sh" \ From 4e088c535645815dcb3fb58f1c09dc67b97e0c02 Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Wed, 30 Aug 2023 13:29:07 +0200 Subject: [PATCH 13/78] chore: release deno-runtime 1.0.1 (#1990) --- .release-please-manifest.json | 2 +- runtimes/deno-runtime/CHANGELOG.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 012f3669bc1..7a95c567ecd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.0"} +{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} diff --git a/runtimes/deno-runtime/CHANGELOG.md b/runtimes/deno-runtime/CHANGELOG.md index c11e53ef3c5..a3f28406169 100644 --- a/runtimes/deno-runtime/CHANGELOG.md +++ b/runtimes/deno-runtime/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.0.1](https://github.com/keptn/lifecycle-toolkit/compare/deno-runtime-v1.0.0...deno-runtime-v1.0.1) (2023-08-30) + + +### Dependency Updates + +* update denoland/deno docker tag to alpine-1.36.3 ([#1944](https://github.com/keptn/lifecycle-toolkit/issues/1944)) ([da95b40](https://github.com/keptn/lifecycle-toolkit/commit/da95b4025775b399084b2937b4ea0c0c360ec86c)) + ## 1.0.0 (2023-08-29) From b0b37ea56c5b36298834cb8fc1b6fbc8ac345906 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Wed, 30 Aug 2023 13:30:31 +0200 Subject: [PATCH 14/78] chore: remove monitor action (#1989) --- .github/workflows/CI.yaml | 12 ------------ .github/workflows/e2e-test.yml | 3 --- .github/workflows/golangci-lint.yml | 3 --- .github/workflows/htmltest.yaml | 3 --- .github/workflows/integration-test.yml | 3 --- .github/workflows/load-test.yml | 3 --- .github/workflows/markdown-checks.yaml | 9 --------- .github/workflows/performance-test.yml | 3 --- .github/workflows/release-examples.yml | 3 --- .github/workflows/security-scans.yml | 16 ---------------- .github/workflows/set-date.yml | 3 --- .github/workflows/stale.yml | 6 ------ .github/workflows/update-labels.yml | 3 --- .github/workflows/validate-helm-chart.yml | 6 ------ .github/workflows/validate-semantic-pr.yml | 3 --- .github/workflows/yaml-checks.yaml | 3 --- 16 files changed, 82 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 8cd7a2ddfb2..21c0085016c 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -37,9 +37,6 @@ jobs: NON_FORKED_AND_NON_ROBOT_RUN: ${{ steps.get_run_type.outputs.NON_FORKED_AND_NON_ROBOT_RUN }} steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 @@ -88,9 +85,6 @@ jobs: - name: "certificate-operator" folder: "klt-cert-manager/" steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 @@ -137,9 +131,6 @@ jobs: - name: "certificate-operator" folder: "klt-cert-manager/" steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 @@ -244,9 +235,6 @@ jobs: needs: [prepare_ci_run, build_image] runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out klt repo uses: actions/checkout@v3 diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 42251f7e40d..2b1f4401c14 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -24,9 +24,6 @@ jobs: - name: "scheduler" folder: "scheduler/" steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index e5a81163979..22670818c11 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -36,9 +36,6 @@ jobs: - name: "certificate-operator" folder: "klt-cert-manager/" steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/htmltest.yaml b/.github/workflows/htmltest.yaml index 77459f8c9e7..fd794fbc3c6 100644 --- a/.github/workflows/htmltest.yaml +++ b/.github/workflows/htmltest.yaml @@ -21,9 +21,6 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 with: diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 039c68bf460..003265f850b 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -23,9 +23,6 @@ jobs: name: Run Integration Tests runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/load-test.yml b/.github/workflows/load-test.yml index 97579689957..45b876c9358 100644 --- a/.github/workflows/load-test.yml +++ b/.github/workflows/load-test.yml @@ -19,9 +19,6 @@ jobs: name: Run load Tests runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/markdown-checks.yaml b/.github/workflows/markdown-checks.yaml index 8fac728959a..2e0847c5bca 100644 --- a/.github/workflows/markdown-checks.yaml +++ b/.github/workflows/markdown-checks.yaml @@ -29,9 +29,6 @@ jobs: markdown-link-check: runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - uses: actions/checkout@v3 - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: @@ -44,9 +41,6 @@ jobs: markdown-lint: runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 @@ -74,9 +68,6 @@ jobs: name: Check CRD auto-generated docs runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/performance-test.yml b/.github/workflows/performance-test.yml index 3099566d449..9221a1b14de 100644 --- a/.github/workflows/performance-test.yml +++ b/.github/workflows/performance-test.yml @@ -17,9 +17,6 @@ jobs: name: Performance Tests runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/release-examples.yml b/.github/workflows/release-examples.yml index 74fb4b68e34..4d600719101 100644 --- a/.github/workflows/release-examples.yml +++ b/.github/workflows/release-examples.yml @@ -22,9 +22,6 @@ jobs: release-examples: runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/security-scans.yml b/.github/workflows/security-scans.yml index f0b8e05630d..d25f239f76d 100644 --- a/.github/workflows/security-scans.yml +++ b/.github/workflows/security-scans.yml @@ -20,9 +20,6 @@ jobs: name: "Prepare Security Scans" runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Determine Target Branch id: determine_branch run: | @@ -105,9 +102,6 @@ jobs: - tool: "kubescape" kubescape-framework: "ARMOBest" steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Set up Go if: matrix.tool == 'kubeconform' uses: actions/setup-go@v4 @@ -207,9 +201,6 @@ jobs: - "scheduler" - "certificate-operator" steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Download images id: download_images uses: actions/download-artifact@v3 @@ -235,11 +226,7 @@ jobs: - "metrics-operator" - "scheduler" - "klt-cert-manager" - steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Set up Go 1.x uses: actions/setup-go@v4 with: @@ -263,9 +250,6 @@ jobs: needs: [security-scans, govulncheck, trivy] if: failure() && github.event_name == 'schedule' steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Formulate bug issue id: formulate_bug_issue run: | diff --git a/.github/workflows/set-date.yml b/.github/workflows/set-date.yml index 43ce5bc4d9d..9abf7c0e8f5 100644 --- a/.github/workflows/set-date.yml +++ b/.github/workflows/set-date.yml @@ -7,9 +7,6 @@ jobs: set_date: runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Get project data env: GITHUB_TOKEN: ${{ secrets.KEPTN_BOT_PROJECT_TOKEN }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 0cdf24c0bc7..a2c48f9a622 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -9,9 +9,6 @@ jobs: stale: runs-on: ubuntu-latest steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - uses: actions/stale@v8 with: days-before-stale: 60 @@ -29,9 +26,6 @@ jobs: stale-good-first-issues: runs-on: ubuntu-latest steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - uses: actions/stale@v8 with: days-before-stale: 21 diff --git a/.github/workflows/update-labels.yml b/.github/workflows/update-labels.yml index e316e1b788a..c1567890e28 100644 --- a/.github/workflows/update-labels.yml +++ b/.github/workflows/update-labels.yml @@ -9,9 +9,6 @@ jobs: pull-requests: write runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Update Labels uses: actions/labeler@v4 with: diff --git a/.github/workflows/validate-helm-chart.yml b/.github/workflows/validate-helm-chart.yml index 14e9b34a476..6066164d308 100644 --- a/.github/workflows/validate-helm-chart.yml +++ b/.github/workflows/validate-helm-chart.yml @@ -16,9 +16,6 @@ jobs: name: Check helm documentation values runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 @@ -57,9 +54,6 @@ jobs: name: Run helm tests runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/validate-semantic-pr.yml b/.github/workflows/validate-semantic-pr.yml index ac32215f905..739ba57e53b 100644 --- a/.github/workflows/validate-semantic-pr.yml +++ b/.github/workflows/validate-semantic-pr.yml @@ -12,9 +12,6 @@ jobs: validate: runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - name: Validate Pull Request uses: amannn/action-semantic-pull-request@v5.2.0 env: diff --git a/.github/workflows/yaml-checks.yaml b/.github/workflows/yaml-checks.yaml index 12942566cbf..17b717ac552 100644 --- a/.github/workflows/yaml-checks.yaml +++ b/.github/workflows/yaml-checks.yaml @@ -23,9 +23,6 @@ jobs: yamllint: runs-on: ubuntu-22.04 steps: - - name: Install monitor action - uses: GitHubSecurityLab/actions-permissions/monitor@v1 - - uses: actions/checkout@v3 - name: Lint YAML files From 9b2f2cfa108be09848aef30d408844473c5885c7 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 31 Aug 2023 09:00:12 +0200 Subject: [PATCH 15/78] revert: revert cert-manager release (#1994) --- .release-please-manifest.json | 2 +- klt-cert-manager/CHANGELOG.md | 7 ------- klt-cert-manager/Makefile | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7a95c567ecd..2f7811e3911 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} +{".":"0.8.1","klt-cert-manager":"1.0.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} diff --git a/klt-cert-manager/CHANGELOG.md b/klt-cert-manager/CHANGELOG.md index 503fd87b33b..6f38472ca2e 100644 --- a/klt-cert-manager/CHANGELOG.md +++ b/klt-cert-manager/CHANGELOG.md @@ -1,12 +1,5 @@ # Changelog -## [1.1.0](https://github.com/keptn/lifecycle-toolkit/compare/cert-manager-v1.0.0...cert-manager-v1.1.0) (2023-08-30) - - -### Features - -* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) - ## 1.0.0 (2023-08-28) diff --git a/klt-cert-manager/Makefile b/klt-cert-manager/Makefile index 84f85ad6588..61414a78291 100644 --- a/klt-cert-manager/Makefile +++ b/klt-cert-manager/Makefile @@ -6,7 +6,7 @@ RELEASE_REGISTRY?=ghcr.io/keptn RELEASE_TIME=$(shell date +%Y%m%d%s) BUILD_TIME=$(shell date -u "+%F_%T") RELEASE_VERSION?=$(RELEASE_TIME)-v0.24.3#$(shell git describe --tags --match "v*") -TAG?="v1.1.0" # x-release-please-version +TAG?="v1.0.0" # x-release-please-version RELEASE_IMAGE:=certificate-operator:$(TAG) CHART_APPVERSION?="" From a8c22f779eafd68ea12c97c808ad2041fc89acbf Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Thu, 31 Aug 2023 09:02:29 +0200 Subject: [PATCH 16/78] chore: release cert-manager 1.1.0 (#1993) --- .release-please-manifest.json | 2 +- klt-cert-manager/CHANGELOG.md | 12 ++++++++++++ klt-cert-manager/Makefile | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2f7811e3911..7a95c567ecd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.0.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} +{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} diff --git a/klt-cert-manager/CHANGELOG.md b/klt-cert-manager/CHANGELOG.md index 6f38472ca2e..82334fbf9b9 100644 --- a/klt-cert-manager/CHANGELOG.md +++ b/klt-cert-manager/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.1.0](https://github.com/keptn/lifecycle-toolkit/compare/cert-manager-v1.0.0...cert-manager-v1.1.0) (2023-08-31) + + +### Features + +* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) + + +### Other + +* release cert-manager 1.1.0 ([#1972](https://github.com/keptn/lifecycle-toolkit/issues/1972)) ([bb133cf](https://github.com/keptn/lifecycle-toolkit/commit/bb133cfd2ac3207e8a4006eb7a9390dc58737465)) + ## 1.0.0 (2023-08-28) diff --git a/klt-cert-manager/Makefile b/klt-cert-manager/Makefile index 61414a78291..84f85ad6588 100644 --- a/klt-cert-manager/Makefile +++ b/klt-cert-manager/Makefile @@ -6,7 +6,7 @@ RELEASE_REGISTRY?=ghcr.io/keptn RELEASE_TIME=$(shell date +%Y%m%d%s) BUILD_TIME=$(shell date -u "+%F_%T") RELEASE_VERSION?=$(RELEASE_TIME)-v0.24.3#$(shell git describe --tags --match "v*") -TAG?="v1.0.0" # x-release-please-version +TAG?="v1.1.0" # x-release-please-version RELEASE_IMAGE:=certificate-operator:$(TAG) CHART_APPVERSION?="" From bae955b29c6607aa1c08f0f8eea84ca9030697e4 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 31 Aug 2023 09:31:25 +0200 Subject: [PATCH 17/78] ci: fix release matrix again (#1996) --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13dda0a2ed7..6a6aa0a98dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,13 +96,19 @@ jobs: ]); break; case "metrics-operator": - case "klt-cert-manager": releaseMatrix.push({ name: item, folder: item, tagName: process.env.ARTIFACT_TAG_NAME }); break; + case "klt-cert-manager": + releaseMatrix.push({ + name: "certificate-operator", + folder: item, + tagName: process.env.ARTIFACT_TAG_NAME + }); + break; case "runtimes/deno-runtime": case "runtimes/python-runtime": releaseMatrix.push({ From 6019c7c0a4ba06f1a7b9f7e0fa6e7cfd2dce9cfe Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 31 Aug 2023 09:35:35 +0200 Subject: [PATCH 18/78] revert: revert cert-manager release again (#1997) --- .release-please-manifest.json | 2 +- klt-cert-manager/CHANGELOG.md | 12 ------------ klt-cert-manager/Makefile | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7a95c567ecd..2f7811e3911 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} +{".":"0.8.1","klt-cert-manager":"1.0.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} diff --git a/klt-cert-manager/CHANGELOG.md b/klt-cert-manager/CHANGELOG.md index 82334fbf9b9..6f38472ca2e 100644 --- a/klt-cert-manager/CHANGELOG.md +++ b/klt-cert-manager/CHANGELOG.md @@ -1,17 +1,5 @@ # Changelog -## [1.1.0](https://github.com/keptn/lifecycle-toolkit/compare/cert-manager-v1.0.0...cert-manager-v1.1.0) (2023-08-31) - - -### Features - -* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) - - -### Other - -* release cert-manager 1.1.0 ([#1972](https://github.com/keptn/lifecycle-toolkit/issues/1972)) ([bb133cf](https://github.com/keptn/lifecycle-toolkit/commit/bb133cfd2ac3207e8a4006eb7a9390dc58737465)) - ## 1.0.0 (2023-08-28) diff --git a/klt-cert-manager/Makefile b/klt-cert-manager/Makefile index 84f85ad6588..61414a78291 100644 --- a/klt-cert-manager/Makefile +++ b/klt-cert-manager/Makefile @@ -6,7 +6,7 @@ RELEASE_REGISTRY?=ghcr.io/keptn RELEASE_TIME=$(shell date +%Y%m%d%s) BUILD_TIME=$(shell date -u "+%F_%T") RELEASE_VERSION?=$(RELEASE_TIME)-v0.24.3#$(shell git describe --tags --match "v*") -TAG?="v1.1.0" # x-release-please-version +TAG?="v1.0.0" # x-release-please-version RELEASE_IMAGE:=certificate-operator:$(TAG) CHART_APPVERSION?="" From 5fbee380634244e32ac0bb90b0cf4b74ee72b661 Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Thu, 31 Aug 2023 09:38:08 +0200 Subject: [PATCH 19/78] chore: release cert-manager 1.1.0 (#1998) --- .release-please-manifest.json | 2 +- klt-cert-manager/CHANGELOG.md | 13 +++++++++++++ klt-cert-manager/Makefile | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2f7811e3911..7a95c567ecd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.0.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} +{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} diff --git a/klt-cert-manager/CHANGELOG.md b/klt-cert-manager/CHANGELOG.md index 6f38472ca2e..c16dd403155 100644 --- a/klt-cert-manager/CHANGELOG.md +++ b/klt-cert-manager/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [1.1.0](https://github.com/keptn/lifecycle-toolkit/compare/cert-manager-v1.0.0...cert-manager-v1.1.0) (2023-08-31) + + +### Features + +* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) + + +### Other + +* release cert-manager 1.1.0 ([#1972](https://github.com/keptn/lifecycle-toolkit/issues/1972)) ([bb133cf](https://github.com/keptn/lifecycle-toolkit/commit/bb133cfd2ac3207e8a4006eb7a9390dc58737465)) +* release cert-manager 1.1.0 ([#1993](https://github.com/keptn/lifecycle-toolkit/issues/1993)) ([a8c22f7](https://github.com/keptn/lifecycle-toolkit/commit/a8c22f779eafd68ea12c97c808ad2041fc89acbf)) + ## 1.0.0 (2023-08-28) diff --git a/klt-cert-manager/Makefile b/klt-cert-manager/Makefile index 61414a78291..84f85ad6588 100644 --- a/klt-cert-manager/Makefile +++ b/klt-cert-manager/Makefile @@ -6,7 +6,7 @@ RELEASE_REGISTRY?=ghcr.io/keptn RELEASE_TIME=$(shell date +%Y%m%d%s) BUILD_TIME=$(shell date -u "+%F_%T") RELEASE_VERSION?=$(RELEASE_TIME)-v0.24.3#$(shell git describe --tags --match "v*") -TAG?="v1.0.0" # x-release-please-version +TAG?="v1.1.0" # x-release-please-version RELEASE_IMAGE:=certificate-operator:$(TAG) CHART_APPVERSION?="" From aaa4df7379589c540d7ead196f9ae4dacf18524e Mon Sep 17 00:00:00 2001 From: Prakriti Mandal <98270250+prakrit55@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:47:32 +0530 Subject: [PATCH 20/78] test: improve integration tests by adding kuttl log collectors (#1834) Signed-off-by: Griffin Signed-off-by: Moritz Wiesinger Signed-off-by: Prakriti Mandal <98270250+prakrit55@users.noreply.github.com> Co-authored-by: Moritz Wiesinger --- .../annotated-namespace-not-enabled/00-assert.yaml | 7 +++++++ test/integration/simple-daemonset-annotated/00-assert.yaml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/test/integration/annotated-namespace-not-enabled/00-assert.yaml b/test/integration/annotated-namespace-not-enabled/00-assert.yaml index 1299075b0db..ae9b55fb3fc 100644 --- a/test/integration/annotated-namespace-not-enabled/00-assert.yaml +++ b/test/integration/annotated-namespace-not-enabled/00-assert.yaml @@ -1,3 +1,10 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: + - type: pod + selector: app=test + - command: kubectl logs -l app=test -n $NAMESPACE +--- apiVersion: v1 kind: Pod metadata: diff --git a/test/integration/simple-daemonset-annotated/00-assert.yaml b/test/integration/simple-daemonset-annotated/00-assert.yaml index b65c3d0fb2e..d5e774210e1 100644 --- a/test/integration/simple-daemonset-annotated/00-assert.yaml +++ b/test/integration/simple-daemonset-annotated/00-assert.yaml @@ -1,3 +1,10 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +collectors: + - type: pod + selector: app=daemonset + - command: kubectl logs -l app=daemonset -n $NAMESPACE +--- apiVersion: v1 kind: Pod metadata: From 121de2eb8881064f390b5abaef7e6c5f5031c5ec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 10:31:02 +0200 Subject: [PATCH 21/78] deps: update ghcr.io/keptn/python-runtime docker tag to v1 (#1985) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Moritz Wiesinger --- .github/scripts/.helm-tests/default/result.yaml | 2 +- .github/scripts/.helm-tests/default/values.yaml | 2 +- helm/chart/README.md | 2 +- helm/chart/values.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/.helm-tests/default/result.yaml b/.github/scripts/.helm-tests/default/result.yaml index 23a061dafed..8dd2b698190 100644 --- a/.github/scripts/.helm-tests/default/result.yaml +++ b/.github/scripts/.helm-tests/default/result.yaml @@ -7771,7 +7771,7 @@ spec: - name: FUNCTION_RUNNER_IMAGE value: "ghcr.io/keptn/functions-runtime:v0.8.1" - name: PYTHON_RUNNER_IMAGE - value: "ghcr.io/keptn/python-runtime:v0.8.1" + value: "ghcr.io/keptn/python-runtime:v1.0.0" - name: OTEL_COLLECTOR_URL value: "otel-collector:4317" - name: KEPTN_APP_CONTROLLER_LOG_LEVEL diff --git a/.github/scripts/.helm-tests/default/values.yaml b/.github/scripts/.helm-tests/default/values.yaml index 57efdc75244..2d1698c2968 100644 --- a/.github/scripts/.helm-tests/default/values.yaml +++ b/.github/scripts/.helm-tests/default/values.yaml @@ -78,7 +78,7 @@ lifecycleOperator: keptnWorkloadInstanceControllerLogLevel: "0" optionsControllerLogLevel: "0" otelCollectorUrl: otel-collector:4317 - pythonRunnerImage: ghcr.io/keptn/python-runtime:v0.8.1 + pythonRunnerImage: ghcr.io/keptn/python-runtime:v1.0.0 image: repository: ghcr.io/keptn/lifecycle-operator tag: v0.8.1 diff --git a/helm/chart/README.md b/helm/chart/README.md index 1e3f2d1cf69..da585522026 100644 --- a/helm/chart/README.md +++ b/helm/chart/README.md @@ -92,7 +92,7 @@ checks | `lifecycleOperator.manager.env.optionsControllerLogLevel` | sets the log level of Keptn Options Controller | `0` | | `lifecycleOperator.manager.env.otelCollectorUrl` | Sets the URL for the open telemetry collector | `otel-collector:4317` | | `lifecycleOperator.manager.env.functionRunnerImage` | specify image for deno task runtime | `ghcr.io/keptn/deno-runtime:v0.8.1` | -| `lifecycleOperator.manager.env.pythonRunnerImage` | specify image for python task runtime | `ghcr.io/keptn/python-runtime:v0.8.1` | +| `lifecycleOperator.manager.env.pythonRunnerImage` | specify image for python task runtime | `ghcr.io/keptn/python-runtime:v1.0.0` | | `lifecycleOperator.manager.image.repository` | specify registry for manager image | `ghcr.io/keptn/lifecycle-operator` | | `lifecycleOperator.manager.image.tag` | select tag for manager image | `v0.8.1` | | `lifecycleOperator.manager.imagePullPolicy` | specify pull policy for manager image | `Always` | diff --git a/helm/chart/values.yaml b/helm/chart/values.yaml index b5e388356b9..7f812dce5b1 100644 --- a/helm/chart/values.yaml +++ b/helm/chart/values.yaml @@ -78,7 +78,7 @@ lifecycleOperator: keptnWorkloadInstanceControllerLogLevel: "0" optionsControllerLogLevel: "0" otelCollectorUrl: otel-collector:4317 - pythonRunnerImage: ghcr.io/keptn/python-runtime:v0.8.1 + pythonRunnerImage: ghcr.io/keptn/python-runtime:v1.0.0 image: repository: ghcr.io/keptn/lifecycle-operator tag: v0.8.1 From cdc07ae2ef2e3164d5da74dd777a975e03ff8ee2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 10:43:58 +0200 Subject: [PATCH 22/78] deps: update ghcr.io/keptn/certificate-operator docker tag to v1.1.0 (#1964) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Moritz Wiesinger --- .github/scripts/.helm-tests/default/result.yaml | 2 +- .github/scripts/.helm-tests/default/values.yaml | 2 +- helm/chart/README.md | 2 +- helm/chart/values.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/.helm-tests/default/result.yaml b/.github/scripts/.helm-tests/default/result.yaml index 8dd2b698190..db048aaf6f4 100644 --- a/.github/scripts/.helm-tests/default/result.yaml +++ b/.github/scripts/.helm-tests/default/result.yaml @@ -7683,7 +7683,7 @@ spec: value: "true" - name: KUBERNETES_CLUSTER_DOMAIN value: cluster.local - image: ghcr.io/keptn/certificate-operator:v0.8.1 + image: ghcr.io/keptn/certificate-operator:v1.1.0 imagePullPolicy: Always name: manager resources: diff --git a/.github/scripts/.helm-tests/default/values.yaml b/.github/scripts/.helm-tests/default/values.yaml index 2d1698c2968..c52f0f45edc 100644 --- a/.github/scripts/.helm-tests/default/values.yaml +++ b/.github/scripts/.helm-tests/default/values.yaml @@ -15,7 +15,7 @@ certificateOperator: labelSelectorValue: "true" image: repository: ghcr.io/keptn/certificate-operator - tag: v0.8.1 + tag: v1.1.0 imagePullPolicy: Always livenessProbe: httpGet: diff --git a/helm/chart/README.md b/helm/chart/README.md index da585522026..56b09f53001 100644 --- a/helm/chart/README.md +++ b/helm/chart/README.md @@ -46,7 +46,7 @@ checks | ------------------------------------------------------ | ------------------------------------------------------------------------- | ------------------------------------ | | `certificateOperator.manager.containerSecurityContext` | Sets security context for the cert manager | | | `certificateOperator.manager.image.repository` | specify repo for manager image | `ghcr.io/keptn/certificate-operator` | -| `certificateOperator.manager.image.tag` | select tag for manager container | `v0.8.1` | +| `certificateOperator.manager.image.tag` | select tag for manager container | `v1.1.0` | | `certificateOperator.manager.imagePullPolicy` | select image pull policy for manager container | `Always` | | `certificateOperator.manager.env.labelSelectorKey` | specify the label selector to find resources to generate certificates for | `keptn.sh/inject-cert` | | `certificateOperator.manager.env.labelSelectorValue` | specify the value for the label selector | `true` | diff --git a/helm/chart/values.yaml b/helm/chart/values.yaml index 7f812dce5b1..a71e37455d6 100644 --- a/helm/chart/values.yaml +++ b/helm/chart/values.yaml @@ -15,7 +15,7 @@ certificateOperator: labelSelectorValue: "true" image: repository: ghcr.io/keptn/certificate-operator - tag: v0.8.1 + tag: v1.1.0 imagePullPolicy: Always livenessProbe: httpGet: From 6fe5192293175bf6946f74bba0e9057e704ab8c7 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 31 Aug 2023 01:50:45 -0700 Subject: [PATCH 23/78] docs: deployment flow architecture (#1470) Signed-off-by: Meg McRoberts Co-authored-by: Florian Bacher Co-authored-by: Giovanni Liva Co-authored-by: RealAnna <89971034+RealAnna@users.noreply.github.com> --- .../architecture/components/_index.md | 2 +- .../concepts/architecture/deployment-flow.md | 191 ++++++++++++++++++ .../concepts/architecture/working/_index.md | 2 +- 3 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 docs/content/en/docs/concepts/architecture/deployment-flow.md diff --git a/docs/content/en/docs/concepts/architecture/components/_index.md b/docs/content/en/docs/concepts/architecture/components/_index.md index dcb3f14462c..89afb27d3a8 100644 --- a/docs/content/en/docs/concepts/architecture/components/_index.md +++ b/docs/content/en/docs/concepts/architecture/components/_index.md @@ -2,7 +2,7 @@ title: Lifecycle Toolkit Components linktitle: Components description: Basic understanding of Keptn Lifecycle Toolkit Components -weight: 80 +weight: 20 cascade: --- diff --git a/docs/content/en/docs/concepts/architecture/deployment-flow.md b/docs/content/en/docs/concepts/architecture/deployment-flow.md new file mode 100644 index 00000000000..4fbe7753f93 --- /dev/null +++ b/docs/content/en/docs/concepts/architecture/deployment-flow.md @@ -0,0 +1,191 @@ +--- +title: Flow of deployment +linktitle: Flow of deployment +description: Understand the execution flow of a deployment +weight: 35 +--- + +The Keptn Lifecycle Toolkit (KLT) deploys a +[Kubernetes Workload](https://kubernetes.io/docs/concepts/workloads/) +by passing through a well-defined execution flow. + +The execution flow goes through six main phases: + +* Pre-deployments-tasks +* Pre-deployment-evaluation +* Deployment +* Post-deployment-tasks +* Post-deployment-evaluation +* Completed + +Within each phase, all tasks and evaluations for each phase +are executed in parallel. +They are not affected by the order +in which evaluations and tasks are listed in the +[KeptnApp](../../yaml-crd-ref/app.md/) +resource +or in the order of the pre/post-tasks and pre/post-evaluations +that are listed in the Workflow manifests. + +## Kubernetes and Cloud Events + +[Kubernetes Events](https://kubernetes.io/docs/reference/kubernetes-api/cluster-resources/event-v1/) +and [CloudEvents](https://cloudevents.io/) +are emitted at each phase +to provide additional Observability of the execution flow. + +The Keptn Lifecycle Toolkit implements a +[Permit Scheduler Plugin](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/#permit) +that blocks the binding of the pods to a node +until all the pre-conditions are fulfilled. + +A Kubernetes deployment is started by the deployment engine +that is implemented +(such as Flux or Argo) +or can be started by the following command: + +```shell +kubectl apply -f deployment.yaml +``` + +KLT does not care how a deployment manifest is applied to the cluster. +Both `kubectl` and Flux/Argo send the manifest to the Kubernetes API +so KLT does not differentiate the actual deployment options. +This also means that one Keptn Application +can include services that are deployed with different methods. + +The deployment is created +but the created pods are blocked and in pending state +until all the required pre-deployment tasks/evaluations +defined on either the `KeptnApp` or `KeptnWorkload` level pass. +Only then are the pods bound to a node and deployed. +If any pre-deployment evaluation or task fails, +the `KeptnApp` issues an appropriate `*Errored` event +and the deployment remains pending indefinitely, +until further changes or external intervention +If all evaluations and tasks in a phase are successful, +the `KeptnApp` issues the appropriate `*Succeeded` event +and initiates the next phase. + +## Summary of deployment flow + +To view these events on your cluster, execute: + +```shell +kubectl get events -n . +``` + +### Pre-deployment phase + +Pre-deployment tasks can perform any kind of action needed +to prepare for the deployment, including unit tests, load tests or other similar tests. + +```shell +AppPreDeployTasks + AppPreDeployTasksStarted + AppPreDeployTasksSucceeded OR AppPreDeployTasksErrored +``` + +### Pre-deployment evaluation phase + +Pre-deployment evaluation can be used to assert the status of the cluster +or of services the workload depends on, +to assure it is deployed only if the specified prerequisites are met. + +```shell +AppPreDeployEvaluations + AppPreDeployEvaluationsStarted + AppPreDeployEvaluationsSucceeded OR AppPreDeployEvaluationsErrored +``` + +### Deployment phase + +The `AppDeploy` phase basically covers +the entire deployment and check phase of the workloads. +The `KeptnApp` just observes whether +all pre and post-deployment tasks/evaluation are successful +and that the pods are deployed successfully. +When all activities are successful, +the `KeptnApp` issues the `AppDeploySucceeded` event +and continues to the next phase. +If any of these activities fail, +the `KeptnApp` issues the `AppDeployErrored` event +and terminates the deployment. + +```shell +AppDeploy + AppDeployStarted + WorkloadPreDeployTasks + WorkloadPreDeployTasksStarted + WorkloadPreDeployTasksSucceeded OR WorkloadPreDeployTasksErrored + WorkloadPreDeployEvaluations + WorkloadPreDeployEvaluationsStarted + WorkloadPreDeployEvaluationsSucceeded OR WorkloadPreDeployErrored + WorkloadDeploy + WorkloadDeployStarted + WorkloadDeploySucceeded OR WorkloadDeployErrored + WorkloadPostDeployTasks + WorkloadPostDeployTasksStarted + WorkloadPostDeployTasksSucceeded OR WorkloadPostDeployTasksErrored + WorkloadPostDeployEvaluations + WorkloadPostDeployEvaluationsStarted + WorkloadPostDeployEvaluationsSucceeded OR WorkloadPostDeployEvaluationsErrored + AppDeploySucceeded OR AppDeployErrored + ``` + +### Post-deployment phase + +The post-deployment phase is typically used +to run tests on the freshly deployed application, +such as gathering performance data. + +```shell +AppPostDeployTasks + AppPostDeployTasksStarted + AppPostDeployTasksSucceeded OR AppPostDeployTasksErrored +``` + +### Post-deployment evaluation phase + +The post-deployment evaluation can be used +to analyze the cluster/application status after the new workload is deployed. +The result of this phase does not revert or influence the deployment +but can be used by other external tools, for instance, to react to a failure. + +```shell +AppPostDeployEvaluations + AppPostDeployEvaluationsStarted + AppPostDeployEvaluationsSucceeded OR AppPostDeployEvaluationsErrored +``` + +### Completed phase + +```shell +Completed +``` + +## Events that are not part of the deployment flow + +Additional phases/states exist, +such as those that describe what happens when something fails. + +Whenever something in the system happens (we create a new resource, etc.) +a Kubernetes event is generated. +The following events are defined as part of the Keptn Lifecycle Toolkit +but they are not part of the deployment flow. +These include: + +```shell +CreateEvaluation +ReconcileEvaluation +ReconcileTask +CreateTask +CreateApp +CreateAppVersion +CreateWorkload +CreateWorkloadInstance +Completed +Deprecated +WorkloadDeployReconcile +WorkloadDeployReconcileErrored +``` diff --git a/docs/content/en/docs/concepts/architecture/working/_index.md b/docs/content/en/docs/concepts/architecture/working/_index.md index b292d8ecfcc..f7411eba1e1 100644 --- a/docs/content/en/docs/concepts/architecture/working/_index.md +++ b/docs/content/en/docs/concepts/architecture/working/_index.md @@ -2,7 +2,7 @@ title: Lifecycle Toolkit Working linktitle: How it works description: Understand How Keptn Lifecycle Toolkit Works -weight: 80 +weight: 30 cascade: --- From 124e2433888e76277fca640ba56f5a19bbebdfbe Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 31 Aug 2023 02:11:20 -0700 Subject: [PATCH 24/78] docs: update the doc source file structure page (#1984) Signed-off-by: Meg McRoberts --- .../docs/source-file-structure/_index.md | 163 ++++++++++++++---- 1 file changed, 133 insertions(+), 30 deletions(-) diff --git a/docs/content/en/contribute/docs/source-file-structure/_index.md b/docs/content/en/contribute/docs/source-file-structure/_index.md index 3ae25f4b08f..4b26ff357c3 100644 --- a/docs/content/en/contribute/docs/source-file-structure/_index.md +++ b/docs/content/en/contribute/docs/source-file-structure/_index.md @@ -4,59 +4,162 @@ description: Structure source files with Metadata weight: 400 --- -The source files for the [Keptn Lifecycle Toolkit](https://lifecycle.keptn.sh/docs) are stored under +The source files for the KLT documentation +are stored in the same github repository as the source code. +This page explains how the documentation source files are organized. + +> **Note** The structure of the documentation + and the source code for the documentation is evolving. + You may find small discrepencies between + what is documented here and what is currently implemented. + +## Primary documentation set + +The source for the +[Keptn Lifecycle Toolkit](https://lifecycle.keptn.sh/docs) +documentation is stored under the *docs/content/en/docs* directory in the repository. -The build strategy is to build everything except for files that are explicitly ignored -and files that include the `hidden: true` string in the file's metadata section -The order in which the files are displayed is determined by the value of the `weight` field -in the metadata section of *_index.md* and *index.md* files located throughout the directory tree. +The subdirectories correspond to the contents listed in the right frame. +In the order they appear in the rendered docs, the subdirectories are: + +* **intro-klt** (Introduction to the Keptn Lifecycle Toolkit): + A brief overview of KLT, its features and use cases, and its history +* **getting-started** (Getting started): + A hands-on exercise that demonstrates the capabilities of KLT +* **tutorials** (Tutorials): + Additional hands-on exercises to introduce new users to KLT +* **install** (Installation and Upgrade): + Requirements and instructions for installing and enabling KLT +* **operate** (Operate KLT): + Guides about running and managing the KLT cluster +* **implementing** (Implementing Keptn applications): + This is currently a catch-all section + for guides and how-to material about implementing Keptn features. + It needs to be restructured and subdivided +* **troubleshooting.md** (Troubleshooting Guide): + How to diagnose and solve common problems with KLT +* **architecture** (Architecture): + Information about how KLT actually works +* **crd-ref** (API Reference): + Comprehensive information about all the APIs that define the KLT CRDs. + This section is auto-generated from source code + and should never be modified in the *docs* directory. + The source for the authored text can be modified + in the source code files for the APIs +* **yaml-crd-ref** (CRD Reference): + Reference pages for the CRs that users must populate. + This is a subset of the CRDs documented in the *API Reference* section +* **migrate** (Migrating to the Keptn Lifecycle Toolkit): + Information to help users who are migrating to KLT + from Keptn V1 + +## Contributing guide + +The source for the +[Contributing to Keptn](https://lifecycle.keptn.sh/contribute/) +guides +(which are accessed from the **Contributing** tab on the documentation page) +is stored under the *docs/content/en/contribute* directory. + +The subdirectories correspond to the contents listed in the right frame. +In the order they appear, the subdirectories are: + +* **general** (General information about contributing): + Information that is applicable to all contributors, + whether contributing software or documentation + +* **software** (Software contributions): + Information that is specific to software contributions + +* **docs** (Documentation contributions): + Information that is specific to documentation contributions. + +We also have *CONTRIBUTING.md* files located in the +home directory of the *lifecycle-toolkit* repository +(general and software development information) +and in the *lifecycle-toolkit/docs* directory +(documentation development information only). +These are the traditional locations for contributing information +but the amount of content we have was making them unwieldy +so we are in the process of moving most content from these files +into the *Contributing guide*, +leaving links to the various sections in the *CONTRIBUTING.md* guides. + +## Build strategy + +All files in the directories are built +except for files that are explicitly `ignored` +and files that include the `hidden: true` string in the file's metadata section. + +The order in which the files are displayed +is determined by the value of the `weight` field +in the metadata section of *_index.md*, *index.md*, +and *topic.md* files that are located throughout the directory tree. The metadata section of these files contains at least three fields. -As an example, the metadata section for the *Concepts* section of the documentation includes the following fields: +As an example, the metadata section for the *Installation and upgrade* section +of the documentation includes the following fields: ```yaml -title: Concepts -description: Learn about underlying concepts of the keptn lifecycle toolkit. -layout: quickstart -weight: 50 +--- +title: Installation and Upgrade +description: Learn how to install and upgrade the Keptn Lifecycle Toolkit +weight: 30 +--- ``` The meaning of these fields is: * **title** -- title displayed for the section or file * **description** -- subtext displayed for the section or subsection -* **icon** -- optional field specifying an icon associated with the section -* **layout** -- layout template to be used for rendering the section -* **weight** -- order in which section or subsection is displayed relative to other sections and - subsections at the same level. +* **weight** -- order in which section or subsection is displayed + relative to other sections and subsections at the same level. -In this case, the weight of 50 means that this section is displayed -after sections that have weights of 49 and lower -and before sections that have weights of 51 and higher. +In this case, the weight of 30 means that this section is displayed +after sections that have weights of 29 and lower +and before sections that have weights of 31 and higher. If two files have the same weight, their order is determined alphabetically, but this is a bad practice. +When you create a new section or a new page, +be sure to check the weight of the files +that immediately precede and follow this file +to be sure that you are not assigning the same weight to your new file. -Some other fields are sometimes used in the metadata. +The system for assigning weights for the docs landing page +allows for maximum flexibility as we create new sections: -### Top level structure +* General introductory material uses weight values under 100. +* Guide material about using specific KLT features + use weight value of 2**. +* Reference material uses weight values of 5**. +* Other documents use weight values of 7**. -The current tools do not support versioning. -To work around this limitation, the docs are arranged with some general topics that generally apply to all releases and -then subsections for each release that is currently supported. +Some other fields are sometimes used in the metadata, including: -The system for assigning weights for the docs landing page is: +* **icon** -- optional field specifying an icon associated with the section +* **layout** -- layout template to be used for rendering the section +* **hidden** -- if set to `true`, this page is not included in the + documentation set that is built +* **hidechildren** -- if set to `true`, + the listing in the right margin of subsections of this page is omitted. + In most cases, that listing is a convenient navigational aid for the reader + but it can be omitted in special cases. -* General introductory material uses weight values under 100. -* Sections for individual releases use weight values of 9**. -* Sections for general but advanced info use weight value of 1***. +You can use these fields if you need them +but check the rendering carefully +to ensure that they are playing out as they should. -### Subdirectory structure +## Subdirectory structure Each subdirectory contains topical subdirectories for each chapter in that section. -Each topical subdirectory contains: +Each topical subdirectory may contain: -* An *index.md* file that has the metadata discussed above plus the text for the section +* An *_index.md* or *index.md* file that has the metadata discussed above + plus the text for the section. + If this is a subdirectory that contains subdirectories for other pages, + the *_index.md* or *index.md* file + contains introductory content for the section. * An *assets* subdirectory where graphical files for that topic are stored. -* No *assets* subdirectory is present if the topic has no graphics. + No *assets* subdirectory is present if the topic has no graphics. From 30393c6e6d1127cde12812810afc1bb8f97a1498 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 31 Aug 2023 02:23:21 -0700 Subject: [PATCH 25/78] docs: git contributing guide (#1892) Signed-off-by: Meg McRoberts --- CONTRIBUTING.md | 88 +------- docs/CONTRIBUTING.md | 194 +---------------- .../en/contribute/general/git/_index.md | 22 ++ .../general/git/branch-create/_index.md | 52 +++++ .../general/git/fork-clone/_index.md | 59 ++++++ .../general/git/pr-create/_index.md | 200 ++++++++++++++++++ .../contribute/general/git/review/_index.md | 71 +++++++ 7 files changed, 407 insertions(+), 279 deletions(-) create mode 100644 docs/content/en/contribute/general/git/_index.md create mode 100644 docs/content/en/contribute/general/git/branch-create/_index.md create mode 100644 docs/content/en/contribute/general/git/fork-clone/_index.md create mode 100644 docs/content/en/contribute/general/git/pr-create/_index.md create mode 100644 docs/content/en/contribute/general/git/review/_index.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0885f0c93be..db99591f57a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,98 +55,14 @@ Please check [Related Technologies](docs/content/en/contribute/general/technolog Please check [Linter Requirements](docs/content/en/contribute/docs/linter-requirements/_index.md). -## Submit a Pull Request 🚀 +## Working with git -At this point, you should switch back to the `main` branch in your repository, -and make sure it is up to date with `main` branch of Keptn Lifecycle Toolkit: - -```bash -git remote add upstream https://github.com/keptn/lifecycle-toolkit.git -git checkout main -git pull upstream main -``` - -Then update your feature branch from your local copy of `main` and push it: - -```bash -git checkout feature/123/foo -git rebase main -git push --set-upstream origin feature/123/foo -``` - -> Note: -All PRs must include a commit message with a description of the changes made! - -Make sure you **sign off your commits**. -To do this automatically check [this](https://github.com/keptn/lifecycle-toolkit/blob/main/CONTRIBUTING.md#auto-signoff-commit-messages). -Finally, go to GitHub and create a Pull Request. -There should be a PR template already prepared for you. -If not, you will find it at `.github/pull_request_template.md`. -Please describe what this PR is about and add a link to relevant GitHub issues. -If you changed something that is visible to the user, please add a screenshot. -Please follow the -[conventional commit guidelines](https://www.conventionalcommits.org/en/v1.0.0/) for your PR title. - -If you only have one commit in your PR, please follow the guidelines for the message -of that single commit, otherwise the PR title is enough. -You can find a list of all possible feature types [here](#commit-types). - -An example for a pull request title would be: - -```bash -feat(api): New endpoint for feature X (#1234) -``` - -If you have **breaking changes** in your PR, it is important to note them in the PR -description but also in the merge commit for that PR. - -When pressing "squash and merge", you have the option to fill out the commit message. -Please use that feature to add the breaking changes according to the -[conventional commit guidelines](https://www.conventionalcommits.org/en/v1.0.0/). -Also, please remove the PR number at the end and just add the issue number. - -An example for a PR with breaking changes and the according merge commit: - -```bash -feat(bridge): New button that breaks other things (#345) - -BREAKING CHANGE: The new button added with #345 introduces new functionality that is not compatible with the previous type of sent events. -``` - -If your breaking change can be explained in a single line you can also use this form: - -```bash -feat(bridge)!: New button that breaks other things (#345) -``` - -Following those guidelines helps us create automated releases where the commit -and PR messages are directly used in the changelog. - -In addition, please always ask yourself the following questions: - -**Based on the linked issue,** -**what changes within the PR would you expect as a reviewer?** +See [Working with Git](docs/content/en/contribute/general/git) Your PR will usually be reviewed by the Keptn Lifecycle Toolkit team within a couple of days, but feel free to let us know about your PR [via Slack](https://cloud-native.slack.com/channels/keptn-lifecycle-toolkit-dev). -### Commit Types - -**Type** can be: - -* `feat`: a new feature -* `fix`: a bug fix -* `build`: changes that affect the build system or external dependencies -* `chore`: other changes that don't modify source or test files -* `ci`: changes to our CI configuration files and scripts -* `docs`: documentation only changes -* `perf`: a code change that improves performance -* `refactor`: a code change that neither fixes a bug nor adds a feature -* `revert`: reverts a previous commit -* `style`: changes that do not affect the meaning of the code -* `test`: adding missing tests or correcting existing tests - ## Developer Certification of Origin (DCO) All commits must be accompanied by a DCO sign-off. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index add3a0b676f..78327e3b071 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -35,199 +35,7 @@ Please check [Building the Documentation Locally](content/en/contribute/docs/loc The documentation source is stored on github.com and you use the standard github facilities to modify it. -The following notes are provided for people who need a little help. - -### Fork and clone the repository - -Perform the following steps to create a copy of this repository on your local machine: - -1. Fork the Keptn repository: - - * Log into GitHub (or create a GitHub account and then log into it). - * Go to the [Keptn lifecycle-toolkit repository](https://github.com/keptn/lifecycle-toolkit). - * Click the **Fork** button at the top of the screen. - * Choose the user for the fork from the options you are given, - usually your GitHub ID. - - A copy of this repository is now available in your GitHub account. - -2. Get the string to use when cloning your fork: - - * Click the green "Code" button on the UI page. - * Select the protocol to use for this clone (either HTTPS or SSH). - * A box is displayed that gives the URL for the selected protocol. - Click the icon at the right end of that box to copy that URL. - -3. Run the **git clone** command from the shell of a local directory - to clone the forked repository to a directory on your local machine, - pasting in the URl you saved in the previous step: - - ```console - git clone https://github.com//lifecycle-toolkit - ``` - - or - - ```console - git clone git@github.com:/lifecycle-toolkit.git - ``` - - Where <*UserName*> is your GitHub username. - The lifecycle-toolkit directory is now available in the local directory. - -4. Associate your clone with `upstream`. - To do this, use the same string you used to clone your fork. - - * Be sure that you are in the root folder of the project - and run *git status* to confirm that you are on the `main` branch. - * Type the following to associate `upstream` with your clone, - pasting in the string for the main repo that you copied above.: - - ```console - git remote add upstream https://github.com/keptn/lifecycle-toolkit.git - ``` - -### Create a new branch and make your changes - -Now you have your upstream setup in your local machine. -You need to create a local branch where you will make your changes. -Be sure that your branch is based on and sync'ed with `main`, -unless you intend to create a derivative PR: - -The following sequence of commands does that: - -```console -git checkout main -git pull upstream main -git push origin main -git checkout -b -``` - -Now you can make your changes, build them locally to check formatting, -then create a PR to add these changes to the documentation set - -### Submitting new content through a pull request - -If you have forked and cloned the repository, -you can modify the documentation or add new material -by editing the markdown file(s) in the local clone of your fork -and then submitting a *pull request (PR)*. - -Note that you can also modify the source using the GitHub editor. -This is very useful when you want to fix a typo or make a small editorial change -but, if you are doing significant writing, -it is generally better to work on files in your local clone. - -1. Execute the following and check the output to ensure that your branch is set up correctly: - - ```console - git status - ``` - -1. Do the writing you want to do in your local branch, checking the formatted version at `localhost:1314/docs-dev`. - -1. When you have completed the writing you want to do, close all files in your branch and run `git status` to confirm - that it correctly reflects the files you have modified, added, and deleted. - -1. Add and commit your changes. - Here, we commit all modified files but you can specify individual files to the - `git add` command. -The `git commit -s` command commits the files and signs that you are contributing this intellectual property to the -Keptn project. - - ```console - git add . - git commit -s - ``` - - Use vi commands to add a description of the PR - (should be 80 characters or less) to the commit. - The title text should be prefixed with `docs:` - to conform to our semantic commit scheme. - This title is displayed as the title of the PR in listings. - You can add multiple lines explaining the PR here but, in general, - it is better to only supply the PR title here; - you can add more information and edit the PR title - when you create the PR on the GitHub UI page. - -1. Push your branch to github: - * If you cloned your fork to use SSH, the command is: - - ```console - git push --set-upstream origin - ``` - - > **Note** - You can just issue the `git push` command. - Git responds with an error message that gives you the full command line to use; you can copy this command and - paste it into your shell to push the content. - - * If you cloned your fork to use HTTP, the command is: - - ```console - git push - ``` - -1. Create the PR by going to the [lifecycle-toolkit](https://github.com/keptn/lifecycle-toolkit) GitHub repository. - * You should see a yellow shaded area that says something like: - - ```console - : had recent pushes less than a minute ago - ``` - - * Click on the button in that shaded area marked: - - ```console - Compare & pull request - ``` - - * Check that the title of the PR is correct; click the "Edit" button to modify it. -Add "WIP" (Work in Progress) or "Draft" to the title if the PR is not yet ready for general review. - * Add a full description of the work in the PR, including any notes for reviewers, a reference to the relevant GitHub - issue (if any), and tags for specific people (if any) who may be interested in this PR. - * Carefully review the changes GitHub displays for this PR to ensure that they are what you want. - * Click the green "Create pull request" button to create the PR. - You may want to record the PR number somewhere for future reference although you can always find the PR in the - GitHub lists of open and closed PRs. - * GitHub automatically populates the "Reviewers" block. - * If this PR is not ready for review, click the "Still in progress? - Convert to draft" string under the list of - reviewers. - People can still review the content but can not merge the PR until you remove the "Draft" status. - * The block of the PR that reports on checks will include the following item: - - ```console - This pull request is still a work in progress - Draft pull requests cannot be merged. - ``` - - * When the PR is ready to be reviewed, approved, and merged, click the "Ready to review" button to remove the "Draft" - status. - Then, if you added "WIP" or "Draft" to the PR title, remove it now. - -1. Your PR should be reviewed within a few days. - Watch for any comments that may be added by reviewers and implement or - respond to the recommended changes as soon as possible. - - * If a reviewer makes a GitHub suggestion and you agree with the change, just click "Accept this change" to create a - commit for that modification. - You can also group several suggestions into a single commit using the GitHub tools. - * You can make other changes using the GitHub editor or you can work in your local branch to make modifications. - - * If changes have been made using the GitHub editor, you will need to do a `git pull` request to pull those - commits back to your local branch before you push the new changes. - * After modifying the local source, issue the `git add .`, `git commit`, and `git push` commands to push your - changes to github. - -1. When your PR has the appropriate approvals, it will be merged and the revised content should be published on the - website within a few minutes. - -1. When your PR has been approved and merged, - you can delete your local branch with the following command: - - ```console - git branch -d - ``` +Please check [Working with Git](content/en/contribute/general/git/_index.md). ## Developer Certification of Origin (DCO) diff --git a/docs/content/en/contribute/general/git/_index.md b/docs/content/en/contribute/general/git/_index.md new file mode 100644 index 00000000000..7e03ee76e4d --- /dev/null +++ b/docs/content/en/contribute/general/git/_index.md @@ -0,0 +1,22 @@ +--- +title: Working with Git +description: Using Git to contribute software and docs +weight: 200 +--- + +Keptn source for software and documentation is stored in the +[Keptn lifecycle-toolkit repository](https://github.com/keptn/lifecycle-toolkit). +Contributions are made using standard Git practices. +This section describes the basic steps required to contribute using Git +and summarizes some standard practices we use with Keptn. + +You can also modify the source using the GitHub editor. +This is very useful when you want to fix a typo +or make some other small change +although be sure so include the DCO signoff. + +If you are doing significant work, +you should fork and clone your own copy of the repository, +make your changes in a local branch, +then push those changes to github where they can be reviewed +and ultimately merged into the product. diff --git a/docs/content/en/contribute/general/git/branch-create/_index.md b/docs/content/en/contribute/general/git/branch-create/_index.md new file mode 100644 index 00000000000..999664cae65 --- /dev/null +++ b/docs/content/en/contribute/general/git/branch-create/_index.md @@ -0,0 +1,52 @@ +--- +title: Create local branch +description: How to create a local branch and make modifications in it +weight: 30 +--- + +After you +[fork and clone](../fork-clone) +the Keptn repository and set `upstream` in your local machine, +you need to create a local branch where you will make your changes. + +## Create a new branch and make your changes + +Be sure that your branch is based on and sync'ed with `main`, +unless you intend to create a derivative PR. +The following sequence of commands does that: + +```console +git checkout main +git pull upstream main +git push origin main +git checkout -b +``` + +Execute the following and check the output +to ensure that your branch is set up correctly: + +```console +git status +``` + +Now you can make your changes, build and test them locally, +then create a PR to add these changes to the documentation set. + +* For documentation changes: + * Do the writing you want to do in your local branch + * Check the formatted version in your IDE + or at `localhost:1314/docs-dev` + to ensure that it is rendering correctly + and that all links are valid.. + See [Build Documentation Locally](../../../docs/local-building) + for more information. + * Run `make markdownlint-fix` to check and fix the markdown code. + +* For software changes: + * Create the new code in your local branch. + * Create and run unit tests for your new code. + * Run other appropriate test to ensure that your code works correctly. + +When you have completed the checking and testing of your work, +it is time to push your changes and create a PR that can be reviewed. +See [Create PR](../pr-create) for details. diff --git a/docs/content/en/contribute/general/git/fork-clone/_index.md b/docs/content/en/contribute/general/git/fork-clone/_index.md new file mode 100644 index 00000000000..3a6e1b11d1f --- /dev/null +++ b/docs/content/en/contribute/general/git/fork-clone/_index.md @@ -0,0 +1,59 @@ +--- +title: Fork and clone the repository +description: How to get a local version of the Keptn repository +weight: 20 +--- + +Perform the following steps to create a copy +of the Keptn repository on your local machine: + +1. Fork the Keptn repository: + + * Log into GitHub (or create a GitHub account and then log into it). + * Go to the [Keptn lifecycle-toolkit repository](https://github.com/keptn/lifecycle-toolkit). + * Click the **Fork** button at the top of the screen. + * Choose the user for the fork from the options you are given, + usually your GitHub ID. + + A copy of this repository is now available in your GitHub account. + +2. Get the string to use when cloning your fork: + + * Click the green "Code" button on the UI page. + * Select the protocol to use for this clone (either HTTPS or SSH). + * A box is displayed that gives the URL for the selected protocol. + Click the icon at the right end of that box to copy that URL. + +3. Run the **git clone** command from the shell of a local directory + to clone the forked repository to a directory on your local machine, + pasting in the URl you saved in the previous step. + + For example, if you are using HTTPS: + + ```console + git clone https://github.com//lifecycle-toolkit + ``` + + Or if you are using SSH: + + ```console + git clone git@github.com:/lifecycle-toolkit.git + ``` + + Where <*UserName*> is your GitHub username. + The lifecycle-toolkit directory is now available in the local directory. + +4. Associate your clone with `upstream`. + + * In a shell, go to the root folder of the project + and run *git status* to confirm that you are on the `main` branch. + * Type the following to associate `upstream` with your clone, + pasting in the string for the main repo that you copied above.: + + ```console + git remote add upstream https://github.com/keptn/lifecycle-toolkit.git + ``` + +You are now ready to +[create a local branch](../branch-create) +and begin to create the software or documentation modifications. diff --git a/docs/content/en/contribute/general/git/pr-create/_index.md b/docs/content/en/contribute/general/git/pr-create/_index.md new file mode 100644 index 00000000000..75e6a9dee7f --- /dev/null +++ b/docs/content/en/contribute/general/git/pr-create/_index.md @@ -0,0 +1,200 @@ +--- +title: Create PR +description: Create and submit a PR with your changes +weight: 40 +--- + +When you have completed the checking and testing of your work +on your local branch as described in +[Create local branch](../branch-create), +it is time to push your changes and create a PR that can be reviewed. +This is a two-step process: + +1. [Push new content from your local branch](#push-new-content-from-your-local-branch) +1. [Create the PR on the github web site](#create-pr-on-the-github-web-site) + +## Push new content from your local branch + +The steps to push your new content from your local branch +to the repository are: + +1. When you have completed the writing you want to do, + close all files in your branch and run `git status` to confirm + that it correctly reflects the files you have modified, added, and deleted + and does not include any files that you do not want to push. + +1. Switch back to the `main` branch in your repository, + and ensure that it is up to date + with the `main` branch of the Keptn Lifecycle Toolkit: + + ```bash + git remote add upstream https://github.com/keptn/lifecycle-toolkit.git + git checkout main + git pull upstream main + ``` + + Then update your feature branch from your local copy of `main` and push it: + + ```bash + git checkout feature/123/foo + git rebase main + git push --set-upstream origin feature/123/foo + ``` + +1. Add and commit your changes. + The `git commit -s` command commits the files + and signs that you are contributing this intellectual property + to the Keptn project. + See the DCO docs for more information. + Here, we commit all modified files but you can specify individual files + to the `git add` command. + + ```console + git add . + git commit -s + ``` + + Use vi commands to add a description of the PR + (should be 80 characters or less) to the commit. + The title text should be prefixed with an appropriate + [commit type](#commit-types) + to conform to our semantic commit scheme. + This title is displayed as the title of the PR in listings. + + You can add multiple lines explaining the PR here but, in general, + it is better to only supply the PR title here; + you can add more information and edit the PR title + when you create the PR on the GitHub UI page. + +1. Push your branch to github. + If you cloned your fork to use SSH, the command is: + + ```console + git push --set-upstream origin + ``` + + > **Note** + You can just issue the `git push` command. + Git responds with an error message + that gives you the full command line to use; + you can copy this command and paste it into your shell to push the content. + +## Create PR on the github web site + +To create the actual PR that can be reviewed +and eventually merged, go to the + page. +You should see a yellow box that identifies your recent pushes. +Click the `Compare & pull request` button in that box +to open a PR template that you can populate. + +> **Note** + The PR template can also be found at `.github/pull_request_template.md`. + +You need to provide the following information: + +* Title for the PR. + Follow the + [conventional commit guidelines](https://www.conventionalcommits.org/en/v1.0.0/) + for your PR title. + * Title should begin with an appropriate + [commit type](#commit-types).feature type. + * The first word after the feature type should be lowercase. + + An example for a pull request title is: + + ```bash + feat(api): new endpoint for feature X + ``` + +* Full description of what the PR is about. + + * Link to relevant GitHub issue(s). + Use the phrase `Closes ` for this link; + is ensures that the issue is closed when this PR is merged. + this PR does not completely satisfy the issue, + e some other phrasing for the link to the issue. + * Describe what this PR does, + including related work that will be in other PRs. + * If you changed something that is visible to the user, + add a screenshot. + * Describe tests that are included or were run to test this PR. + * Anything else that will help reviewers understand + the scope and purpose of this PR. + +* If you have **breaking changes** in your PR, + it is important to note them in both the PR description + and in the merge commit for that PR. + + When pressing "squash and merge", + you have the option to fill out the commit message. + Please use that feature to add the breaking changes according to the + [conventional commit guidelines](https://www.conventionalcommits.org/en/v1.0.0/). + Also, please remove the PR number at the end and just add the issue number. + + An example for a PR with breaking changes and the according merge commit: + + ```bash + feat(bridge): New button that breaks other things (#345) + + BREAKING CHANGE: The new button added with #345 introduces + new functionality that is not compatible with the previous + type of sent events. + ``` + + If your breaking change can be explained in a single line, + you can also use this form: + + ```bash + feat(bridge)!: New button that breaks other things (#345) + ``` + + Following these guidelines helps us create automated releases + where the commit and PR messages are directly used in the changelog. + +When you have filled in the PR template, +you should also quickly scroll down to see the changes +that are being made with this commit +to ensure that this PR contains what you want reviewed. + +When you are satisfied that your PR is ready for review, +click the `Create pull request` button. + +### Commit Types + +**Type** can be: + +* `feat`: a new feature +* `fix`: a bug fix +* `build`: changes that affect the build system or external dependencies +* `chore`: other changes that don't modify source or test files +* `ci`: changes to our CI configuration files and scripts +* `docs`: documentation only changes +* `perf`: a code change that improves performance +* `refactor`: a code change that neither fixes a bug nor adds a feature +* `revert`: reverts a previous commit +* `style`: changes that do not affect the meaning of the code +* `test`: adding missing tests or correcting existing tests + +## Check PR build + +As soon as you create the PR, +a number of tests and checks are run. +Be sure to check the results immediately +and fix any problems that are found. +Click the `Details` link on the line for each each failed test +to get details about the errors found. + +The most common errors for documentation PRs are: + +* Markdown errors found by `markdownlint`. + Most of these can be fixed + by running `make markdownlint-fix` on your local branch + then pushes the changes. +* Cross-reference errors. + To quickly find the errors in the report, + search for the `dead` string on the `Details` page. + +When you have resolved all build errors +you move into the +[PR review process](../review). diff --git a/docs/content/en/contribute/general/git/review/_index.md b/docs/content/en/contribute/general/git/review/_index.md new file mode 100644 index 00000000000..39e12197a8b --- /dev/null +++ b/docs/content/en/contribute/general/git/review/_index.md @@ -0,0 +1,71 @@ +--- +title: PR review process +description: How to navigate the review process +weight: 50 +--- + +After you +[create your PR](../pr-create), +your PR must be approved and then merged +before it becomes part of the Keptn product. +This page discusses what you need to do during the review phase. + +GitHub automatically assigns reviewers to your PR. +You can also tag oher people in the description or comments. + +Your PR will usually be reviewed within a couple of days, +but feel free to let us know about your PR +[via Slack](https://cloud-native.slack.com/channels/keptn-lifecycle-toolkit-dev). + +You may want to record the PR number somewhere for future reference +although you can always find the PR in the GitHub lists of open and closed PRs. + +## Draft (WIP) PRs + +You may want to create a PR with work that is not ready for final review. +This happens when you want people to provide feedback on some of the work +before you finish the PR +or to protect the work you have done. + +If this PR is not ready for review, click the "Still in progress? +s Convert to draft" string under the list of reviewers. +People can review the content but can not merge the PR +until you remove the "Draft" status. +The block of the PR that reports on checks will include the following item: + +```console +This pull request is still a work in progress +Draft pull requests cannot be merged. +``` + +When the PR is ready to be reviewed, approved, and merged, +click the "Ready to review" button to remove the "Draft" status. +If you added "WIP" or "Draft" to the PR title, remove it now. + +## Respond to review comments and suggestions + +Watch for any comments that may be added by reviewers and implement or +respond to the recommended changes as soon as possible. +You should also check the build reports daily +to ensure that all tests are still passing. + +* If a reviewer makes a GitHub suggestion and you agree with the change, + click "Accept this change" to create a commit for that modification. + Remember to include the DCO sign-off information in the commit message. + +* You can make other changes using the GitHub editor. + +* You can also work in your local branch to make modifications. + However, if the PR has been modified on github, + be sure to `pull` the changes back to your local branch + before working in your local branch. + +When your PR has the appropriate approvals, +it will be merged and the revised content should be published on the +website (as part of the `development` release) +within a few minutes. +You can now delete your local branch with the following command: + +```console +git branch -d +``` From c6958fd15b84813167d231b745d53748d812e69c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:49:45 +0200 Subject: [PATCH 26/78] deps: update ghcr.io/keptn/deno-runtime docker tag to v1 (#1988) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Florian Bacher Co-authored-by: Moritz Wiesinger --- .github/scripts/.helm-tests/default/result.yaml | 2 +- .github/scripts/.helm-tests/default/values.yaml | 2 +- helm/chart/README.md | 2 +- helm/chart/values.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/.helm-tests/default/result.yaml b/.github/scripts/.helm-tests/default/result.yaml index db048aaf6f4..366414eaf73 100644 --- a/.github/scripts/.helm-tests/default/result.yaml +++ b/.github/scripts/.helm-tests/default/result.yaml @@ -7769,7 +7769,7 @@ spec: fieldRef: fieldPath: metadata.name - name: FUNCTION_RUNNER_IMAGE - value: "ghcr.io/keptn/functions-runtime:v0.8.1" + value: "ghcr.io/keptn/deno-runtime:v1.0.1" - name: PYTHON_RUNNER_IMAGE value: "ghcr.io/keptn/python-runtime:v1.0.0" - name: OTEL_COLLECTOR_URL diff --git a/.github/scripts/.helm-tests/default/values.yaml b/.github/scripts/.helm-tests/default/values.yaml index c52f0f45edc..7fd975846fb 100644 --- a/.github/scripts/.helm-tests/default/values.yaml +++ b/.github/scripts/.helm-tests/default/values.yaml @@ -67,7 +67,7 @@ lifecycleOperator: seccompProfile: type: RuntimeDefault env: - functionRunnerImage: ghcr.io/keptn/functions-runtime:v0.8.1 + functionRunnerImage: ghcr.io/keptn/deno-runtime:v1.0.1 keptnAppControllerLogLevel: "0" keptnAppCreationRequestControllerLogLevel: "0" keptnAppVersionControllerLogLevel: "0" diff --git a/helm/chart/README.md b/helm/chart/README.md index 56b09f53001..28be306b4c7 100644 --- a/helm/chart/README.md +++ b/helm/chart/README.md @@ -91,7 +91,7 @@ checks | `lifecycleOperator.manager.env.keptnWorkloadInstanceControllerLogLevel` | sets the log level of Keptn WorkloadInstance Controller | `0` | | `lifecycleOperator.manager.env.optionsControllerLogLevel` | sets the log level of Keptn Options Controller | `0` | | `lifecycleOperator.manager.env.otelCollectorUrl` | Sets the URL for the open telemetry collector | `otel-collector:4317` | -| `lifecycleOperator.manager.env.functionRunnerImage` | specify image for deno task runtime | `ghcr.io/keptn/deno-runtime:v0.8.1` | +| `lifecycleOperator.manager.env.functionRunnerImage` | specify image for deno task runtime | `ghcr.io/keptn/deno-runtime:v1.0.1` | | `lifecycleOperator.manager.env.pythonRunnerImage` | specify image for python task runtime | `ghcr.io/keptn/python-runtime:v1.0.0` | | `lifecycleOperator.manager.image.repository` | specify registry for manager image | `ghcr.io/keptn/lifecycle-operator` | | `lifecycleOperator.manager.image.tag` | select tag for manager image | `v0.8.1` | diff --git a/helm/chart/values.yaml b/helm/chart/values.yaml index a71e37455d6..7fd975846fb 100644 --- a/helm/chart/values.yaml +++ b/helm/chart/values.yaml @@ -67,7 +67,7 @@ lifecycleOperator: seccompProfile: type: RuntimeDefault env: - functionRunnerImage: ghcr.io/keptn/deno-runtime:v0.8.1 + functionRunnerImage: ghcr.io/keptn/deno-runtime:v1.0.1 keptnAppControllerLogLevel: "0" keptnAppCreationRequestControllerLogLevel: "0" keptnAppVersionControllerLogLevel: "0" From 95e0953c2c95ac22fe62d592c4ff6dd186e6a260 Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Fri, 1 Sep 2023 10:51:09 +0200 Subject: [PATCH 27/78] feat(metrics-operator): convert corner cases in SLO convertor (#1999) Signed-off-by: odubajDT Signed-off-by: odubajDT <93584209+odubajDT@users.noreply.github.com> Co-authored-by: Florian Bacher --- metrics-operator/converter/common.go | 49 + metrics-operator/converter/common_test.go | 21 + metrics-operator/converter/slo_converter.go | 324 +++- .../converter/slo_converter_test.go | 1602 +++++++++++++++-- 4 files changed, 1780 insertions(+), 216 deletions(-) create mode 100644 metrics-operator/converter/common.go create mode 100644 metrics-operator/converter/common_test.go diff --git a/metrics-operator/converter/common.go b/metrics-operator/converter/common.go new file mode 100644 index 00000000000..27cb2c3ba2c --- /dev/null +++ b/metrics-operator/converter/common.go @@ -0,0 +1,49 @@ +package converter + +import ( + "fmt" + "math" + + "gopkg.in/inf.v0" +) + +func NewInvalidOperatorErr(msg string) error { + return fmt.Errorf("invalid operator: '%s'", msg) +} + +func NewUnconvertableValueErr(msg string) error { + return fmt.Errorf("unable to convert value '%s' to decimal", msg) +} + +func NewUnsupportedIntervalCombinationErr(op []string) error { + return fmt.Errorf("unsupported interval combination '%v'", op) +} + +func NewEmptyOperatorErr(op []string) error { + return fmt.Errorf("empty operators: '%v'", op) +} + +func NewUnconvertableOperatorCombinationErr(op1, op2 string) error { + return fmt.Errorf("unconvertable combination of operators: '%s', '%s'", op1, op2) +} + +const MaxInt = math.MaxInt +const MinInt = -MaxInt - 1 + +type Operator struct { + Value *inf.Dec + Operation string +} + +type Interval struct { + Start *inf.Dec + End *inf.Dec +} + +func isGreaterOrEqual(op string) bool { + return op == ">" || op == ">=" +} + +func isLessOrEqual(op string) bool { + return op == "<" || op == "<=" +} diff --git a/metrics-operator/converter/common_test.go b/metrics-operator/converter/common_test.go new file mode 100644 index 00000000000..84043d0e6ec --- /dev/null +++ b/metrics-operator/converter/common_test.go @@ -0,0 +1,21 @@ +package converter + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestIsLessOrEqual(t *testing.T) { + require.True(t, isLessOrEqual("<")) + require.True(t, isLessOrEqual("<=")) + require.False(t, isLessOrEqual(">")) + require.False(t, isLessOrEqual(">=")) +} + +func TestIsGreaterOrEqual(t *testing.T) { + require.False(t, isGreaterOrEqual("<")) + require.False(t, isGreaterOrEqual("<=")) + require.True(t, isGreaterOrEqual(">")) + require.True(t, isGreaterOrEqual(">=")) +} diff --git a/metrics-operator/converter/slo_converter.go b/metrics-operator/converter/slo_converter.go index b4c66cecccc..382d52f2d8f 100644 --- a/metrics-operator/converter/slo_converter.go +++ b/metrics-operator/converter/slo_converter.go @@ -42,7 +42,7 @@ type Criteria struct { Operators []string `yaml:"criteria,omitempty" json:"criteria,omitempty"` } -func (o *Objective) hasSupportedCriteria() bool { +func (o *Objective) hasNotSupportedCriteria() bool { return len(o.Pass) > 1 || len(o.Warning) > 1 } @@ -99,13 +99,16 @@ func (c *SLOConverter) convertSLO(sloContent *SLO, name string, namespace string }, // create a slice of size of len(sloContent.Objectives), but reserve capacity for // double the size, as some objectives may be twice there (conversion of criteria with logical AND) - Objectives: make([]metricsapi.Objective, len(sloContent.Objectives), len(sloContent.Objectives)*2), + Objectives: make([]metricsapi.Objective, len(sloContent.Objectives)), }, } // convert objectives one after another indexObjectives := 0 for _, o := range sloContent.Objectives { + // remove criteria, which contain % in their operators + o = cleanupObjective(o) + // set up target target, err := setupTarget(o) if err != nil { return nil, err @@ -136,15 +139,13 @@ func removePercentage(str string) (int, error) { } // creates and sets up the target struct from objective -// TODO refactor this function in a follow-up + weight distribution // nolint:gocognit,gocyclo func setupTarget(o *Objective) (*metricsapi.Target, error) { target := &metricsapi.Target{} - // remove criteria, which contain % in their operators - o = cleanupObjective(o) // skip objective target conversion if it has criteria combined with logical OR -> not supported // this way the SLO will become "informative" - if o.hasSupportedCriteria() { + // it will become informative as well when the pass criteria are not defined + if o.hasNotSupportedCriteria() || len(o.Pass) == 0 { return target, nil } @@ -152,8 +153,7 @@ func setupTarget(o *Objective) (*metricsapi.Target, error) { if len(o.Warning) == 0 { if len(o.Pass) > 0 { if len(o.Pass[0].Operators) > 0 { - // TODO cover use cases with multiple operators (create new objectives) - op, err := newOperator(o.Pass[0].Operators[0]) + op, err := newOperator(o.Pass[0].Operators, true) if err != nil { return target, err } @@ -163,30 +163,130 @@ func setupTarget(o *Objective) (*metricsapi.Target, error) { } } - // if warning criteria are defined, create new criteria with the following logic: + // if warning is superinterval of pass OR we have a single rule criteria, the following logic is used: // !(warn criteria) -> fail criteria // !(pass criteria) -> warn criteria - var err error - if len(o.Pass) > 0 { - if len(o.Pass[0].Operators) > 0 { - // TODO cover use cases with multiple operators (create new objectives) - op, err := newOperator(o.Pass[0].Operators[0]) - if err != nil { - return target, err - } - target.Warning = op + isWarningSuperInterval, err := isSuperInterval(o.Warning[0].Operators, o.Pass[0].Operators) + if err != nil { + return target, err + } + if (len(o.Pass[0].Operators) == 1 && len(o.Warning[0].Operators) == 1) || isWarningSuperInterval { + op1, err := newOperator(o.Pass[0].Operators, true) + if err != nil { + return target, err } - if len(o.Warning[0].Operators) > 0 { - // TODO cover use cases with multiple operators (create new objectives) - op, err := newOperator(o.Warning[0].Operators[0]) - if err != nil { - return target, err - } - target.Failure = op + op2, err := newOperator(o.Warning[0].Operators, true) + if err != nil { + return target, err + } + target.Failure = op2 + target.Warning = op1 + return target, nil + } + + // if pass is superinterval of warn, the following logic is used: + // !(pass criteria) -> fail criteria + // warn criteria -> warn criteria + isPassSuperInterval, err := isSuperInterval(o.Pass[0].Operators, o.Warning[0].Operators) + if err != nil { + return target, err + } + if isPassSuperInterval { + op1, err := newOperator(o.Warning[0].Operators, false) + if err != nil { + return target, err } + op2, err := newOperator(o.Pass[0].Operators, true) + if err != nil { + return target, err + } + target.Failure = op2 + target.Warning = op1 + return target, nil + } + + return target, nil +} + +// checks if interval is valid and if the first set of operators defines interval +// which is superset of the interval defined by second set of operators +func isSuperInterval(op1 []string, op2 []string) (bool, error) { + superInterval, err := createInterval(op1) + if err != nil { + return false, err + } + subInterval, err := createInterval(op2) + if err != nil { + return false, err + } + + return superInterval.Start.Cmp(subInterval.Start) < 1 && superInterval.End.Cmp(subInterval.End) >= 0, nil +} + +// creates interval from set of operators +func createInterval(op []string) (*Interval, error) { + // if it's unbounded interval, we have only one operator + if len(op) == 1 { + return createUnboundedInterval(op[0]) + } + + //bounded interval + return createBoundedInterval(op) +} + +func createBoundedInterval(op []string) (*Interval, error) { + if len(op) < 2 { + return nil, NewUnsupportedIntervalCombinationErr(op) + } + //fetch operators and values + operator1, value1, err := decodeOperatorAndValue(op[0]) + if err != nil { + return nil, err + } + operator2, value2, err := decodeOperatorAndValue(op[1]) + if err != nil { + return nil, err + } + // determine lower and higher bouds + smallerOperator, biggerOperator, err := decideIntervalBounds(operator1, value1, operator2, value2) + if err != nil { + return nil, err + } + //check if the interval makes logical sense for conversions, e.g. 5 < x < 10; unsupported: x < 5 && x > 10 + if isGreaterOrEqual(smallerOperator.Operation) && isLessOrEqual(biggerOperator.Operation) { + return &Interval{ + Start: smallerOperator.Value, + End: biggerOperator.Value, + }, nil } - return target, err + return nil, NewUnsupportedIntervalCombinationErr(op) +} + +func createUnboundedInterval(op string) (*Interval, error) { + //fetch operator and value + operator, value, err := decodeOperatorAndValue(op) + if err != nil { + return nil, err + } + dec := inf.NewDec(1, 0) + _, ok := dec.SetString(value) + if !ok { + return nil, NewUnconvertableValueErr(value) + } + // interval of (val, Inf) + if isGreaterOrEqual(operator) { + return &Interval{ + Start: dec, + End: inf.NewDec(int64(MaxInt), 0), + }, nil + // interval of (-Inf, val) + } + + return &Interval{ + Start: inf.NewDec(int64(MinInt), 0), + End: dec, + }, nil } func cleanupObjective(o *Objective) *Objective { @@ -204,7 +304,8 @@ func cleanupCriteria(criteria []Criteria) []Criteria { for _, op := range c.Operators { // keep only criteria with real values, not percentage if !strings.Contains(op, "%") { - operators = append(operators, op) + // remove unneeded whitespaces from criteria string + operators = append(operators, strings.Replace(op, " ", "", -1)) } } // if criterium does have operator, store it @@ -216,27 +317,58 @@ func cleanupCriteria(criteria []Criteria) []Criteria { return newCriteria } -// create operator for Target -func newOperator(op string) (*metricsapi.Operator, error) { - // remove whitespaces - op = strings.Replace(op, " ", "", -1) - +// check if operator is valid and split it to operator and value +func decodeOperatorAndValue(op string) (string, string, error) { operators := []string{"<=", "<", ">=", ">"} for _, operator := range operators { if strings.HasPrefix(op, operator) { - return createOperator(operator, strings.TrimPrefix(op, operator)) + return operator, strings.TrimPrefix(op, operator), nil + } + } + + return "", "", NewInvalidOperatorErr(op) +} + +// create operator for Target +func newOperator(op []string, negate bool) (*metricsapi.Operator, error) { + // convert single operator + if len(op) == 1 { + operator, value, err := decodeOperatorAndValue(op[0]) + if err != nil { + return nil, err + } + if negate { + return negateSingleOperator(operator, value) + } else { + return createSingleOperator(operator, value) + } + } else if len(op) >= 2 { // convert operators representing range + operator1, value1, err := decodeOperatorAndValue(op[0]) + if err != nil { + return nil, err + } + operator2, value2, err := decodeOperatorAndValue(op[1]) + if err != nil { + return nil, err + } + if negate { + return negateDoubleOperator(operator1, value1, operator2, value2) + } else { + return createDoubleOperator(operator1, value1, operator2, value2) } } - return &metricsapi.Operator{}, fmt.Errorf("invalid operator: '%s'", op) + return &metricsapi.Operator{}, NewEmptyOperatorErr(op) } -// checks and negates the existing operator -func createOperator(op string, value string) (*metricsapi.Operator, error) { +// checks and negates the existing single operator +// +//nolint:dupl +func negateSingleOperator(op string, value string) (*metricsapi.Operator, error) { dec := inf.NewDec(1, 0) _, ok := dec.SetString(value) if !ok { - return nil, fmt.Errorf("unable to convert value '%s' to decimal", value) + return nil, NewUnconvertableValueErr(value) } if op == "<=" { return &metricsapi.Operator{ @@ -264,5 +396,121 @@ func createOperator(op string, value string) (*metricsapi.Operator, error) { }, nil } - return &metricsapi.Operator{}, fmt.Errorf("invalid operator: '%s'", op) + return &metricsapi.Operator{}, NewInvalidOperatorErr(op) +} + +// checks and creates single operator +// +//nolint:dupl +func createSingleOperator(op string, value string) (*metricsapi.Operator, error) { + dec := inf.NewDec(1, 0) + _, ok := dec.SetString(value) + if !ok { + return nil, NewUnconvertableValueErr(value) + } + if op == "<=" { + return &metricsapi.Operator{ + LessThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, nil + } else if op == "<" { + return &metricsapi.Operator{ + LessThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, nil + } else if op == ">=" { + return &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, nil + } else if op == ">" { + return &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, nil + } + + return &metricsapi.Operator{}, NewInvalidOperatorErr(op) +} + +// checks and creates double operator +func createDoubleOperator(op1 string, value1 string, op2 string, value2 string) (*metricsapi.Operator, error) { + smallerOperator, biggerOperator, err := decideIntervalBounds(op1, value1, op2, value2) + if err != nil { + return nil, err + } + + // create range + r := &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*smallerOperator.Value, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*biggerOperator.Value, resource.DecimalSI), + } + + // inRange interval + if isGreaterOrEqual(smallerOperator.Operation) && isLessOrEqual(biggerOperator.Operation) { + return &metricsapi.Operator{ + InRange: r, + }, nil + // outOfRange interval + } else if isLessOrEqual(smallerOperator.Operation) && isGreaterOrEqual(biggerOperator.Operation) { + return &metricsapi.Operator{ + NotInRange: r, + }, nil + } + + return nil, NewUnconvertableOperatorCombinationErr(op1, op2) +} + +// decides which of the values is smaller and binds operator to them +func decideIntervalBounds(op1 string, value1 string, op2 string, value2 string) (*Operator, *Operator, error) { + dec1 := inf.NewDec(1, 0) + _, ok := dec1.SetString(value1) + if !ok { + return nil, nil, NewUnconvertableValueErr(value1) + } + dec2 := inf.NewDec(1, 0) + _, ok = dec2.SetString(value2) + if !ok { + return nil, nil, NewUnconvertableValueErr(value2) + } + + operator1 := &Operator{ + Value: dec1, + Operation: op1, + } + + operator2 := &Operator{ + Value: dec2, + Operation: op2, + } + + if dec1.Cmp(dec2) == -1 { + return operator1, operator2, nil + } + + return operator2, operator1, nil +} + +// checks and negates double operator +func negateDoubleOperator(op1 string, value1 string, op2 string, value2 string) (*metricsapi.Operator, error) { + // create range operator + operator, err := createDoubleOperator(op1, value1, op2, value2) + if err != nil { + return operator, err + } + + // negate it + if operator.NotInRange != nil { + return &metricsapi.Operator{ + InRange: operator.NotInRange, + }, nil + } + + return &metricsapi.Operator{ + NotInRange: operator.InRange, + }, nil } diff --git a/metrics-operator/converter/slo_converter_test.go b/metrics-operator/converter/slo_converter_test.go index 4ea47846df7..4beaaec1daf 100644 --- a/metrics-operator/converter/slo_converter_test.go +++ b/metrics-operator/converter/slo_converter_test.go @@ -1,3 +1,4 @@ +//nolint:dupl package converter import ( @@ -19,6 +20,37 @@ comparison: number_of_comparison_results: 1 filter: objectives: + - sli: "response_time_p90" + key_sli: false + pass: + - criteria: + - ">600" + - "<800" + warning: + - criteria: + - "<=1000" + - ">500" + weight: 2 + - sli: "response_time_p80" + key_sli: false + pass: + - criteria: + - ">600" + - "<800" + warning: + - criteria: + - "<=1000" + weight: 2 + - sli: "response_time_p70" + key_sli: false + warning: + - criteria: + - ">600" + - "<800" + pass: + - criteria: + - "<=1000" + weight: 2 - sli: "response_time_p95" key_sli: false pass: @@ -55,6 +87,43 @@ metadata: name: defname spec: objectives: + - analysisValueTemplateRef: + name: response_time_p90 + namespace: default + target: + failure: + notInRange: + highBound: 1k + lowBound: "500" + warning: + notInRange: + highBound: "800" + lowBound: "600" + weight: 2 + - analysisValueTemplateRef: + name: response_time_p80 + namespace: default + target: + failure: + greaterThan: + fixedValue: 1k + warning: + notInRange: + highBound: "800" + lowBound: "600" + weight: 2 + - analysisValueTemplateRef: + name: response_time_p70 + namespace: default + target: + failure: + greaterThan: + fixedValue: 1k + warning: + inRange: + highBound: "800" + lowBound: "600" + weight: 2 - analysisValueTemplateRef: name: response_time_p95 namespace: default @@ -101,10 +170,8 @@ func TestConvert(t *testing.T) { require.Equal(t, expectedOutput, res) } -func TestCreateOperator(t *testing.T) { +func TestNegateSingleOperator(t *testing.T) { dec := inf.NewDec(1, 0) - _, ok := dec.SetString("1") - require.True(t, ok) tests := []struct { name string @@ -175,7 +242,7 @@ func TestCreateOperator(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - res, err := createOperator(tt.op, tt.value) + res, err := negateSingleOperator(tt.op, tt.value) if tt.wantErr { require.NotNil(t, err) } else { @@ -186,58 +253,69 @@ func TestCreateOperator(t *testing.T) { } } -func TestSetupOperator(t *testing.T) { +func TestCreateSingleOperator(t *testing.T) { dec := inf.NewDec(1, 0) - _, ok := dec.SetString("1") - require.True(t, ok) tests := []struct { name string op string + value string out *metricsapi.Operator wantErr bool }{ + { + name: "invalid int value", + op: "", + value: "val", + out: nil, + wantErr: true, + }, { name: "unsupported operator", op: "", + value: "1", out: nil, wantErr: true, }, { - name: "lessEqual operator", - op: "<=1", + name: "lessEqual operator", + op: "<=", + value: "1", out: &metricsapi.Operator{ - GreaterThan: &metricsapi.OperatorValue{ + LessThanOrEqual: &metricsapi.OperatorValue{ FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), }, }, wantErr: false, }, { - name: "less operator", - op: "<1", + name: "less operator", + op: "<", + value: "1", out: &metricsapi.Operator{ - GreaterThanOrEqual: &metricsapi.OperatorValue{ + LessThan: &metricsapi.OperatorValue{ FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), }, }, wantErr: false, }, { - name: "greaterEqual operator", - op: ">=1", + name: "greaterEqual operator", + op: ">=", + value: "1", out: &metricsapi.Operator{ - LessThan: &metricsapi.OperatorValue{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), }, }, wantErr: false, }, { - name: "greater operator", - op: ">1", + name: "greater operator", + op: ">", + value: "1", out: &metricsapi.Operator{ - LessThanOrEqual: &metricsapi.OperatorValue{ + GreaterThan: &metricsapi.OperatorValue{ FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), }, }, @@ -247,7 +325,7 @@ func TestSetupOperator(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - res, err := newOperator(tt.op) + res, err := createSingleOperator(tt.op, tt.value) if tt.wantErr { require.NotNil(t, err) } else { @@ -258,188 +336,705 @@ func TestSetupOperator(t *testing.T) { } } -func TestShouldIgnoreObjective(t *testing.T) { +func TestCreateDoubleOperator(t *testing.T) { + dec := inf.NewDec(1, 0) + dec5 := inf.NewDec(5, 0) + tests := []struct { - name string - o *Objective - want bool + name string + op1 string + value1 string + op2 string + value2 string + out *metricsapi.Operator + wantErr bool }{ { - name: "empty criteria", - o: &Objective{ - Pass: []Criteria{}, - Warning: []Criteria{}, - }, - want: false, + name: "invalid int value", + op1: "", + value1: "val", + out: nil, + wantErr: true, }, { - name: "valid criteria", - o: &Objective{ - Pass: []Criteria{ - { - Operators: []string{}, - }, + name: "unsupported operator", + op1: "", + value1: "1", + out: nil, + wantErr: true, + }, + { + name: "inRange operator", + op1: "<=", + value1: "5", + op2: ">=", + value2: "1", + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, - Warning: []Criteria{ - { - Operators: []string{}, - }, + }, + wantErr: false, + }, + { + name: "inRange operator", + op1: "<", + value1: "5", + op2: ">", + value2: "1", + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, }, - want: false, + wantErr: false, }, { - name: "OR criteria", - o: &Objective{ - Pass: []Criteria{ - { - Operators: []string{}, - }, - { - Operators: []string{}, - }, + name: "inRange operator", + op1: "<=", + value1: "5", + op2: ">", + value2: "1", + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, - Warning: []Criteria{ - { - Operators: []string{}, - }, + }, + wantErr: false, + }, + { + name: "inRange operator", + op1: "<", + value1: "5", + op2: ">=", + value2: "1", + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, }, - want: true, + wantErr: false, }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - require.Equal(t, tt.want, tt.o.hasSupportedCriteria()) - }) - - } -} - -func TestRemovePercentage(t *testing.T) { - tests := []struct { - name string - val string - want int - wantErr bool - }{ { - name: "no percentage", - val: "1", - want: 1, + name: "notinRange operator", + op1: ">=", + value1: "5", + op2: "<=", + value2: "1", + out: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), + }, + }, wantErr: false, }, { - name: "percentage", - val: "1%", - want: 1, + name: "notinRange operator", + op1: ">", + value1: "5", + op2: "<", + value2: "1", + out: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), + }, + }, wantErr: false, }, { - name: "percentage with float - round down", - val: "1.333333%", - want: 1, + name: "notinRange operator", + op1: ">=", + value1: "5", + op2: "<", + value2: "1", + out: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), + }, + }, wantErr: false, }, { - name: "percentage with float - round up", - val: "1.833333%", - want: 2, + name: "notinRange operator", + op1: ">", + value1: "5", + op2: "<=", + value2: "1", + out: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), + }, + }, wantErr: false, }, { - name: "only percentage", - val: "%", - want: 0, + name: "unsupported combination", + op1: ">", + value1: "5", + op2: ">", + value2: "1", + out: &metricsapi.Operator{}, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - res, err := removePercentage(tt.val) + res, err := createDoubleOperator(tt.op1, tt.value1, tt.op2, tt.value2) if tt.wantErr { require.NotNil(t, err) } else { - require.Equal(t, tt.want, res) + require.Equal(t, tt.out, res) } }) + } } -func TestCleanupCriteria(t *testing.T) { +func TestNegateDoubleOperator(t *testing.T) { + dec := inf.NewDec(1, 0) + dec5 := inf.NewDec(5, 0) + tests := []struct { - name string - in []Criteria - out []Criteria + name string + op1 string + value1 string + op2 string + value2 string + out *metricsapi.Operator + wantErr bool }{ { - name: "empty criteria", - in: []Criteria{}, - out: []Criteria{}, + name: "invalid int value", + op1: "", + value1: "val", + out: nil, + wantErr: true, }, { - name: "no criteria to clean up", - in: []Criteria{ - { - Operators: []string{"<100"}, + name: "unsupported operator", + op1: "", + value1: "1", + out: nil, + wantErr: true, + }, + { + name: "Not inRange operator", + op1: "<=", + value1: "5", + op2: ">=", + value2: "1", + out: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, }, - out: []Criteria{ - { - Operators: []string{"<100"}, + wantErr: false, + }, + { + name: "Not inRange operator", + op1: "<", + value1: "5", + op2: ">", + value2: "1", + out: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, }, + wantErr: false, }, { - name: "criteria to clean up", - in: []Criteria{ - { - Operators: []string{"<100", "<10%"}, + name: "Not inRange operator", + op1: "<=", + value1: "5", + op2: ">", + value2: "1", + out: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, }, - out: []Criteria{ - { - Operators: []string{"<100"}, + wantErr: false, + }, + { + name: "Not inRange operator", + op1: "<", + value1: "5", + op2: ">=", + value2: "1", + out: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, }, + wantErr: false, }, { - name: "multiple criteria to clean up", - in: []Criteria{ - { - Operators: []string{"<100", "<10%"}, - }, - { - Operators: []string{"<10%"}, + name: "inRange operator", + op1: ">=", + value1: "5", + op2: "<=", + value2: "1", + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, }, - out: []Criteria{ - { - Operators: []string{"<100"}, + wantErr: false, + }, + { + name: "inRange operator", + op1: ">", + value1: "5", + op2: "<", + value2: "1", + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, }, + wantErr: false, }, { - name: "all criteria to clean up", - in: []Criteria{ - { - Operators: []string{"<10%"}, + name: "inRange operator", + op1: ">=", + value1: "5", + op2: "<", + value2: "1", + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, - { - Operators: []string{"<10%"}, + }, + wantErr: false, + }, + { + name: "inRange operator", + op1: ">", + value1: "5", + op2: "<=", + value2: "1", + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), }, }, - out: []Criteria{}, + wantErr: false, + }, + { + name: "unsupported combination", + op1: ">", + value1: "5", + op2: ">", + value2: "1", + out: &metricsapi.Operator{}, + wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - require.Equal(t, tt.out, cleanupCriteria(tt.in)) - }) - } + res, err := negateDoubleOperator(tt.op1, tt.value1, tt.op2, tt.value2) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.out, res) + } + }) + + } +} + +func TestNewOperator(t *testing.T) { + dec := inf.NewDec(1, 0) + dec5 := inf.NewDec(5, 0) + + tests := []struct { + name string + op []string + negate bool + out *metricsapi.Operator + wantErr bool + }{ + { + name: "empty operator", + op: []string{}, + negate: true, + out: nil, + wantErr: true, + }, + { + name: "unsupported operator", + op: []string{""}, + negate: true, + out: nil, + wantErr: true, + }, + { + name: "unsupported operator double - first", + op: []string{"", ">5"}, + negate: true, + out: nil, + wantErr: true, + }, + { + name: "unsupported operator double - second", + op: []string{"<5", "5"}, + negate: true, + out: nil, + wantErr: true, + }, + { + name: "lessEqual operator - negate", + op: []string{"<=1"}, + negate: true, + out: &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "less operator - negate", + op: []string{"<1"}, + negate: true, + out: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "greaterEqual operator - negate", + op: []string{">=1"}, + negate: true, + out: &metricsapi.Operator{ + LessThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "greater operator - negate", + op: []string{">1"}, + negate: true, + out: &metricsapi.Operator{ + LessThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "lessEqual operator", + op: []string{"<=1"}, + negate: false, + out: &metricsapi.Operator{ + LessThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "less operator", + op: []string{"<1"}, + negate: false, + out: &metricsapi.Operator{ + LessThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "greaterEqual operator", + op: []string{">=1"}, + negate: false, + out: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "greater operator", + op: []string{">1"}, + negate: false, + out: &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "double operator - negate", + op: []string{">1", "<5"}, + negate: true, + out: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "double operator", + op: []string{">1", "<5"}, + negate: false, + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), + }, + }, + wantErr: false, + }, + { + name: "double operator - third one ignored", + op: []string{">1", "<5", ">8"}, + negate: false, + out: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), + }, + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + res, err := newOperator(tt.op, tt.negate) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.out, res) + } + }) + + } +} + +func TestShouldIgnoreObjective(t *testing.T) { + tests := []struct { + name string + o *Objective + want bool + }{ + { + name: "empty criteria", + o: &Objective{ + Pass: []Criteria{}, + Warning: []Criteria{}, + }, + want: false, + }, + { + name: "valid criteria", + o: &Objective{ + Pass: []Criteria{ + { + Operators: []string{}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{}, + }, + }, + }, + want: false, + }, + { + name: "OR criteria", + o: &Objective{ + Pass: []Criteria{ + { + Operators: []string{}, + }, + { + Operators: []string{}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{}, + }, + }, + }, + want: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.want, tt.o.hasNotSupportedCriteria()) + }) + + } +} + +func TestRemovePercentage(t *testing.T) { + tests := []struct { + name string + val string + want int + wantErr bool + }{ + { + name: "no percentage", + val: "1", + want: 1, + wantErr: false, + }, + { + name: "percentage", + val: "1%", + want: 1, + wantErr: false, + }, + { + name: "percentage with float - round down", + val: "1.333333%", + want: 1, + wantErr: false, + }, + { + name: "percentage with float - round up", + val: "1.833333%", + want: 2, + wantErr: false, + }, + { + name: "only percentage", + val: "%", + want: 0, + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + res, err := removePercentage(tt.val) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.want, res) + } + }) + } +} + +func TestCleanupCriteria(t *testing.T) { + tests := []struct { + name string + in []Criteria + out []Criteria + }{ + { + name: "empty criteria", + in: []Criteria{}, + out: []Criteria{}, + }, + { + name: "no criteria to clean up", + in: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + out: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + }, + { + name: "criteria with whitespaces", + in: []Criteria{ + { + Operators: []string{" < 1 0 0 "}, + }, + }, + out: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + }, + { + name: "criteria to clean up", + in: []Criteria{ + { + Operators: []string{"<100", "<10%"}, + }, + }, + out: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + }, + { + name: "multiple criteria to clean up", + in: []Criteria{ + { + Operators: []string{"<100", "<10%"}, + }, + { + Operators: []string{"<10%"}, + }, + }, + out: []Criteria{ + { + Operators: []string{"<100"}, + }, + }, + }, + { + name: "all criteria to clean up", + in: []Criteria{ + { + Operators: []string{"<10%"}, + }, + { + Operators: []string{"<10%"}, + }, + }, + out: []Criteria{}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + require.Equal(t, tt.out, cleanupCriteria(tt.in)) + }) + } } func TestCleanupObjective(t *testing.T) { @@ -526,13 +1121,10 @@ func TestCleanupObjective(t *testing.T) { } func TestSetupTarget(t *testing.T) { - dec10 := inf.NewDec(1, 0) - _, ok := dec10.SetString("10") - require.True(t, ok) - - dec15 := inf.NewDec(1, 0) - _, ok = dec15.SetString("15") - require.True(t, ok) + dec5 := inf.NewDec(5, 0) + dec10 := inf.NewDec(10, 0) + dec15 := inf.NewDec(15, 0) + dec20 := inf.NewDec(20, 0) tests := []struct { name string @@ -548,6 +1140,19 @@ func TestSetupTarget(t *testing.T) { want: &metricsapi.Target{}, wantErr: false, }, + { + name: "bogus operator", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"<<<<10"}, + }, + }, + }, + want: &metricsapi.Target{}, + wantErr: true, + }, { name: "logical OR criteria -> informative slo", o: &Objective{ @@ -565,44 +1170,64 @@ func TestSetupTarget(t *testing.T) { wantErr: false, }, { - name: "criteria with % -> informative slo", + name: "no warn criteria single - conversion", o: &Objective{ Name: "criteria", Pass: []Criteria{ { - Operators: []string{"<10%"}, + Operators: []string{"<10"}, + }, + }, + }, + want: &metricsapi.Target{ + Failure: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), }, }, }, - want: &metricsapi.Target{}, wantErr: false, }, { - name: "no warn criteria - conversion", + name: "no warn criteria single - error", o: &Objective{ Name: "criteria", Pass: []Criteria{ { - Operators: []string{"<10"}, + Operators: []string{"10"}, + }, + }, + }, + want: &metricsapi.Target{}, + wantErr: true, + }, + { + name: "no warn criteria double - conversion", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{">10", "<15"}, }, }, }, want: &metricsapi.Target{ Failure: &metricsapi.Operator{ - GreaterThanOrEqual: &metricsapi.OperatorValue{ - FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), }, }, }, wantErr: false, }, { - name: "no warn criteria - error", + name: "no warn criteria double - error", o: &Objective{ Name: "criteria", Pass: []Criteria{ { - Operators: []string{"10"}, + Operators: []string{"10", "<15"}, }, }, }, @@ -610,7 +1235,7 @@ func TestSetupTarget(t *testing.T) { wantErr: true, }, { - name: "with warn criteria - conversion", + name: "with warn criteria single pass criteria single - conversion", o: &Objective{ Name: "criteria", Pass: []Criteria{ @@ -638,6 +1263,146 @@ func TestSetupTarget(t *testing.T) { }, wantErr: false, }, + { + name: "with warn criteria double pass criteria double - warn in superset - conversion", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{">10", "<15"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{"<=20", ">5"}, + }, + }, + }, + want: &metricsapi.Target{ + Failure: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec20, resource.DecimalSI), + }, + }, + Warning: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), + }, + }, + }, + wantErr: false, + }, + { + name: "with warn criteria single pass criteria double - warn is superset - conversion", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{">10", "<15"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{"<=20"}, + }, + }, + }, + want: &metricsapi.Target{ + Failure: &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec20, resource.DecimalSI), + }, + }, + Warning: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), + }, + }, + }, + wantErr: false, + }, + { + name: "with warn criteria double pass criteria single - pass is superset - conversion", + o: &Objective{ + Name: "criteria", + Warning: []Criteria{ + { + Operators: []string{">10", "<15"}, + }, + }, + Pass: []Criteria{ + { + Operators: []string{"<=20"}, + }, + }, + }, + want: &metricsapi.Target{ + Failure: &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec20, resource.DecimalSI), + }, + }, + Warning: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), + }, + }, + }, + wantErr: false, + }, + { + name: "with warn criteria double pass criteria double - pass is superset - conversion", + o: &Objective{ + Name: "criteria", + Warning: []Criteria{ + { + Operators: []string{">10", "<15"}, + }, + }, + Pass: []Criteria{ + { + Operators: []string{"<=20", ">5"}, + }, + }, + }, + want: &metricsapi.Target{ + Failure: &metricsapi.Operator{ + NotInRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec5, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec20, resource.DecimalSI), + }, + }, + Warning: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), + }, + }, + }, + wantErr: false, + }, + { + name: "with warn criteria double pass criteria double - no intersection - conversion", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{">15", "<20"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{"<=10", ">5"}, + }, + }, + }, + want: &metricsapi.Target{}, + wantErr: false, + }, { name: "with warn criteria - error pass", o: &Objective{ @@ -689,13 +1454,8 @@ func TestSetupTarget(t *testing.T) { } func TestConvertSLO(t *testing.T) { - dec10 := inf.NewDec(1, 0) - _, ok := dec10.SetString("10") - require.True(t, ok) - - dec15 := inf.NewDec(1, 0) - _, ok = dec15.SetString("15") - require.True(t, ok) + dec10 := inf.NewDec(10, 0) + dec15 := inf.NewDec(15, 0) c := NewSLOConverter() @@ -755,13 +1515,102 @@ func TestConvertSLO(t *testing.T) { PassPercentage: 50, WarningPercentage: 20, }, - Objectives: []metricsapi.Objective{}, + Objectives: []metricsapi.Objective{}, + }, + }, + wantErr: false, + }, + { + name: "objectives conversion", + slo: &SLO{ + TotalScore: Score{ + Pass: "50", + Warning: "20", + }, + Objectives: []*Objective{ + { + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{"<=15"}, + }, + }, + KeySLI: true, + Weight: 10, + }, + { + Name: "criteria2", + Pass: []Criteria{ + { + Operators: []string{"<10"}, + }, + }, + Weight: 5, + }, + }, + }, + defName: "defName", + namespace: "default", + out: &metricsapi.AnalysisDefinition{ + TypeMeta: v1.TypeMeta{ + Kind: "AnalysisDefinition", + APIVersion: "metrics.keptn.sh/v1alpha3", + }, + ObjectMeta: v1.ObjectMeta{ + Name: "defName", + }, + Spec: metricsapi.AnalysisDefinitionSpec{ + TotalScore: metricsapi.TotalScore{ + PassPercentage: 50, + WarningPercentage: 20, + }, + Objectives: []metricsapi.Objective{ + { + Target: metricsapi.Target{ + Failure: &metricsapi.Operator{ + GreaterThan: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), + }, + }, + Warning: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + }, + }, + }, + Weight: 10, + KeyObjective: true, + AnalysisValueTemplateRef: metricsapi.ObjectReference{ + Name: "criteria", + Namespace: "default", + }, + }, + { + Target: metricsapi.Target{ + Failure: &metricsapi.Operator{ + GreaterThanOrEqual: &metricsapi.OperatorValue{ + FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + }, + }, + }, + Weight: 5, + AnalysisValueTemplateRef: metricsapi.ObjectReference{ + Name: "criteria2", + Namespace: "default", + }, + }, + }, }, }, wantErr: false, }, { - name: "objectives conversion", + name: "objectives with percentage only - informative", slo: &SLO{ TotalScore: Score{ Pass: "50", @@ -772,12 +1621,12 @@ func TestConvertSLO(t *testing.T) { Name: "criteria", Pass: []Criteria{ { - Operators: []string{"<10"}, + Operators: []string{"<10%"}, }, }, Warning: []Criteria{ { - Operators: []string{"<=15"}, + Operators: []string{"<=15%"}, }, }, KeySLI: true, @@ -787,7 +1636,7 @@ func TestConvertSLO(t *testing.T) { Name: "criteria2", Pass: []Criteria{ { - Operators: []string{"<10"}, + Operators: []string{"<10%"}, }, }, Weight: 5, @@ -811,18 +1660,7 @@ func TestConvertSLO(t *testing.T) { }, Objectives: []metricsapi.Objective{ { - Target: metricsapi.Target{ - Failure: &metricsapi.Operator{ - GreaterThan: &metricsapi.OperatorValue{ - FixedValue: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), - }, - }, - Warning: &metricsapi.Operator{ - GreaterThanOrEqual: &metricsapi.OperatorValue{ - FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), - }, - }, - }, + Target: metricsapi.Target{}, Weight: 10, KeyObjective: true, AnalysisValueTemplateRef: metricsapi.ObjectReference{ @@ -831,13 +1669,7 @@ func TestConvertSLO(t *testing.T) { }, }, { - Target: metricsapi.Target{ - Failure: &metricsapi.Operator{ - GreaterThanOrEqual: &metricsapi.OperatorValue{ - FixedValue: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), - }, - }, - }, + Target: metricsapi.Target{}, Weight: 5, AnalysisValueTemplateRef: metricsapi.ObjectReference{ Name: "criteria2", @@ -902,3 +1734,417 @@ func TestConvertSLO(t *testing.T) { } } + +func TestDecodeOperatorAndValue(t *testing.T) { + tests := []struct { + name string + o string + opOut string + opVal string + wantErr bool + }{ + { + name: "unsupported operator", + o: "--", + wantErr: true, + }, + { + name: "happy path - less", + o: "<5", + opOut: "<", + opVal: "5", + wantErr: false, + }, + { + name: "happy path - lessEqual", + o: "<=5", + opOut: "<=", + opVal: "5", + wantErr: false, + }, + { + name: "happy path - greater", + o: ">5", + opOut: ">", + opVal: "5", + wantErr: false, + }, + { + name: "happy path - greaterEqual", + o: ">=5", + opOut: ">=", + opVal: "5", + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + opOut, opVal, err := decodeOperatorAndValue(tt.o) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.opOut, opOut) + require.Equal(t, tt.opVal, opVal) + } + }) + + } +} + +func TestDecideIntervalBounds(t *testing.T) { + dec10 := inf.NewDec(10, 0) + dec15 := inf.NewDec(15, 0) + + tests := []struct { + name string + op1 string + val1 string + op2 string + val2 string + smallerOp *Operator + biggerOp *Operator + wantErr bool + }{ + { + name: "error converting first value", + op1: "<", + val1: "-", + op2: "<", + val2: "5", + wantErr: true, + }, + { + name: "error converting second value", + op1: "<", + val1: "5", + op2: "<", + val2: "-", + wantErr: true, + }, + { + name: "fist value smaller", + op1: ">", + val1: "10", + op2: "<", + val2: "15", + smallerOp: &Operator{ + Value: dec10, + Operation: ">", + }, + biggerOp: &Operator{ + Value: dec15, + Operation: "<", + }, + wantErr: false, + }, + { + name: "second value smaller", + op1: ">", + val1: "15", + op2: "<", + val2: "10", + smallerOp: &Operator{ + Value: dec10, + Operation: "<", + }, + biggerOp: &Operator{ + Value: dec15, + Operation: ">", + }, + wantErr: false, + }, + { + name: "equal values", + op1: ">", + val1: "15", + op2: "<", + val2: "15", + smallerOp: &Operator{ + Value: dec15, + Operation: "<", + }, + biggerOp: &Operator{ + Value: dec15, + Operation: ">", + }, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + smallerOperator, biggerOperator, err := decideIntervalBounds(tt.op1, tt.val1, tt.op2, tt.val2) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.smallerOp, smallerOperator) + require.Equal(t, tt.biggerOp, biggerOperator) + } + }) + + } +} + +func TestCreateUnboundedInterval(t *testing.T) { + dec10 := inf.NewDec(10, 0) + max := inf.NewDec(int64(MaxInt), 0) + min := inf.NewDec(int64(MinInt), 0) + + tests := []struct { + name string + op string + i *Interval + wantErr bool + }{ + { + name: "unable to decode operator", + op: "--", + wantErr: true, + }, + { + name: "unable to decode dec number", + op: "<--", + wantErr: true, + }, + { + name: "unsupported operator", + op: "=5", + wantErr: true, + }, + { + name: "inf interval greater", + op: ">10", + wantErr: false, + i: &Interval{ + Start: dec10, + End: max, + }, + }, + { + name: "inf interval greater equal", + op: ">=10", + wantErr: false, + i: &Interval{ + Start: dec10, + End: max, + }, + }, + { + name: "inf interval less", + op: "<10", + wantErr: false, + i: &Interval{ + Start: min, + End: dec10, + }, + }, + { + name: "inf interval less equal", + op: "<10", + wantErr: false, + i: &Interval{ + Start: min, + End: dec10, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + i, err := createUnboundedInterval(tt.op) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.i, i) + } + }) + + } +} + +func TestCreateBoundedInterval(t *testing.T) { + dec10 := inf.NewDec(10, 0) + dec15 := inf.NewDec(15, 0) + + tests := []struct { + name string + op []string + i *Interval + wantErr bool + }{ + { + name: "empty array", + op: []string{}, + wantErr: true, + }, + { + name: "unable to decode operator1", + op: []string{"--", "<5"}, + wantErr: true, + }, + { + name: "unable to decode operator2", + op: []string{"<5", "-"}, + wantErr: true, + }, + { + name: "unable to decode inteval bounds", + op: []string{"<-", ">5"}, + wantErr: true, + }, + { + name: "unsupported interval", + op: []string{"<5", ">10"}, + wantErr: true, + }, + { + name: "happy path", + op: []string{">10", "<15"}, + wantErr: false, + i: &Interval{ + Start: dec10, + End: dec15, + }, + }, + { + name: "happy path", + op: []string{">=10", "<=15"}, + wantErr: false, + i: &Interval{ + Start: dec10, + End: dec15, + }, + }, + { + name: "happy path", + op: []string{">10", "<=15"}, + wantErr: false, + i: &Interval{ + Start: dec10, + End: dec15, + }, + }, + { + name: "happy path", + op: []string{">=10", "<15"}, + wantErr: false, + i: &Interval{ + Start: dec10, + End: dec15, + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + i, err := createBoundedInterval(tt.op) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.i, i) + } + }) + + } +} + +func TestCreateInterval(t *testing.T) { + // unbounded interval + dec10 := inf.NewDec(10, 0) + dec15 := inf.NewDec(15, 0) + min := inf.NewDec(int64(MinInt), 0) + + i, err := createInterval([]string{"<10"}) + require.Nil(t, err) + require.Equal(t, &Interval{ + Start: min, + End: dec10, + }, i) + + // bounded interval + i, err = createInterval([]string{">10", "<15"}) + require.Nil(t, err) + require.Equal(t, &Interval{ + Start: dec10, + End: dec15, + }, i) +} + +func TestIsSuperInterval(t *testing.T) { + tests := []struct { + name string + op1 []string + op2 []string + want bool + wantErr bool + }{ + { + name: "error creating super interval", + op1: []string{"--"}, + want: false, + wantErr: true, + }, + { + name: "error creating sub interval", + op1: []string{"<5"}, + op2: []string{"--"}, + want: false, + wantErr: true, + }, + { + name: "intervals do not intercept", + op1: []string{"<5"}, + op2: []string{">10"}, + want: false, + wantErr: false, + }, + { + name: "intervals intercept partially", + op1: []string{"<10"}, + op2: []string{">5"}, + want: false, + wantErr: false, + }, + { + name: "subinterval is superinterval", + op1: []string{">5", "<7"}, + op2: []string{"<10"}, + want: false, + wantErr: false, + }, + { + name: "equal intervals", + op1: []string{"<10"}, + op2: []string{"<10"}, + want: true, + wantErr: false, + }, + { + name: "superinterval unbounded", + op1: []string{"<10"}, + op2: []string{">5", "<7"}, + want: true, + wantErr: false, + }, + { + name: "superinterval bounded", + op1: []string{">5", "<10"}, + op2: []string{">5", "<7"}, + want: true, + wantErr: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + res, err := isSuperInterval(tt.op1, tt.op2) + if tt.wantErr { + require.NotNil(t, err) + } else { + require.Equal(t, tt.want, res) + } + }) + + } +} From 25bf6ce1a32b15c870c3dadff861999eef8a4896 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Fri, 1 Sep 2023 02:56:46 -0700 Subject: [PATCH 28/78] docs: contribution guidelines (#1906) Signed-off-by: Meg McRoberts Signed-off-by: Giovanni Liva Co-authored-by: Giovanni Liva --- docs/CONTRIBUTING.md | 4 +- .../docs/contrib-guidelines-docs/_index.md | 89 +++++++++++++++++++ .../local-building/{index.md => _index.md} | 14 +-- .../contrib-guidelines-gen}/_index.md | 11 ++- 4 files changed, 102 insertions(+), 16 deletions(-) create mode 100644 docs/content/en/contribute/docs/contrib-guidelines-docs/_index.md rename docs/content/en/contribute/docs/local-building/{index.md => _index.md} (97%) rename docs/content/en/contribute/{docs/contribution-guidelines => general/contrib-guidelines-gen}/_index.md (82%) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 78327e3b071..4f2690e765b 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -25,11 +25,11 @@ We were all new to this once and are happy to help you! ## Guidelines for Contributing -Please check [Contribution Guidelines](content/en/contribute/docs/contribution-guidelines/_index.md). +Please check [Contribution Guidelines](content/en/contribute/docs/contrib-guidelines-docs/_index.md). ## Building the Documentation Locally -Please check [Building the Documentation Locally](content/en/contribute/docs/local-building/index.md). +Please check [Building the Documentation Locally](content/en/contribute/docs/local-building/_index.md). ## Interacting with github diff --git a/docs/content/en/contribute/docs/contrib-guidelines-docs/_index.md b/docs/content/en/contribute/docs/contrib-guidelines-docs/_index.md new file mode 100644 index 00000000000..73659cacbc7 --- /dev/null +++ b/docs/content/en/contribute/docs/contrib-guidelines-docs/_index.md @@ -0,0 +1,89 @@ +--- +title: Contribution guidelines for documentation +description: Guidelines for contributing towards Keptn Lifecycle Toolkit +weight: 300 +--- + +The [Contribution Guidelines](../../general/contrib-guidelines-gen) page +contains guidelines that are relevant +for both documentation and software contributions. +This page lists additional guidelines +that are relevant only to documentation + +## Guidelines for contributing + +* Keep your language clean and crisp. + We do not have an official *Style Guide* for Keptn but the + [Google developer documentation style guide](https://developers.google.com/style) + is a good general reference. + +* Use topic sentences for sections and paragraphs. + When reading a well-written technical document, + you should be able to read the first sentence in each paragraph + and especially in each section to get an idea of what might follow. + + Good oral presentations commonly begin with a "set-up" + where they describe a problem + and then proceed to tell how to fix that problem. + When using oral presentations as source material, + it is important to rewrite the text + so that the actual subject of discussion comes first. + +* Avoid using FAQ's in documentation. + In general, they say "here is some miscellaneous information + that I was too lazy to organize logically for you." + In rare occasions, they may be appropriate, + such as if you need a quick reference to a large, complicated document + and include links to detailed documentation about the topic. + +* We are attempting to avoid duplicated information across the doc set, + especially for information that is expected to change. + For example, information about supported Kubernetes versions + and the command sequence to install KLT should usually be done + as references to the official installation section of the docs. + + For usability considerations, we make the following exceptions: + + * The main `README.md` file for the lifecycle-controller repository + includes this basic information as well as a link + to the full installation documentation which has more details. + * The Getting Started Guide also includes this information + for the same reason. + +* `markdownlint` enforces limits on line length. + Links to other documents are exempted from this limit + but, if a line has words before and after the long string, + `markdownlint` fails. + A good practice is to just code all links on their own page. + So, instead of coding: + + ```shell + The [Other section](long-link-to-section) page + ... + ``` + + you should code the following, + unless the link is so short + that you are sure it will not violate the line-length rules:: + + ```shell + The + [Other section](long-link-to-section) + page + ... + ``` + +* Always build the documentation locally to check the formatting + and verify that all links are working properly. + See [Build Documentation Locally](../local-building) + for details. + +* Always run the following to fix most markdown issues in your PR + and identify issues that can not be fixed automatically: + + ```shell + make markdownlint-fix + ``` + + See [Markdownlint](../linter-requirements/#markdownlint) + for details. diff --git a/docs/content/en/contribute/docs/local-building/index.md b/docs/content/en/contribute/docs/local-building/_index.md similarity index 97% rename from docs/content/en/contribute/docs/local-building/index.md rename to docs/content/en/contribute/docs/local-building/_index.md index ee2d7741377..73d360856a3 100644 --- a/docs/content/en/contribute/docs/local-building/index.md +++ b/docs/content/en/contribute/docs/local-building/_index.md @@ -21,25 +21,19 @@ To set up a local Docsy build: * [Install on Linux](https://docs.docker.com/desktop/install/linux-install/) * [Install on Windows](https://docs.docker.com/desktop/install/windows-install/) -1. Build the Keptn Docsy repo: +1. Execute the following command from the `docs` folder of your clone: ```shell - make build + make server ``` + It will continue running in its own shell. + > **Note** To utilize the `Makefile`, you must have GNU **make** available on your local machine. Versions are available for all the usual Operating Systems. -1. Execute the following command from the `docs` folder of your clone: - - ```shell - make server - ``` - - It will continue running in its own shell. - 1. Start contributing! Note that Hugo updates the rendered documentation each time you write the file. diff --git a/docs/content/en/contribute/docs/contribution-guidelines/_index.md b/docs/content/en/contribute/general/contrib-guidelines-gen/_index.md similarity index 82% rename from docs/content/en/contribute/docs/contribution-guidelines/_index.md rename to docs/content/en/contribute/general/contrib-guidelines-gen/_index.md index c85703db435..ca4aa2dec9b 100644 --- a/docs/content/en/contribute/docs/contribution-guidelines/_index.md +++ b/docs/content/en/contribute/general/contrib-guidelines-gen/_index.md @@ -1,7 +1,7 @@ --- title: Contribution Guidelines -description: Guidelines for contributing towards Keptn Lifecycle Toolkit -weight: 300 +description: Guidelines for contributing to Keptn Lifecycle Toolkit +weight: 50 --- Before using the **Keptn Lifecycle Toolkit** @@ -9,6 +9,10 @@ as a contributor to the Keptn Lifecycle Toolkit repository, it is expected that you comply with the guidelines while making contributions towards the repository. +These guidelines are appropriate for both software and documentation. +For additional guidelines that are relevant only to documentation, see +[Contribution guidelines for documentation](../../docs/contrib-guidelines-docs). + ## Guidelines for contributing * Always fork the repository then clone that fork to your local system @@ -16,7 +20,6 @@ making contributions towards the repository. Keptn, like most open source projects, severely restricts who can push changes directly to the `main` branch to protect the integrity of the repository. -* Keep your language clean and crisp. * Smaller PR's are easier to review and so generally get processed more quickly; when possible, chunk your work into smallish PR's. However, we recognize that documentation work sometimes requires larger PRs, @@ -30,7 +33,7 @@ making contributions towards the repository. This helps reviewers understand each commit and provides a good history after the PR is merged. * If your PR is not reviewed in a timely fashion, - feel free to post a gentle reminder to the `#keptn-docs` Slack channel. + feel free to post a gentle reminder to the `#keptn-help-contributing` Slack channel. * Resolve review comments and suggestions promptly. If you see a problem and are unable to fix it yourself From 017e08b0a65679ca417e363f2223b7f4fef3bc55 Mon Sep 17 00:00:00 2001 From: RealAnna <89971034+RealAnna@users.noreply.github.com> Date: Fri, 1 Sep 2023 12:41:02 +0200 Subject: [PATCH 29/78] feat(metrics-operator): add analysis controller (#1875) Signed-off-by: realanna Signed-off-by: RealAnna <89971034+RealAnna@users.noreply.github.com> Signed-off-by: Florian Bacher Co-authored-by: Florian Bacher Co-authored-by: Giovanni Liva --- .../actions/deploy-klt-on-cluster/action.yml | 1 + .../scripts/.helm-tests/default/result.yaml | 344 +++++--- .github/workflows/golangci-lint.yml | 2 - .../docs/crd-ref/metrics/v1alpha3/_index.md | 38 +- helm/chart/README.md | 2 + helm/chart/doc.yaml | 2 + helm/chart/templates/analysis-crd.yaml | 182 +++-- helm/chart/templates/deployment.yaml | 5 + .../templates/metrics-operator-rbac.yaml | 158 ++-- helm/chart/values.yaml | 2 + .../lifecycle.keptn.sh_keptnappversions.yaml | 16 +- ...fecycle.keptn.sh_keptntaskdefinitions.yaml | 6 +- ...cycle.keptn.sh_keptnworkloadinstances.yaml | 16 +- metrics-operator/PROJECT | 1 + .../api/v1alpha3/analysis_types.go | 30 +- .../v1alpha3/analysisdefinition_webhook.go | 2 +- .../api/v1alpha3/zz_generated.deepcopy.go | 39 + metrics-operator/cmd/fake/manager_mock.go | 773 ------------------ metrics-operator/cmd/fake/provider_mock.go | 65 -- .../cmd/fake/webhookmanager_mock.go | 72 -- metrics-operator/cmd/manager/manager.go | 13 - .../crd/bases/metrics.keptn.sh_analyses.yaml | 52 +- metrics-operator/config/manager/manager.yaml | 4 + metrics-operator/config/rbac/role.yaml | 42 + .../samples/metrics_v1alpha3_analysis.yaml | 1 + .../metrics_v1alpha3_analysisdefinition.yaml | 5 +- ...etrics_v1alpha3_analysisvaluetemplate.yaml | 3 +- .../controllers/analysis/controller.go | 173 ++++ .../controllers/analysis/controller_test.go | 236 ++++++ .../analysis/fake/analysispool_mock.go | 72 ++ .../analysis/fake/evaluator_mock.go | 84 ++ .../analysis/fake/providers_pool_mock.go | 202 +++++ .../analysis/objectives_assigner.go | 32 + .../analysis/objectives_assigner_test.go | 67 ++ .../analysis/objectives_evaluator.go | 49 ++ .../analysis/objectives_evaluator_test.go | 124 +++ .../controllers/analysis/provider_selector.go | 138 ++++ .../analysis/provider_selector_test.go | 182 +++++ .../controllers/analysis/worker_pool.go | 99 +++ .../controllers/analysis/worker_pool_test.go | 114 +++ .../common/analysis/analysis_evaluator.go | 2 +- .../analysis/analysis_evaluator_test.go | 24 +- .../analysis/fake/analysis_evaluator_mock.go | 14 +- .../analysis/fake/objective_evaluator_mock.go | 14 +- .../analysis/fake/operator_evaluator_mock.go | 78 ++ .../controllers/common/analysis/interfaces.go | 4 +- .../common/analysis/objective_evaluator.go | 11 +- .../analysis/objective_evaluator_test.go | 38 +- .../common/analysis/target_evaluator.go | 2 +- .../common/analysis/target_evaluator_test.go | 2 +- .../common/analysis/types/types.go | 40 +- .../common/providers/datadog/datadog.go | 5 +- .../common/providers/datadog/datadog_test.go | 48 ++ .../common/providers/dynatrace/dynatrace.go | 5 +- .../providers/dynatrace/dynatrace_dql.go | 2 +- .../common/providers/fake/provider_mock.go | 146 ++++ .../common/providers/prometheus/prometheus.go | 10 +- .../providers/prometheus/prometheus_test.go | 2 +- .../controllers/common/providers/provider.go | 6 +- metrics-operator/go.mod | 4 +- metrics-operator/main.go | 65 +- .../analysis-controller/00-install.yaml | 42 + .../00-teststep-template.yaml | 19 + .../analysis-controller/01-assert.yaml | 12 + .../analysis-controller/install.yaml | 14 + 65 files changed, 2751 insertions(+), 1306 deletions(-) delete mode 100644 metrics-operator/cmd/fake/manager_mock.go delete mode 100644 metrics-operator/cmd/fake/provider_mock.go delete mode 100644 metrics-operator/cmd/fake/webhookmanager_mock.go delete mode 100644 metrics-operator/cmd/manager/manager.go create mode 100644 metrics-operator/controllers/analysis/controller.go create mode 100644 metrics-operator/controllers/analysis/controller_test.go create mode 100644 metrics-operator/controllers/analysis/fake/analysispool_mock.go create mode 100644 metrics-operator/controllers/analysis/fake/evaluator_mock.go create mode 100644 metrics-operator/controllers/analysis/fake/providers_pool_mock.go create mode 100644 metrics-operator/controllers/analysis/objectives_assigner.go create mode 100644 metrics-operator/controllers/analysis/objectives_assigner_test.go create mode 100644 metrics-operator/controllers/analysis/objectives_evaluator.go create mode 100644 metrics-operator/controllers/analysis/objectives_evaluator_test.go create mode 100644 metrics-operator/controllers/analysis/provider_selector.go create mode 100644 metrics-operator/controllers/analysis/provider_selector_test.go create mode 100644 metrics-operator/controllers/analysis/worker_pool.go create mode 100644 metrics-operator/controllers/analysis/worker_pool_test.go create mode 100644 metrics-operator/controllers/common/analysis/fake/operator_evaluator_mock.go create mode 100644 metrics-operator/controllers/common/providers/fake/provider_mock.go create mode 100644 test/integration/analysis-controller/00-install.yaml create mode 100644 test/integration/analysis-controller/00-teststep-template.yaml create mode 100644 test/integration/analysis-controller/01-assert.yaml create mode 100644 test/integration/analysis-controller/install.yaml diff --git a/.github/actions/deploy-klt-on-cluster/action.yml b/.github/actions/deploy-klt-on-cluster/action.yml index 8bf2768a593..cde2d14e790 100644 --- a/.github/actions/deploy-klt-on-cluster/action.yml +++ b/.github/actions/deploy-klt-on-cluster/action.yml @@ -98,6 +98,7 @@ runs: --set lifecycleOperator.manager.image.tag=${{ inputs.runtime_tag }} \ --set lifecycleOperator.manager.image.repository="localhost:5000/keptn/lifecycle-operator" \ --set metricsOperator.manager.imagePullPolicy=Never \ + --set metricsOperator.manager.env.enableKeptnAnalysis="true" \ --set metricsOperator.manager.image.tag=${{ inputs.runtime_tag }} \ --set metricsOperator.manager.image.repository="localhost:5000/keptn/metrics-operator" \ --set lifecycleOperator.manager.env.functionRunnerImage=localhost:5000/keptn/deno-runtime:${{ inputs.runtime_tag }} \ diff --git a/.github/scripts/.helm-tests/default/result.yaml b/.github/scripts/.helm-tests/default/result.yaml index 366414eaf73..a46a56153b4 100644 --- a/.github/scripts/.helm-tests/default/result.yaml +++ b/.github/scripts/.helm-tests/default/result.yaml @@ -158,79 +158,127 @@ spec: singular: analysis scope: Namespaced versions: - - name: v1alpha3 - schema: - openAPIV3Schema: - description: Analysis is the Schema for the analyses API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation + - additionalPrinterColumns: + - jsonPath: .spec.analysisDefinition.name + name: AnalysisDefinition + type: string + - jsonPath: .status.warning + name: Warning + type: string + - jsonPath: .status.pass + name: Pass + type: string + name: v1alpha3 + schema: + openAPIV3Schema: + description: Analysis is the Schema for the analyses API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: AnalysisSpec defines the desired state of Analysis - properties: - analysisDefinition: - description: AnalysisDefinition refers to the AnalysisDefinition, a - CRD that stores the AnalysisValuesTemplates - properties: - name: - description: Name of the AnalysisDefinition + type: string + metadata: + type: object + spec: + description: AnalysisSpec defines the desired state of Analysis + properties: + analysisDefinition: + description: AnalysisDefinition refers to the AnalysisDefinition, + a CRD that stores the AnalysisValuesTemplates + properties: + name: + description: Name defines the name of the referenced object + type: string + namespace: + description: Namespace defines the namespace of the referenced + object + type: string + required: + - name + type: object + args: + additionalProperties: type: string - required: - - name - type: object - args: - additionalProperties: + description: Args corresponds to a map of key/value pairs that can + be used to substitute placeholders in the AnalysisValueTemplate + query. i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:)". + type: object + timeframe: + description: Timeframe specifies the range for the corresponding query + in the AnalysisValueTemplate + properties: + from: + description: From is the time of start for the query, this field + follows RFC3339 time format + format: date-time + type: string + to: + description: To is the time of end for the query, this field follows + RFC3339 time format + format: date-time + type: string + required: + - from + - to + type: object + required: + - analysisDefinition + - timeframe + type: object + status: + description: AnalysisStatus stores the status of the overall analysis + returns also pass or warnings + properties: + pass: + description: Pass returns whether the SLO is satisfied + type: boolean + raw: + description: Raw contains the raw result of the SLO computation type: string - description: Args corresponds to a map of key/value pairs that can be - used to substitute placeholders in the AnalysisValueTemplate query. - The placeholder must be the capitalized version of the key; i.e. for - args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:)". - type: object - timeframe: - description: Timeframe specifies the range for the corresponding query - in the AnalysisValueTemplate - properties: - from: - description: From is the time of start for the query, this field - follows RFC3339 time format - format: date-time - type: string - to: - description: To is the time of end for the query, this field follows - RFC3339 time format - format: date-time - type: string - required: - - from - - to - type: object - required: - - analysisDefinition - - timeframe - type: object - status: - type: string - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] + storedValues: + additionalProperties: + description: ProviderResult stores reference of already collected + provider query associated to its objective template + properties: + errMsg: + description: ErrMsg stores any possible error at retrieval time + type: string + objectiveReference: + description: Objective store reference to corresponding objective + template + properties: + name: + description: Name defines the name of the referenced object + type: string + namespace: + description: Namespace defines the namespace of the referenced + object + type: string + required: + - name + type: object + value: + description: Value is the value the provider returned + type: string + type: object + description: StoredValues contains all analysis values that have already + been retrieved successfully + type: object + warning: + description: Warning returns whether the analysis returned a warning + type: boolean + type: object + type: object + served: true + storage: true + subresources: + status: {} --- # Source: klt/templates/analysisdefinition-crd.yaml apiVersion: apiextensions.k8s.io/v1 @@ -6964,58 +7012,100 @@ metadata: app.kubernetes.io/version: "v0.8.1" app.kubernetes.io/managed-by: Helm rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - secrets - verbs: - - get -- apiGroups: - - metrics.keptn.sh - resources: - - keptnmetrics - verbs: - - get - - list - - watch -- apiGroups: - - metrics.keptn.sh - resources: - - keptnmetrics/finalizers - verbs: - - update -- apiGroups: - - metrics.keptn.sh - resources: - - keptnmetrics/status - verbs: - - get - - patch - - update -- apiGroups: - - metrics.keptn.sh - resources: - - keptnmetricsproviders - verbs: - - get - - list - - watch -- apiGroups: - - metrics.keptn.sh - resources: - - providers - verbs: - - get - - list - - watch + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - apiGroups: + - "" + resources: + - secrets + verbs: + - get + - apiGroups: + - metrics.keptn.sh + resources: + - analyses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - analyses/finalizers + verbs: + - update + - apiGroups: + - metrics.keptn.sh + resources: + - analyses/status + verbs: + - get + - patch + - update + - apiGroups: + - metrics.keptn.sh + resources: + - analysisdefinitions + verbs: + - get + - list + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - analysisvaluetemplates + verbs: + - get + - list + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - keptnmetrics + verbs: + - get + - list + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - keptnmetrics/finalizers + verbs: + - update + - apiGroups: + - metrics.keptn.sh + resources: + - keptnmetrics/status + verbs: + - get + - patch + - update + - apiGroups: + - metrics.keptn.sh + resources: + - keptnmetricsproviders + verbs: + - get + - list + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - providers + verbs: + - get + - list + - watch --- # Source: klt/templates/metrics-operator-server-resources-rbac.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -7184,9 +7274,9 @@ roleRef: kind: ClusterRole name: 'metrics-operator-role' subjects: -- kind: ServiceAccount - name: 'metrics-operator' - namespace: 'helmtests' + - kind: ServiceAccount + name: 'metrics-operator' + namespace: 'helmtests' --- # Source: klt/templates/system-auth-delegator-rbac.yaml apiVersion: rbac.authorization.k8s.io/v1 @@ -7528,9 +7618,9 @@ roleRef: kind: Role name: 'metrics-operator-role' subjects: -- kind: ServiceAccount - name: 'metrics-operator' - namespace: 'helmtests' + - kind: ServiceAccount + name: 'metrics-operator' + namespace: 'helmtests' --- # Source: klt/templates/lifecycle-operator-metrics-service.yaml apiVersion: v1 @@ -7901,8 +7991,12 @@ spec: fieldPath: metadata.name - name: EXPOSE_KEPTN_METRICS value: "true" + - name: ENABLE_ANALYSIS + value: "false" - name: METRICS_CONTROLLER_LOG_LEVEL value: "0" + - name: ANALYSIS_CONTROLLER_LOG_LEVEL + value: "0" - name: KUBERNETES_CLUSTER_DOMAIN value: cluster.local image: ghcr.io/keptn/metrics-operator:v0.8.1 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 22670818c11..59fa6737d98 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -43,8 +43,6 @@ jobs: with: go-version: ${{ env.GO_VERSION }} check-latest: true - cache: true - cache-dependency-path: '${{ matrix.config.folder }}go.sum' - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/docs/content/en/docs/crd-ref/metrics/v1alpha3/_index.md b/docs/content/en/docs/crd-ref/metrics/v1alpha3/_index.md index 8e33f0f64a4..a71097cd67a 100644 --- a/docs/content/en/docs/crd-ref/metrics/v1alpha3/_index.md +++ b/docs/content/en/docs/crd-ref/metrics/v1alpha3/_index.md @@ -41,7 +41,7 @@ _Appears in:_ | `kind` _string_ | `Analysis` | `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | `spec` _[AnalysisSpec](#analysisspec)_ | | -| `status` _string_ | | +| `status` _[AnalysisStatus](#analysisstatus)_ | | #### AnalysisDefinition @@ -121,10 +121,27 @@ _Appears in:_ | Field | Description | | --- | --- | | `timeframe` _[Timeframe](#timeframe)_ | Timeframe specifies the range for the corresponding query in the AnalysisValueTemplate | -| `args` _object (keys:string, values:string)_ | Args corresponds to a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate query. The placeholder must be the capitalized version of the key; i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:{{.Foo}})". | +| `args` _object (keys:string, values:string)_ | Args corresponds to a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate query. i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:{{.foo}})". | | `analysisDefinition` _[ObjectReference](#objectreference)_ | AnalysisDefinition refers to the AnalysisDefinition, a CRD that stores the AnalysisValuesTemplates | +#### AnalysisStatus + + + +AnalysisStatus stores the status of the overall analysis returns also pass or warnings + +_Appears in:_ +- [Analysis](#analysis) + +| Field | Description | +| --- | --- | +| `raw` _string_ | Raw contains the raw result of the SLO computation | +| `pass` _boolean_ | Pass returns whether the SLO is satisfied | +| `warning` _boolean_ | Warning returns whether the analysis returned a warning | +| `storedValues` _object (keys:string, values:[ProviderResult](#providerresult))_ | StoredValues contains all analysis values that have already been retrieved successfully | + + #### AnalysisValueTemplate @@ -302,6 +319,7 @@ _Appears in:_ - [AnalysisSpec](#analysisspec) - [AnalysisValueTemplateSpec](#analysisvaluetemplatespec) - [Objective](#objective) +- [ProviderResult](#providerresult) | Field | Description | | --- | --- | @@ -374,6 +392,22 @@ _Appears in:_ | `name` _string_ | Name of the provider | +#### ProviderResult + + + +ProviderResult stores reference of already collected provider query associated to its objective template + +_Appears in:_ +- [AnalysisStatus](#analysisstatus) + +| Field | Description | +| --- | --- | +| `objectiveReference` _[ObjectReference](#objectreference)_ | Objective store reference to corresponding objective template | +| `value` _string_ | Value is the value the provider returned | +| `errMsg` _string_ | ErrMsg stores any possible error at retrieval time | + + #### RangeSpec diff --git a/helm/chart/README.md b/helm/chart/README.md index 28be306b4c7..192403a86c5 100644 --- a/helm/chart/README.md +++ b/helm/chart/README.md @@ -150,6 +150,8 @@ checks | `metricsOperator.manager.image.tag` | select tag for manager image | `v0.8.1` | | `metricsOperator.manager.env.exposeKeptnMetrics` | enable metrics exporter | `true` | | `metricsOperator.manager.env.metricsControllerLogLevel` | sets the log level of Metrics Controller | `0` | +| `metricsOperator.manager.env.analysisControllerLogLevel` | sets the log level of Analysis Controller | `0` | +| `metricsOperator.manager.env.enableKeptnAnalysis` | enables/disables the analysis feature | `false` | | `metricsOperator.manager.livenessProbe` | custom livenessprobe for manager container | | | `metricsOperator.manager.readinessProbe` | custom readinessprobe for manager container | | | `metricsOperator.manager.resources` | specify limits and requests for manager container | | diff --git a/helm/chart/doc.yaml b/helm/chart/doc.yaml index c6a29380198..9c52fa3a3b5 100644 --- a/helm/chart/doc.yaml +++ b/helm/chart/doc.yaml @@ -210,6 +210,8 @@ ## @param metricsOperator.manager.env.exposeKeptnMetrics enable metrics exporter ## @param metricsOperator.manager.env.metricsControllerLogLevel sets the log level of Metrics Controller +## @param metricsOperator.manager.env.analysisControllerLogLevel sets the log level of Analysis Controller +## @param metricsOperator.manager.env.enableKeptnAnalysis enables/disables the analysis feature ## @extra metricsOperator.manager.livenessProbe custom livenessprobe for manager container ## @skip metricsOperator.manager.livenessProbe.httpGet.path diff --git a/helm/chart/templates/analysis-crd.yaml b/helm/chart/templates/analysis-crd.yaml index 6c6558106d1..bc0d97f2f33 100644 --- a/helm/chart/templates/analysis-crd.yaml +++ b/helm/chart/templates/analysis-crd.yaml @@ -19,76 +19,124 @@ spec: singular: analysis scope: Namespaced versions: - - name: v1alpha3 - schema: - openAPIV3Schema: - description: Analysis is the Schema for the analyses API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation + - additionalPrinterColumns: + - jsonPath: .spec.analysisDefinition.name + name: AnalysisDefinition + type: string + - jsonPath: .status.warning + name: Warning + type: string + - jsonPath: .status.pass + name: Pass + type: string + name: v1alpha3 + schema: + openAPIV3Schema: + description: Analysis is the Schema for the analyses API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: AnalysisSpec defines the desired state of Analysis - properties: - analysisDefinition: - description: AnalysisDefinition refers to the AnalysisDefinition, a - CRD that stores the AnalysisValuesTemplates - properties: - name: - description: Name of the AnalysisDefinition + type: string + metadata: + type: object + spec: + description: AnalysisSpec defines the desired state of Analysis + properties: + analysisDefinition: + description: AnalysisDefinition refers to the AnalysisDefinition, + a CRD that stores the AnalysisValuesTemplates + properties: + name: + description: Name defines the name of the referenced object + type: string + namespace: + description: Namespace defines the namespace of the referenced + object + type: string + required: + - name + type: object + args: + additionalProperties: type: string - required: - - name - type: object - args: - additionalProperties: + description: Args corresponds to a map of key/value pairs that can + be used to substitute placeholders in the AnalysisValueTemplate + query. i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:{{.foo}})". + type: object + timeframe: + description: Timeframe specifies the range for the corresponding query + in the AnalysisValueTemplate + properties: + from: + description: From is the time of start for the query, this field + follows RFC3339 time format + format: date-time + type: string + to: + description: To is the time of end for the query, this field follows + RFC3339 time format + format: date-time + type: string + required: + - from + - to + type: object + required: + - analysisDefinition + - timeframe + type: object + status: + description: AnalysisStatus stores the status of the overall analysis + returns also pass or warnings + properties: + pass: + description: Pass returns whether the SLO is satisfied + type: boolean + raw: + description: Raw contains the raw result of the SLO computation type: string - description: Args corresponds to a map of key/value pairs that can be - used to substitute placeholders in the AnalysisValueTemplate query. - The placeholder must be the capitalized version of the key; i.e. for - args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:{{.Foo}})". - type: object - timeframe: - description: Timeframe specifies the range for the corresponding query - in the AnalysisValueTemplate - properties: - from: - description: From is the time of start for the query, this field - follows RFC3339 time format - format: date-time - type: string - to: - description: To is the time of end for the query, this field follows - RFC3339 time format - format: date-time - type: string - required: - - from - - to - type: object - required: - - analysisDefinition - - timeframe - type: object - status: - type: string - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] + storedValues: + additionalProperties: + description: ProviderResult stores reference of already collected + provider query associated to its objective template + properties: + errMsg: + description: ErrMsg stores any possible error at retrieval time + type: string + objectiveReference: + description: Objective store reference to corresponding objective + template + properties: + name: + description: Name defines the name of the referenced object + type: string + namespace: + description: Namespace defines the namespace of the referenced + object + type: string + required: + - name + type: object + value: + description: Value is the value the provider returned + type: string + type: object + description: StoredValues contains all analysis values that have already + been retrieved successfully + type: object + warning: + description: Warning returns whether the analysis returned a warning + type: boolean + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/helm/chart/templates/deployment.yaml b/helm/chart/templates/deployment.yaml index f126962e4cc..bcd42bb59da 100644 --- a/helm/chart/templates/deployment.yaml +++ b/helm/chart/templates/deployment.yaml @@ -322,9 +322,14 @@ spec: fieldPath: metadata.name - name: EXPOSE_KEPTN_METRICS value: {{ .Values.metricsOperator.manager.env.exposeKeptnMetrics | quote }} + - name: ENABLE_ANALYSIS + value: {{ .Values.metricsOperator.manager.env.enableKeptnAnalysis | quote }} - name: METRICS_CONTROLLER_LOG_LEVEL value: {{ .Values.metricsOperator.manager.env.metricsControllerLogLevel | quote }} + - name: ANALYSIS_CONTROLLER_LOG_LEVEL + value: {{ .Values.metricsOperator.manager.env.analysisControllerLogLevel | quote + }} - name: KUBERNETES_CLUSTER_DOMAIN value: {{ .Values.kubernetesClusterDomain }} image: {{ .Values.metricsOperator.manager.image.repository }}:{{ .Values.metricsOperator.manager.image.tag diff --git a/helm/chart/templates/metrics-operator-rbac.yaml b/helm/chart/templates/metrics-operator-rbac.yaml index b21f94b752f..a3616483642 100644 --- a/helm/chart/templates/metrics-operator-rbac.yaml +++ b/helm/chart/templates/metrics-operator-rbac.yaml @@ -6,58 +6,100 @@ metadata: labels: {{- include "chart.labels" . | nindent 4 }} rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - secrets - verbs: - - get -- apiGroups: - - metrics.keptn.sh - resources: - - keptnmetrics - verbs: - - get - - list - - watch -- apiGroups: - - metrics.keptn.sh - resources: - - keptnmetrics/finalizers - verbs: - - update -- apiGroups: - - metrics.keptn.sh - resources: - - keptnmetrics/status - verbs: - - get - - patch - - update -- apiGroups: - - metrics.keptn.sh - resources: - - keptnmetricsproviders - verbs: - - get - - list - - watch -- apiGroups: - - metrics.keptn.sh - resources: - - providers - verbs: - - get - - list - - watch + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - apiGroups: + - "" + resources: + - secrets + verbs: + - get + - apiGroups: + - metrics.keptn.sh + resources: + - analyses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - analyses/finalizers + verbs: + - update + - apiGroups: + - metrics.keptn.sh + resources: + - analyses/status + verbs: + - get + - patch + - update + - apiGroups: + - metrics.keptn.sh + resources: + - analysisdefinitions + verbs: + - get + - list + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - analysisvaluetemplates + verbs: + - get + - list + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - keptnmetrics + verbs: + - get + - list + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - keptnmetrics/finalizers + verbs: + - update + - apiGroups: + - metrics.keptn.sh + resources: + - keptnmetrics/status + verbs: + - get + - patch + - update + - apiGroups: + - metrics.keptn.sh + resources: + - keptnmetricsproviders + verbs: + - get + - list + - watch + - apiGroups: + - metrics.keptn.sh + resources: + - providers + verbs: + - get + - list + - watch --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -71,9 +113,9 @@ roleRef: kind: Role name: 'metrics-operator-role' subjects: -- kind: ServiceAccount - name: 'metrics-operator' - namespace: '{{ .Release.Namespace }}' + - kind: ServiceAccount + name: 'metrics-operator' + namespace: '{{ .Release.Namespace }}' --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -87,6 +129,6 @@ roleRef: kind: ClusterRole name: 'metrics-operator-role' subjects: -- kind: ServiceAccount - name: 'metrics-operator' - namespace: '{{ .Release.Namespace }}' \ No newline at end of file + - kind: ServiceAccount + name: 'metrics-operator' + namespace: '{{ .Release.Namespace }}' \ No newline at end of file diff --git a/helm/chart/values.yaml b/helm/chart/values.yaml index 7fd975846fb..5d95ac1a418 100644 --- a/helm/chart/values.yaml +++ b/helm/chart/values.yaml @@ -145,7 +145,9 @@ metricsOperator: type: RuntimeDefault env: exposeKeptnMetrics: "true" + enableKeptnAnalysis: "false" metricsControllerLogLevel: "0" + analysisControllerLogLevel: "0" image: repository: ghcr.io/keptn/metrics-operator tag: v0.8.1 diff --git a/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptnappversions.yaml b/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptnappversions.yaml index dd5a401fe28..98ded09010d 100644 --- a/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptnappversions.yaml +++ b/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptnappversions.yaml @@ -361,7 +361,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: format: date-time @@ -384,7 +384,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: format: date-time @@ -407,7 +407,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: format: date-time @@ -430,7 +430,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: format: date-time @@ -638,7 +638,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: description: EndTime represents the time at which the Item (Evaluation/Task) @@ -669,7 +669,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: description: EndTime represents the time at which the Item (Evaluation/Task) @@ -700,7 +700,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: description: EndTime represents the time at which the Item (Evaluation/Task) @@ -731,7 +731,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: description: EndTime represents the time at which the Item (Evaluation/Task) diff --git a/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptntaskdefinitions.yaml b/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptntaskdefinitions.yaml index 187e3d415bf..ed15b5a8009 100644 --- a/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptntaskdefinitions.yaml +++ b/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptntaskdefinitions.yaml @@ -1446,7 +1446,7 @@ spec: execute the same logic, but each with different parameters. properties: name: - description: Name is the name of the referenced KeptnTaksDefinition. + description: Name is the name of the referenced KeptnTaskDefinition. type: string type: object httpRef: @@ -1520,7 +1520,7 @@ spec: execute the same logic, but each with different parameters. properties: name: - description: Name is the name of the referenced KeptnTaksDefinition. + description: Name is the name of the referenced KeptnTaskDefinition. type: string type: object httpRef: @@ -1594,7 +1594,7 @@ spec: execute the same logic, but each with different parameters. properties: name: - description: Name is the name of the referenced KeptnTaksDefinition. + description: Name is the name of the referenced KeptnTaskDefinition. type: string type: object httpRef: diff --git a/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptnworkloadinstances.yaml b/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptnworkloadinstances.yaml index e1eb94cb13f..3525231f1c9 100644 --- a/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptnworkloadinstances.yaml +++ b/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptnworkloadinstances.yaml @@ -371,7 +371,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: format: date-time @@ -394,7 +394,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: format: date-time @@ -417,7 +417,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: format: date-time @@ -440,7 +440,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: format: date-time @@ -639,7 +639,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: description: EndTime represents the time at which the Item (Evaluation/Task) @@ -670,7 +670,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: description: EndTime represents the time at which the Item (Evaluation/Task) @@ -701,7 +701,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: description: EndTime represents the time at which the Item (Evaluation/Task) @@ -732,7 +732,7 @@ spec: items: properties: definitionName: - description: DefinitionName is the name of the EvaluationDefinition/TaskDefiniton + description: DefinitionName is the name of the EvaluationDefinition/TaskDefinition type: string endTime: description: EndTime represents the time at which the Item (Evaluation/Task) diff --git a/metrics-operator/PROJECT b/metrics-operator/PROJECT index 7fadd11475b..025e37b7068 100644 --- a/metrics-operator/PROJECT +++ b/metrics-operator/PROJECT @@ -67,6 +67,7 @@ resources: - api: crdVersion: v1 namespaced: true + controller: true domain: keptn.sh group: metrics kind: Analysis diff --git a/metrics-operator/api/v1alpha3/analysis_types.go b/metrics-operator/api/v1alpha3/analysis_types.go index e5e5985d85e..45d76dc82a4 100644 --- a/metrics-operator/api/v1alpha3/analysis_types.go +++ b/metrics-operator/api/v1alpha3/analysis_types.go @@ -24,23 +24,47 @@ import ( type AnalysisSpec struct { //Timeframe specifies the range for the corresponding query in the AnalysisValueTemplate Timeframe `json:"timeframe"` - // Args corresponds to a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate query. The placeholder must be the capitalized version of the key; i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:{{.Foo}})". + // Args corresponds to a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate query. i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:{{.foo}})". Args map[string]string `json:"args,omitempty"` // AnalysisDefinition refers to the AnalysisDefinition, a CRD that stores the AnalysisValuesTemplates AnalysisDefinition ObjectReference `json:"analysisDefinition"` } +// ProviderResult stores reference of already collected provider query associated to its objective template +type ProviderResult struct { + // Objective store reference to corresponding objective template + Objective ObjectReference `json:"objectiveReference,omitempty"` + // Value is the value the provider returned + Value string `json:"value,omitempty"` + // ErrMsg stores any possible error at retrieval time + ErrMsg string `json:"errMsg,omitempty"` +} + +// AnalysisStatus stores the status of the overall analysis returns also pass or warnings +type AnalysisStatus struct { + // Raw contains the raw result of the SLO computation + Raw string `json:"raw,omitempty"` + // Pass returns whether the SLO is satisfied + Pass bool `json:"pass,omitempty"` + // Warning returns whether the analysis returned a warning + Warning bool `json:"warning,omitempty"` + // StoredValues contains all analysis values that have already been retrieved successfully + StoredValues map[string]ProviderResult `json:"storedValues,omitempty"` +} + //+kubebuilder:object:root=true //+kubebuilder:subresource:status //+kubebuilder:printcolumn:name="AnalysisDefinition",type=string,JSONPath=.spec.analysisDefinition.name +//+kubebuilder:printcolumn:name="Warning",type=string,JSONPath=`.status.warning` +//+kubebuilder:printcolumn:name="Pass",type=string,JSONPath=`.status.pass` // Analysis is the Schema for the analyses API type Analysis struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec AnalysisSpec `json:"spec,omitempty"` - Status string `json:"status,omitempty"` + Spec AnalysisSpec `json:"spec,omitempty"` + Status AnalysisStatus `json:"status,omitempty"` } //+kubebuilder:object:root=true diff --git a/metrics-operator/api/v1alpha3/analysisdefinition_webhook.go b/metrics-operator/api/v1alpha3/analysisdefinition_webhook.go index d3892adc899..c829a233126 100644 --- a/metrics-operator/api/v1alpha3/analysisdefinition_webhook.go +++ b/metrics-operator/api/v1alpha3/analysisdefinition_webhook.go @@ -34,7 +34,7 @@ func (r *AnalysisDefinition) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -//+kubebuilder:webhook:path=/validate-metrics-keptn-sh-v1alpha3-analysisdefinition,mutating=false,failurePolicy=fail,sideEffects=None,groups=metrics.keptn.sh,resources=analysisdefinitions,verbs=create;update,versions=v1alpha3,name=vanalysisdefinition.kb.io,admissionReviewVersions=v1 +//+kubebuilder:webhook:path=/validate-metrics-keptn-sh-v1alpha3-analysisdefinition,mutating=false,failurePolicy=fail,sideEffects=None,groups=metrics.keptn.sh,resources=analysisdefinitions,verbs=create;update,versions=v1alpha3,name=analysisdefinition.kb.io,admissionReviewVersions=v1 var _ webhook.Validator = &AnalysisDefinition{} diff --git a/metrics-operator/api/v1alpha3/zz_generated.deepcopy.go b/metrics-operator/api/v1alpha3/zz_generated.deepcopy.go index 052d20177a4..6513e3b22c3 100644 --- a/metrics-operator/api/v1alpha3/zz_generated.deepcopy.go +++ b/metrics-operator/api/v1alpha3/zz_generated.deepcopy.go @@ -31,6 +31,7 @@ func (in *Analysis) DeepCopyInto(out *Analysis) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Analysis. @@ -188,6 +189,28 @@ func (in *AnalysisSpec) DeepCopy() *AnalysisSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AnalysisStatus) DeepCopyInto(out *AnalysisStatus) { + *out = *in + if in.StoredValues != nil { + in, out := &in.StoredValues, &out.StoredValues + *out = make(map[string]ProviderResult, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnalysisStatus. +func (in *AnalysisStatus) DeepCopy() *AnalysisStatus { + if in == nil { + return nil + } + out := new(AnalysisStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AnalysisValueTemplate) DeepCopyInto(out *AnalysisValueTemplate) { *out = *in @@ -550,6 +573,22 @@ func (in *ProviderRef) DeepCopy() *ProviderRef { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProviderResult) DeepCopyInto(out *ProviderResult) { + *out = *in + out.Objective = in.Objective +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderResult. +func (in *ProviderResult) DeepCopy() *ProviderResult { + if in == nil { + return nil + } + out := new(ProviderResult) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RangeSpec) DeepCopyInto(out *RangeSpec) { *out = *in diff --git a/metrics-operator/cmd/fake/manager_mock.go b/metrics-operator/cmd/fake/manager_mock.go deleted file mode 100644 index 73324216a15..00000000000 --- a/metrics-operator/cmd/fake/manager_mock.go +++ /dev/null @@ -1,773 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package fake - -import ( - "context" - "net/http" - "sync" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/record" - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" - "sigs.k8s.io/controller-runtime/pkg/healthz" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// MockManager is a mock implementation of manager.IManager. -// -// func TestSomethingThatUsesIManager(t *testing.T) { -// -// // make and configure a mocked manager.IManager -// mockedIManager := &MockManager{ -// AddFunc: func(runnable manager.Runnable) error { -// panic("mock out the Add method") -// }, -// AddHealthzCheckFunc: func(name string, check healthz.Checker) error { -// panic("mock out the AddHealthzCheck method") -// }, -// AddMetricsExtraHandlerFunc: func(path string, handler http.Handler) error { -// panic("mock out the AddMetricsExtraHandler method") -// }, -// AddReadyzCheckFunc: func(name string, check healthz.Checker) error { -// panic("mock out the AddReadyzCheck method") -// }, -// ElectedFunc: func() <-chan struct{} { -// panic("mock out the Elected method") -// }, -// GetAPIReaderFunc: func() client.Reader { -// panic("mock out the GetAPIReader method") -// }, -// GetCacheFunc: func() cache.Cache { -// panic("mock out the GetCache method") -// }, -// GetClientFunc: func() client.Client { -// panic("mock out the GetClient method") -// }, -// GetConfigFunc: func() *rest.Config { -// panic("mock out the GetConfig method") -// }, -// GetControllerOptionsFunc: func() v1alpha1.ControllerConfigurationSpec { -// panic("mock out the GetControllerOptions method") -// }, -// GetEventRecorderForFunc: func(name string) record.EventRecorder { -// panic("mock out the GetEventRecorderFor method") -// }, -// GetFieldIndexerFunc: func() client.FieldIndexer { -// panic("mock out the GetFieldIndexer method") -// }, -// GetLoggerFunc: func() logr.Logger { -// panic("mock out the GetLogger method") -// }, -// GetRESTMapperFunc: func() meta.RESTMapper { -// panic("mock out the GetRESTMapper method") -// }, -// GetSchemeFunc: func() *runtime.Scheme { -// panic("mock out the GetScheme method") -// }, -// GetWebhookServerFunc: func() *webhook.Server { -// panic("mock out the GetWebhookServer method") -// }, -// SetFieldsFunc: func(ifaceVal interface{}) error { -// panic("mock out the SetFields method") -// }, -// StartFunc: func(ctx context.Context) error { -// panic("mock out the Start method") -// }, -// } -// -// // use mockedIManager in code that requires manager.IManager -// // and then make assertions. -// -// } -type MockManager struct { - // AddFunc mocks the Add method. - AddFunc func(runnable manager.Runnable) error - - // AddHealthzCheckFunc mocks the AddHealthzCheck method. - AddHealthzCheckFunc func(name string, check healthz.Checker) error - - // AddMetricsExtraHandlerFunc mocks the AddMetricsExtraHandler method. - AddMetricsExtraHandlerFunc func(path string, handler http.Handler) error - - // AddReadyzCheckFunc mocks the AddReadyzCheck method. - AddReadyzCheckFunc func(name string, check healthz.Checker) error - - // ElectedFunc mocks the Elected method. - ElectedFunc func() <-chan struct{} - - // GetAPIReaderFunc mocks the GetAPIReader method. - GetAPIReaderFunc func() client.Reader - - // GetCacheFunc mocks the GetCache method. - GetCacheFunc func() cache.Cache - - // GetClientFunc mocks the GetClient method. - GetClientFunc func() client.Client - - // GetConfigFunc mocks the GetConfig method. - GetConfigFunc func() *rest.Config - - // GetControllerOptionsFunc mocks the GetControllerOptions method. - GetControllerOptionsFunc func() v1alpha1.ControllerConfigurationSpec - - // GetEventRecorderForFunc mocks the GetEventRecorderFor method. - GetEventRecorderForFunc func(name string) record.EventRecorder - - // GetFieldIndexerFunc mocks the GetFieldIndexer method. - GetFieldIndexerFunc func() client.FieldIndexer - - // GetLoggerFunc mocks the GetLogger method. - GetLoggerFunc func() logr.Logger - - // GetRESTMapperFunc mocks the GetRESTMapper method. - GetRESTMapperFunc func() meta.RESTMapper - - // GetSchemeFunc mocks the GetScheme method. - GetSchemeFunc func() *runtime.Scheme - - // GetWebhookServerFunc mocks the GetWebhookServer method. - GetWebhookServerFunc func() *webhook.Server - - // SetFieldsFunc mocks the SetFields method. - SetFieldsFunc func(ifaceVal interface{}) error - - // StartFunc mocks the Start method. - StartFunc func(ctx context.Context) error - - // calls tracks calls to the methods. - calls struct { - // Add holds details about calls to the Add method. - Add []struct { - // Runnable is the runnable argument value. - Runnable manager.Runnable - } - // AddHealthzCheck holds details about calls to the AddHealthzCheck method. - AddHealthzCheck []struct { - // Name is the name argument value. - Name string - // Check is the check argument value. - Check healthz.Checker - } - // AddMetricsExtraHandler holds details about calls to the AddMetricsExtraHandler method. - AddMetricsExtraHandler []struct { - // Path is the path argument value. - Path string - // Handler is the handler argument value. - Handler http.Handler - } - // AddReadyzCheck holds details about calls to the AddReadyzCheck method. - AddReadyzCheck []struct { - // Name is the name argument value. - Name string - // Check is the check argument value. - Check healthz.Checker - } - // Elected holds details about calls to the Elected method. - Elected []struct { - } - // GetAPIReader holds details about calls to the GetAPIReader method. - GetAPIReader []struct { - } - // GetCache holds details about calls to the GetCache method. - GetCache []struct { - } - // GetClient holds details about calls to the GetClient method. - GetClient []struct { - } - // GetConfig holds details about calls to the GetConfig method. - GetConfig []struct { - } - // GetControllerOptions holds details about calls to the GetControllerOptions method. - GetControllerOptions []struct { - } - // GetEventRecorderFor holds details about calls to the GetEventRecorderFor method. - GetEventRecorderFor []struct { - // Name is the name argument value. - Name string - } - // GetFieldIndexer holds details about calls to the GetFieldIndexer method. - GetFieldIndexer []struct { - } - // GetLogger holds details about calls to the GetLogger method. - GetLogger []struct { - } - // GetRESTMapper holds details about calls to the GetRESTMapper method. - GetRESTMapper []struct { - } - // GetScheme holds details about calls to the GetScheme method. - GetScheme []struct { - } - // GetWebhookServer holds details about calls to the GetWebhookServer method. - GetWebhookServer []struct { - } - // SetFields holds details about calls to the SetFields method. - SetFields []struct { - // IfaceVal is the ifaceVal argument value. - IfaceVal interface{} - } - // Start holds details about calls to the Start method. - Start []struct { - // Ctx is the ctx argument value. - Ctx context.Context - } - } - lockAdd sync.RWMutex - lockAddHealthzCheck sync.RWMutex - lockAddMetricsExtraHandler sync.RWMutex - lockAddReadyzCheck sync.RWMutex - lockElected sync.RWMutex - lockGetAPIReader sync.RWMutex - lockGetCache sync.RWMutex - lockGetClient sync.RWMutex - lockGetConfig sync.RWMutex - lockGetControllerOptions sync.RWMutex - lockGetEventRecorderFor sync.RWMutex - lockGetFieldIndexer sync.RWMutex - lockGetLogger sync.RWMutex - lockGetRESTMapper sync.RWMutex - lockGetScheme sync.RWMutex - lockGetWebhookServer sync.RWMutex - lockSetFields sync.RWMutex - lockStart sync.RWMutex -} - -// Add calls AddFunc. -func (mock *MockManager) Add(runnable manager.Runnable) error { - if mock.AddFunc == nil { - panic("MockManager.AddFunc: method is nil but IManager.Add was just called") - } - callInfo := struct { - Runnable manager.Runnable - }{ - Runnable: runnable, - } - mock.lockAdd.Lock() - mock.calls.Add = append(mock.calls.Add, callInfo) - mock.lockAdd.Unlock() - return mock.AddFunc(runnable) -} - -// AddCalls gets all the calls that were made to Add. -// Check the length with: -// -// len(mockedIManager.AddCalls()) -func (mock *MockManager) AddCalls() []struct { - Runnable manager.Runnable -} { - var calls []struct { - Runnable manager.Runnable - } - mock.lockAdd.RLock() - calls = mock.calls.Add - mock.lockAdd.RUnlock() - return calls -} - -// AddHealthzCheck calls AddHealthzCheckFunc. -func (mock *MockManager) AddHealthzCheck(name string, check healthz.Checker) error { - if mock.AddHealthzCheckFunc == nil { - panic("MockManager.AddHealthzCheckFunc: method is nil but IManager.AddHealthzCheck was just called") - } - callInfo := struct { - Name string - Check healthz.Checker - }{ - Name: name, - Check: check, - } - mock.lockAddHealthzCheck.Lock() - mock.calls.AddHealthzCheck = append(mock.calls.AddHealthzCheck, callInfo) - mock.lockAddHealthzCheck.Unlock() - return mock.AddHealthzCheckFunc(name, check) -} - -// AddHealthzCheckCalls gets all the calls that were made to AddHealthzCheck. -// Check the length with: -// -// len(mockedIManager.AddHealthzCheckCalls()) -func (mock *MockManager) AddHealthzCheckCalls() []struct { - Name string - Check healthz.Checker -} { - var calls []struct { - Name string - Check healthz.Checker - } - mock.lockAddHealthzCheck.RLock() - calls = mock.calls.AddHealthzCheck - mock.lockAddHealthzCheck.RUnlock() - return calls -} - -// AddMetricsExtraHandler calls AddMetricsExtraHandlerFunc. -func (mock *MockManager) AddMetricsExtraHandler(path string, handler http.Handler) error { - if mock.AddMetricsExtraHandlerFunc == nil { - panic("MockManager.AddMetricsExtraHandlerFunc: method is nil but IManager.AddMetricsExtraHandler was just called") - } - callInfo := struct { - Path string - Handler http.Handler - }{ - Path: path, - Handler: handler, - } - mock.lockAddMetricsExtraHandler.Lock() - mock.calls.AddMetricsExtraHandler = append(mock.calls.AddMetricsExtraHandler, callInfo) - mock.lockAddMetricsExtraHandler.Unlock() - return mock.AddMetricsExtraHandlerFunc(path, handler) -} - -// AddMetricsExtraHandlerCalls gets all the calls that were made to AddMetricsExtraHandler. -// Check the length with: -// -// len(mockedIManager.AddMetricsExtraHandlerCalls()) -func (mock *MockManager) AddMetricsExtraHandlerCalls() []struct { - Path string - Handler http.Handler -} { - var calls []struct { - Path string - Handler http.Handler - } - mock.lockAddMetricsExtraHandler.RLock() - calls = mock.calls.AddMetricsExtraHandler - mock.lockAddMetricsExtraHandler.RUnlock() - return calls -} - -// AddReadyzCheck calls AddReadyzCheckFunc. -func (mock *MockManager) AddReadyzCheck(name string, check healthz.Checker) error { - if mock.AddReadyzCheckFunc == nil { - panic("MockManager.AddReadyzCheckFunc: method is nil but IManager.AddReadyzCheck was just called") - } - callInfo := struct { - Name string - Check healthz.Checker - }{ - Name: name, - Check: check, - } - mock.lockAddReadyzCheck.Lock() - mock.calls.AddReadyzCheck = append(mock.calls.AddReadyzCheck, callInfo) - mock.lockAddReadyzCheck.Unlock() - return mock.AddReadyzCheckFunc(name, check) -} - -// AddReadyzCheckCalls gets all the calls that were made to AddReadyzCheck. -// Check the length with: -// -// len(mockedIManager.AddReadyzCheckCalls()) -func (mock *MockManager) AddReadyzCheckCalls() []struct { - Name string - Check healthz.Checker -} { - var calls []struct { - Name string - Check healthz.Checker - } - mock.lockAddReadyzCheck.RLock() - calls = mock.calls.AddReadyzCheck - mock.lockAddReadyzCheck.RUnlock() - return calls -} - -// Elected calls ElectedFunc. -func (mock *MockManager) Elected() <-chan struct{} { - if mock.ElectedFunc == nil { - panic("MockManager.ElectedFunc: method is nil but IManager.Elected was just called") - } - callInfo := struct { - }{} - mock.lockElected.Lock() - mock.calls.Elected = append(mock.calls.Elected, callInfo) - mock.lockElected.Unlock() - return mock.ElectedFunc() -} - -// ElectedCalls gets all the calls that were made to Elected. -// Check the length with: -// -// len(mockedIManager.ElectedCalls()) -func (mock *MockManager) ElectedCalls() []struct { -} { - var calls []struct { - } - mock.lockElected.RLock() - calls = mock.calls.Elected - mock.lockElected.RUnlock() - return calls -} - -// GetAPIReader calls GetAPIReaderFunc. -func (mock *MockManager) GetAPIReader() client.Reader { - if mock.GetAPIReaderFunc == nil { - panic("MockManager.GetAPIReaderFunc: method is nil but IManager.GetAPIReader was just called") - } - callInfo := struct { - }{} - mock.lockGetAPIReader.Lock() - mock.calls.GetAPIReader = append(mock.calls.GetAPIReader, callInfo) - mock.lockGetAPIReader.Unlock() - return mock.GetAPIReaderFunc() -} - -// GetAPIReaderCalls gets all the calls that were made to GetAPIReader. -// Check the length with: -// -// len(mockedIManager.GetAPIReaderCalls()) -func (mock *MockManager) GetAPIReaderCalls() []struct { -} { - var calls []struct { - } - mock.lockGetAPIReader.RLock() - calls = mock.calls.GetAPIReader - mock.lockGetAPIReader.RUnlock() - return calls -} - -// GetCache calls GetCacheFunc. -func (mock *MockManager) GetCache() cache.Cache { - if mock.GetCacheFunc == nil { - panic("MockManager.GetCacheFunc: method is nil but IManager.GetCache was just called") - } - callInfo := struct { - }{} - mock.lockGetCache.Lock() - mock.calls.GetCache = append(mock.calls.GetCache, callInfo) - mock.lockGetCache.Unlock() - return mock.GetCacheFunc() -} - -// GetCacheCalls gets all the calls that were made to GetCache. -// Check the length with: -// -// len(mockedIManager.GetCacheCalls()) -func (mock *MockManager) GetCacheCalls() []struct { -} { - var calls []struct { - } - mock.lockGetCache.RLock() - calls = mock.calls.GetCache - mock.lockGetCache.RUnlock() - return calls -} - -// GetClient calls GetClientFunc. -func (mock *MockManager) GetClient() client.Client { - if mock.GetClientFunc == nil { - panic("MockManager.GetClientFunc: method is nil but IManager.GetClient was just called") - } - callInfo := struct { - }{} - mock.lockGetClient.Lock() - mock.calls.GetClient = append(mock.calls.GetClient, callInfo) - mock.lockGetClient.Unlock() - return mock.GetClientFunc() -} - -// GetClientCalls gets all the calls that were made to GetClient. -// Check the length with: -// -// len(mockedIManager.GetClientCalls()) -func (mock *MockManager) GetClientCalls() []struct { -} { - var calls []struct { - } - mock.lockGetClient.RLock() - calls = mock.calls.GetClient - mock.lockGetClient.RUnlock() - return calls -} - -// GetConfig calls GetConfigFunc. -func (mock *MockManager) GetConfig() *rest.Config { - if mock.GetConfigFunc == nil { - panic("MockManager.GetConfigFunc: method is nil but IManager.GetConfig was just called") - } - callInfo := struct { - }{} - mock.lockGetConfig.Lock() - mock.calls.GetConfig = append(mock.calls.GetConfig, callInfo) - mock.lockGetConfig.Unlock() - return mock.GetConfigFunc() -} - -// GetConfigCalls gets all the calls that were made to GetConfig. -// Check the length with: -// -// len(mockedIManager.GetConfigCalls()) -func (mock *MockManager) GetConfigCalls() []struct { -} { - var calls []struct { - } - mock.lockGetConfig.RLock() - calls = mock.calls.GetConfig - mock.lockGetConfig.RUnlock() - return calls -} - -// GetControllerOptions calls GetControllerOptionsFunc. -func (mock *MockManager) GetControllerOptions() v1alpha1.ControllerConfigurationSpec { - if mock.GetControllerOptionsFunc == nil { - panic("MockManager.GetControllerOptionsFunc: method is nil but IManager.GetControllerOptions was just called") - } - callInfo := struct { - }{} - mock.lockGetControllerOptions.Lock() - mock.calls.GetControllerOptions = append(mock.calls.GetControllerOptions, callInfo) - mock.lockGetControllerOptions.Unlock() - return mock.GetControllerOptionsFunc() -} - -// GetControllerOptionsCalls gets all the calls that were made to GetControllerOptions. -// Check the length with: -// -// len(mockedIManager.GetControllerOptionsCalls()) -func (mock *MockManager) GetControllerOptionsCalls() []struct { -} { - var calls []struct { - } - mock.lockGetControllerOptions.RLock() - calls = mock.calls.GetControllerOptions - mock.lockGetControllerOptions.RUnlock() - return calls -} - -// GetEventRecorderFor calls GetEventRecorderForFunc. -func (mock *MockManager) GetEventRecorderFor(name string) record.EventRecorder { - if mock.GetEventRecorderForFunc == nil { - panic("MockManager.GetEventRecorderForFunc: method is nil but IManager.GetEventRecorderFor was just called") - } - callInfo := struct { - Name string - }{ - Name: name, - } - mock.lockGetEventRecorderFor.Lock() - mock.calls.GetEventRecorderFor = append(mock.calls.GetEventRecorderFor, callInfo) - mock.lockGetEventRecorderFor.Unlock() - return mock.GetEventRecorderForFunc(name) -} - -// GetEventRecorderForCalls gets all the calls that were made to GetEventRecorderFor. -// Check the length with: -// -// len(mockedIManager.GetEventRecorderForCalls()) -func (mock *MockManager) GetEventRecorderForCalls() []struct { - Name string -} { - var calls []struct { - Name string - } - mock.lockGetEventRecorderFor.RLock() - calls = mock.calls.GetEventRecorderFor - mock.lockGetEventRecorderFor.RUnlock() - return calls -} - -// GetFieldIndexer calls GetFieldIndexerFunc. -func (mock *MockManager) GetFieldIndexer() client.FieldIndexer { - if mock.GetFieldIndexerFunc == nil { - panic("MockManager.GetFieldIndexerFunc: method is nil but IManager.GetFieldIndexer was just called") - } - callInfo := struct { - }{} - mock.lockGetFieldIndexer.Lock() - mock.calls.GetFieldIndexer = append(mock.calls.GetFieldIndexer, callInfo) - mock.lockGetFieldIndexer.Unlock() - return mock.GetFieldIndexerFunc() -} - -// GetFieldIndexerCalls gets all the calls that were made to GetFieldIndexer. -// Check the length with: -// -// len(mockedIManager.GetFieldIndexerCalls()) -func (mock *MockManager) GetFieldIndexerCalls() []struct { -} { - var calls []struct { - } - mock.lockGetFieldIndexer.RLock() - calls = mock.calls.GetFieldIndexer - mock.lockGetFieldIndexer.RUnlock() - return calls -} - -// GetLogger calls GetLoggerFunc. -func (mock *MockManager) GetLogger() logr.Logger { - if mock.GetLoggerFunc == nil { - panic("MockManager.GetLoggerFunc: method is nil but IManager.GetLogger was just called") - } - callInfo := struct { - }{} - mock.lockGetLogger.Lock() - mock.calls.GetLogger = append(mock.calls.GetLogger, callInfo) - mock.lockGetLogger.Unlock() - return mock.GetLoggerFunc() -} - -// GetLoggerCalls gets all the calls that were made to GetLogger. -// Check the length with: -// -// len(mockedIManager.GetLoggerCalls()) -func (mock *MockManager) GetLoggerCalls() []struct { -} { - var calls []struct { - } - mock.lockGetLogger.RLock() - calls = mock.calls.GetLogger - mock.lockGetLogger.RUnlock() - return calls -} - -// GetRESTMapper calls GetRESTMapperFunc. -func (mock *MockManager) GetRESTMapper() meta.RESTMapper { - if mock.GetRESTMapperFunc == nil { - panic("MockManager.GetRESTMapperFunc: method is nil but IManager.GetRESTMapper was just called") - } - callInfo := struct { - }{} - mock.lockGetRESTMapper.Lock() - mock.calls.GetRESTMapper = append(mock.calls.GetRESTMapper, callInfo) - mock.lockGetRESTMapper.Unlock() - return mock.GetRESTMapperFunc() -} - -// GetRESTMapperCalls gets all the calls that were made to GetRESTMapper. -// Check the length with: -// -// len(mockedIManager.GetRESTMapperCalls()) -func (mock *MockManager) GetRESTMapperCalls() []struct { -} { - var calls []struct { - } - mock.lockGetRESTMapper.RLock() - calls = mock.calls.GetRESTMapper - mock.lockGetRESTMapper.RUnlock() - return calls -} - -// GetScheme calls GetSchemeFunc. -func (mock *MockManager) GetScheme() *runtime.Scheme { - if mock.GetSchemeFunc == nil { - panic("MockManager.GetSchemeFunc: method is nil but IManager.GetScheme was just called") - } - callInfo := struct { - }{} - mock.lockGetScheme.Lock() - mock.calls.GetScheme = append(mock.calls.GetScheme, callInfo) - mock.lockGetScheme.Unlock() - return mock.GetSchemeFunc() -} - -// GetSchemeCalls gets all the calls that were made to GetScheme. -// Check the length with: -// -// len(mockedIManager.GetSchemeCalls()) -func (mock *MockManager) GetSchemeCalls() []struct { -} { - var calls []struct { - } - mock.lockGetScheme.RLock() - calls = mock.calls.GetScheme - mock.lockGetScheme.RUnlock() - return calls -} - -// GetWebhookServer calls GetWebhookServerFunc. -func (mock *MockManager) GetWebhookServer() *webhook.Server { - if mock.GetWebhookServerFunc == nil { - panic("MockManager.GetWebhookServerFunc: method is nil but IManager.GetWebhookServer was just called") - } - callInfo := struct { - }{} - mock.lockGetWebhookServer.Lock() - mock.calls.GetWebhookServer = append(mock.calls.GetWebhookServer, callInfo) - mock.lockGetWebhookServer.Unlock() - return mock.GetWebhookServerFunc() -} - -// GetWebhookServerCalls gets all the calls that were made to GetWebhookServer. -// Check the length with: -// -// len(mockedIManager.GetWebhookServerCalls()) -func (mock *MockManager) GetWebhookServerCalls() []struct { -} { - var calls []struct { - } - mock.lockGetWebhookServer.RLock() - calls = mock.calls.GetWebhookServer - mock.lockGetWebhookServer.RUnlock() - return calls -} - -// SetFields calls SetFieldsFunc. -func (mock *MockManager) SetFields(ifaceVal interface{}) error { - if mock.SetFieldsFunc == nil { - panic("MockManager.SetFieldsFunc: method is nil but IManager.SetFields was just called") - } - callInfo := struct { - IfaceVal interface{} - }{ - IfaceVal: ifaceVal, - } - mock.lockSetFields.Lock() - mock.calls.SetFields = append(mock.calls.SetFields, callInfo) - mock.lockSetFields.Unlock() - return mock.SetFieldsFunc(ifaceVal) -} - -// SetFieldsCalls gets all the calls that were made to SetFields. -// Check the length with: -// -// len(mockedIManager.SetFieldsCalls()) -func (mock *MockManager) SetFieldsCalls() []struct { - IfaceVal interface{} -} { - var calls []struct { - IfaceVal interface{} - } - mock.lockSetFields.RLock() - calls = mock.calls.SetFields - mock.lockSetFields.RUnlock() - return calls -} - -// Start calls StartFunc. -func (mock *MockManager) Start(ctx context.Context) error { - if mock.StartFunc == nil { - panic("MockManager.StartFunc: method is nil but IManager.Start was just called") - } - callInfo := struct { - Ctx context.Context - }{ - Ctx: ctx, - } - mock.lockStart.Lock() - mock.calls.Start = append(mock.calls.Start, callInfo) - mock.lockStart.Unlock() - return mock.StartFunc(ctx) -} - -// StartCalls gets all the calls that were made to Start. -// Check the length with: -// -// len(mockedIManager.StartCalls()) -func (mock *MockManager) StartCalls() []struct { - Ctx context.Context -} { - var calls []struct { - Ctx context.Context - } - mock.lockStart.RLock() - calls = mock.calls.Start - mock.lockStart.RUnlock() - return calls -} diff --git a/metrics-operator/cmd/fake/provider_mock.go b/metrics-operator/cmd/fake/provider_mock.go deleted file mode 100644 index 0946fdd6eee..00000000000 --- a/metrics-operator/cmd/fake/provider_mock.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package fake - -import ( - "sync" - - "k8s.io/client-go/rest" -) - -// MockProvider is a mock implementation of config.Provider. -// -// func TestSomethingThatUsesProvider(t *testing.T) { -// -// // make and configure a mocked config.Provider -// mockedProvider := &MockProvider{ -// GetConfigFunc: func() (*rest.Config, error) { -// panic("mock out the GetConfig method") -// }, -// } -// -// // use mockedProvider in code that requires config.Provider -// // and then make assertions. -// -// } -type MockProvider struct { - // GetConfigFunc mocks the GetConfig method. - GetConfigFunc func() (*rest.Config, error) - - // calls tracks calls to the methods. - calls struct { - // GetConfig holds details about calls to the GetConfig method. - GetConfig []struct { - } - } - lockGetConfig sync.RWMutex -} - -// GetConfig calls GetConfigFunc. -func (mock *MockProvider) GetConfig() (*rest.Config, error) { - if mock.GetConfigFunc == nil { - panic("MockProvider.GetConfigFunc: method is nil but Provider.GetConfig was just called") - } - callInfo := struct { - }{} - mock.lockGetConfig.Lock() - mock.calls.GetConfig = append(mock.calls.GetConfig, callInfo) - mock.lockGetConfig.Unlock() - return mock.GetConfigFunc() -} - -// GetConfigCalls gets all the calls that were made to GetConfig. -// Check the length with: -// -// len(mockedProvider.GetConfigCalls()) -func (mock *MockProvider) GetConfigCalls() []struct { -} { - var calls []struct { - } - mock.lockGetConfig.RLock() - calls = mock.calls.GetConfig - mock.lockGetConfig.RUnlock() - return calls -} diff --git a/metrics-operator/cmd/fake/webhookmanager_mock.go b/metrics-operator/cmd/fake/webhookmanager_mock.go deleted file mode 100644 index 4f44246d9c0..00000000000 --- a/metrics-operator/cmd/fake/webhookmanager_mock.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package fake - -import ( - "sync" - - "sigs.k8s.io/controller-runtime/pkg/manager" -) - -// MockWebhookManager is a mock implementation of manager.Provider. -// -// func TestSomethingThatUsesProvider(t *testing.T) { -// -// // make and configure a mocked manager.Provider -// mockedProvider := &MockWebhookManager{ -// SetupWebhookServerFunc: func(mgr manager.Manager) { -// panic("mock out the SetupWebhookServer method") -// }, -// } -// -// // use mockedProvider in code that requires manager.Provider -// // and then make assertions. -// -// } -type MockWebhookManager struct { - // SetupWebhookServerFunc mocks the SetupWebhookServer method. - SetupWebhookServerFunc func(mgr manager.Manager) - - // calls tracks calls to the methods. - calls struct { - // SetupWebhookServer holds details about calls to the SetupWebhookServer method. - SetupWebhookServer []struct { - // Mgr is the mgr argument value. - Mgr manager.Manager - } - } - lockSetupWebhookServer sync.RWMutex -} - -// SetupWebhookServer calls SetupWebhookServerFunc. -func (mock *MockWebhookManager) SetupWebhookServer(mgr manager.Manager) { - if mock.SetupWebhookServerFunc == nil { - panic("MockWebhookManager.SetupWebhookServerFunc: method is nil but Provider.SetupWebhookServer was just called") - } - callInfo := struct { - Mgr manager.Manager - }{ - Mgr: mgr, - } - mock.lockSetupWebhookServer.Lock() - mock.calls.SetupWebhookServer = append(mock.calls.SetupWebhookServer, callInfo) - mock.lockSetupWebhookServer.Unlock() - mock.SetupWebhookServerFunc(mgr) -} - -// SetupWebhookServerCalls gets all the calls that were made to SetupWebhookServer. -// Check the length with: -// -// len(mockedProvider.SetupWebhookServerCalls()) -func (mock *MockWebhookManager) SetupWebhookServerCalls() []struct { - Mgr manager.Manager -} { - var calls []struct { - Mgr manager.Manager - } - mock.lockSetupWebhookServer.RLock() - calls = mock.calls.SetupWebhookServer - mock.lockSetupWebhookServer.RUnlock() - return calls -} diff --git a/metrics-operator/cmd/manager/manager.go b/metrics-operator/cmd/manager/manager.go deleted file mode 100644 index a37fa6574a0..00000000000 --- a/metrics-operator/cmd/manager/manager.go +++ /dev/null @@ -1,13 +0,0 @@ -package manager - -import ( - "sigs.k8s.io/controller-runtime/pkg/manager" -) - -//go:generate moq -pkg fake -skip-ensure -out ../fake/manager_mock.go . IManager:MockManager -type IManager manager.Manager - -//go:generate moq -pkg fake -skip-ensure -out ../fake/webhookmanager_mock.go . Provider:MockWebhookManager -type Provider interface { - SetupWebhookServer(mgr manager.Manager) -} diff --git a/metrics-operator/config/crd/bases/metrics.keptn.sh_analyses.yaml b/metrics-operator/config/crd/bases/metrics.keptn.sh_analyses.yaml index 13e4e911031..2999211b724 100644 --- a/metrics-operator/config/crd/bases/metrics.keptn.sh_analyses.yaml +++ b/metrics-operator/config/crd/bases/metrics.keptn.sh_analyses.yaml @@ -18,6 +18,12 @@ spec: - jsonPath: .spec.analysisDefinition.name name: AnalysisDefinition type: string + - jsonPath: .status.warning + name: Warning + type: string + - jsonPath: .status.pass + name: Pass + type: string name: v1alpha3 schema: openAPIV3Schema: @@ -57,8 +63,7 @@ spec: type: string description: Args corresponds to a map of key/value pairs that can be used to substitute placeholders in the AnalysisValueTemplate - query. The placeholder must be the capitalized version of the key; - i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:{{.Foo}})". + query. i.e. for args foo:bar the query could be "query:percentile(95)?scope=tag(my_foo_label:{{.foo}})". type: object timeframe: description: Timeframe specifies the range for the corresponding query @@ -83,7 +88,48 @@ spec: - timeframe type: object status: - type: string + description: AnalysisStatus stores the status of the overall analysis + returns also pass or warnings + properties: + pass: + description: Pass returns whether the SLO is satisfied + type: boolean + raw: + description: Raw contains the raw result of the SLO computation + type: string + storedValues: + additionalProperties: + description: ProviderResult stores reference of already collected + provider query associated to its objective template + properties: + errMsg: + description: ErrMsg stores any possible error at retrieval time + type: string + objectiveReference: + description: Objective store reference to corresponding objective + template + properties: + name: + description: Name defines the name of the referenced object + type: string + namespace: + description: Namespace defines the namespace of the referenced + object + type: string + required: + - name + type: object + value: + description: Value is the value the provider returned + type: string + type: object + description: StoredValues contains all analysis values that have already + been retrieved successfully + type: object + warning: + description: Warning returns whether the analysis returned a warning + type: boolean + type: object type: object served: true storage: true diff --git a/metrics-operator/config/manager/manager.yaml b/metrics-operator/config/manager/manager.yaml index cb44f8a1131..1630b075c4d 100644 --- a/metrics-operator/config/manager/manager.yaml +++ b/metrics-operator/config/manager/manager.yaml @@ -64,8 +64,12 @@ spec: fieldPath: metadata.name - name: EXPOSE_KEPTN_METRICS value: "true" + - name: ENABLE_ANALYSIS + value: "true" - name: METRICS_CONTROLLER_LOG_LEVEL value: "0" + - name: ANALYSIS_CONTROLLER_LOG_LEVEL + value: "0" ports: - containerPort: 9443 name: webhook-server diff --git a/metrics-operator/config/rbac/role.yaml b/metrics-operator/config/rbac/role.yaml index 960409688f5..70fc4a915ba 100644 --- a/metrics-operator/config/rbac/role.yaml +++ b/metrics-operator/config/rbac/role.yaml @@ -18,6 +18,48 @@ rules: - secrets verbs: - get +- apiGroups: + - metrics.keptn.sh + resources: + - analyses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - metrics.keptn.sh + resources: + - analyses/finalizers + verbs: + - update +- apiGroups: + - metrics.keptn.sh + resources: + - analyses/status + verbs: + - get + - patch + - update +- apiGroups: + - metrics.keptn.sh + resources: + - analysisdefinitions + verbs: + - get + - list + - watch +- apiGroups: + - metrics.keptn.sh + resources: + - analysisvaluetemplates + verbs: + - get + - list + - watch - apiGroups: - metrics.keptn.sh resources: diff --git a/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml b/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml index a58ee8466be..63d71bb7ed2 100644 --- a/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml +++ b/metrics-operator/config/samples/metrics_v1alpha3_analysis.yaml @@ -19,3 +19,4 @@ spec: foo: bar # can be any key/value pair; NOT only project/stage/service analysisDefinition: name: ed-my-proj-dev-svc1 + namespace: keptn-lifecycle-toolkit-system diff --git a/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml b/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml index 247870f8c54..b67282f1084 100644 --- a/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml +++ b/metrics-operator/config/samples/metrics_v1alpha3_analysisdefinition.yaml @@ -1,11 +1,12 @@ apiVersion: metrics.keptn.sh/v1alpha3 kind: AnalysisDefinition metadata: - name: analysisdefinition-sample + name: ed-my-proj-dev-svc1 + namespace: keptn-lifecycle-toolkit-system spec: objectives: - analysisValueTemplateRef: - name: response_time_p95 + name: response-time-p95 namespace: keptn-lifecycle-toolkit-system target: failure: diff --git a/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml b/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml index 955d36855b5..790796adc9a 100644 --- a/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml +++ b/metrics-operator/config/samples/metrics_v1alpha3_analysisvaluetemplate.yaml @@ -7,7 +7,8 @@ metadata: app.kubernetes.io/part-of: metrics-operator app.kubernetes.io/managed-by: kustomize app.kubernetes.io/created-by: metrics-operator - name: analysisvaluetemplate-sample + name: response-time-p95 + namespace: keptn-lifecycle-toolkit-system spec: provider: name: prometheus diff --git a/metrics-operator/controllers/analysis/controller.go b/metrics-operator/controllers/analysis/controller.go new file mode 100644 index 00000000000..35b662d7f22 --- /dev/null +++ b/metrics-operator/controllers/analysis/controller.go @@ -0,0 +1,173 @@ +/* +Copyright 2023. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package analysis + +import ( + "context" + "encoding/json" + "fmt" + "time" + + "github.com/go-logr/logr" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + common "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis" + "golang.org/x/exp/maps" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/builder" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/predicate" +) + +// AnalysisReconciler reconciles an Analysis object +type AnalysisReconciler struct { + client.Client + Scheme *runtime.Scheme + Log logr.Logger + MaxWorkers int //maybe 2 or 4 as def + Namespace string + NewWorkersPoolFactory + common.IAnalysisEvaluator +} + +//+kubebuilder:rbac:groups=metrics.keptn.sh,resources=analyses,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=metrics.keptn.sh,resources=analyses/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=metrics.keptn.sh,resources=analyses/finalizers,verbs=update +// +kubebuilder:rbac:groups=metrics.keptn.sh,resources=keptnmetricsproviders,verbs=get;list;watch; +//+kubebuilder:rbac:groups=metrics.keptn.sh,resources=analysisdefinitions,verbs=get;list;watch; +//+kubebuilder:rbac:groups=metrics.keptn.sh,resources=analysisvaluetemplates,verbs=get;list;watch; + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +// For more details, check Reconcile and its AnalysisResult here: +// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.0/pkg/reconcile +func (a *AnalysisReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + a.Log.Info("Reconciling Analysis") + analysis := &metricsapi.Analysis{} + + //retrieve analysis + if err := a.Client.Get(ctx, req.NamespacedName, analysis); err != nil { + if errors.IsNotFound(err) { + // taking down all associated K8s resources is handled by K8s + a.Log.Info("Analysis resource not found. Ignoring since object must be deleted") + return ctrl.Result{}, nil + } + a.Log.Error(err, "Failed to get the Analysis") + return ctrl.Result{}, err + } + + //find AnalysisDefinition to have the collection of Objectives + analysisDef := &metricsapi.AnalysisDefinition{} + if analysis.Spec.AnalysisDefinition.Namespace == "" { + analysis.Spec.AnalysisDefinition.Namespace = a.Namespace + } + err := a.Client.Get(ctx, + types.NamespacedName{ + Name: analysis.Spec.AnalysisDefinition.Name, + Namespace: analysis.Spec.AnalysisDefinition.Namespace}, + analysisDef, + ) + + if err != nil { + if errors.IsNotFound(err) { + a.Log.Info( + fmt.Sprintf("AnalysisDefinition '%s' isn namespace '%s' not found, requeue", + analysis.Spec.AnalysisDefinition.Name, + analysis.Spec.AnalysisDefinition.Name), + ) + return ctrl.Result{Requeue: true, RequeueAfter: 10 * time.Second}, nil + } + a.Log.Error(err, "Failed to retrieve the AnalysisDefinition") + return ctrl.Result{RequeueAfter: 10 * time.Second}, nil + } + + var done map[string]metricsapi.ProviderResult + todo := analysisDef.Spec.Objectives + if analysis.Status.StoredValues != nil { + todo, done = extractMissingObjectives(analysisDef.Spec.Objectives, analysis.Status.StoredValues) + if len(todo) == 0 { + return ctrl.Result{}, nil + } + } + + //create multiple workers handling the Objectives + childCtx, wp := a.NewWorkersPoolFactory(ctx, analysis, todo, a.MaxWorkers, a.Client, a.Log, a.Namespace) + + res, err := wp.DispatchAndCollect(childCtx) + if err != nil { + a.Log.Error(err, "Failed to collect all values required for the Analysis, caching collected values") + analysis.Status.StoredValues = res + err = a.updateStatus(ctx, analysis) + return ctrl.Result{RequeueAfter: 10 * time.Second}, err + } + + maps.Copy(res, done) + + err = a.evaluateObjectives(ctx, res, analysisDef, analysis) + + return ctrl.Result{}, err +} + +func (a *AnalysisReconciler) evaluateObjectives(ctx context.Context, res map[string]metricsapi.ProviderResult, analysisDef *metricsapi.AnalysisDefinition, analysis *metricsapi.Analysis) error { + eval := a.Evaluate(res, analysisDef) + analysisResultJSON, err := json.Marshal(eval) + if err != nil { + a.Log.Error(err, "Could not marshal status") + } else { + analysis.Status.Raw = string(analysisResultJSON) + } + if eval.Warning { + analysis.Status.Warning = true + } + analysis.Status.Pass = eval.Pass + return a.updateStatus(ctx, analysis) +} + +func (a *AnalysisReconciler) updateStatus(ctx context.Context, analysis *metricsapi.Analysis) error { + if err := a.Client.Status().Update(ctx, analysis); err != nil { + a.Log.Error(err, "Failed to update the Analysis status") + return err + } + return nil +} + +// SetupWithManager sets up the controller with the Manager. +func (a *AnalysisReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&metricsapi.Analysis{}, builder.WithPredicates(predicate.GenerationChangedPredicate{})). + Complete(a) +} + +func extractMissingObjectives(objectives []metricsapi.Objective, status map[string]metricsapi.ProviderResult) ([]metricsapi.Objective, map[string]metricsapi.ProviderResult) { + var todo []metricsapi.Objective + done := make(map[string]metricsapi.ProviderResult, len(status)) + for _, obj := range objectives { + key := common.ComputeKey(obj.AnalysisValueTemplateRef) + if value, ok := status[key]; ok { + if value.ErrMsg != "" { + todo = append(todo, obj) + } else { + done[key] = status[key] + } + } else { + todo = append(todo, obj) + } + } + return todo, done +} diff --git a/metrics-operator/controllers/analysis/controller_test.go b/metrics-operator/controllers/analysis/controller_test.go new file mode 100644 index 00000000000..e8869b9060d --- /dev/null +++ b/metrics-operator/controllers/analysis/controller_test.go @@ -0,0 +1,236 @@ +package analysis + +import ( + "context" + "reflect" + "testing" + "time" + + "github.com/go-logr/logr" + "github.com/go-logr/logr/testr" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/analysis/fake" + common "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis" + fakeEvaluator "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis/fake" + metricstypes "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis/types" + fake2 "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/fake" + "github.com/stretchr/testify/require" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + controllerruntime "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func TestAnalysisReconciler_Reconcile_BasicControlLoop(t *testing.T) { + + analysis, analysisDef, template, _ := getTestCRDs() + + tests := []struct { + name string + client client.Client + req controllerruntime.Request + want controllerruntime.Result + wantErr bool + status *metricsapi.AnalysisStatus + res metricstypes.AnalysisResult + }{ + { + name: "analysis does not exist, reconcile no status update", + client: fake2.NewClient(), + want: controllerruntime.Result{}, + wantErr: false, + status: nil, + res: metricstypes.AnalysisResult{}, + }, { + name: "analysisDefinition does not exist, requeue no status update", + client: fake2.NewClient(&analysis), + want: controllerruntime.Result{Requeue: true, RequeueAfter: 10 * time.Second}, + wantErr: false, + status: &metricsapi.AnalysisStatus{}, + res: metricstypes.AnalysisResult{Pass: false}, + }, { + name: "succeeded, status updated", + client: fake2.NewClient(&analysis, &analysisDef, &template), + want: controllerruntime.Result{}, + wantErr: false, + status: &metricsapi.AnalysisStatus{Raw: "{\"pass\":true}", Pass: true}, + res: metricstypes.AnalysisResult{Pass: true}, + }, + } + + req := controllerruntime.Request{ + NamespacedName: types.NamespacedName{Namespace: "default", Name: "my-analysis"}, + } + mockFactory := func(ctx context.Context, analysisMoqParam *metricsapi.Analysis, obj []metricsapi.Objective, numWorkers int, c client.Client, log logr.Logger, namespace string) (context.Context, IAnalysisPool) { + mymock := fake.IAnalysisPoolMock{ + DispatchAndCollectFunc: func(ctx context.Context) (map[string]metricsapi.ProviderResult, error) { + return map[string]metricsapi.ProviderResult{}, nil + }, + } + return ctx, &mymock + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &AnalysisReconciler{ + Client: tt.client, + Scheme: tt.client.Scheme(), + Log: testr.New(t), + MaxWorkers: 2, + NewWorkersPoolFactory: mockFactory, + IAnalysisEvaluator: &fakeEvaluator.IAnalysisEvaluatorMock{ + EvaluateFunc: func(values map[string]metricsapi.ProviderResult, ad *metricsapi.AnalysisDefinition) metricstypes.AnalysisResult { + return tt.res + }}, + } + got, err := a.Reconcile(context.TODO(), req) + if (err != nil) != tt.wantErr { + t.Errorf("Reconcile() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("Reconcile() got = %v, want %v", got, tt.want) + } + if tt.status != nil { + resAnalysis := metricsapi.Analysis{} + err = tt.client.Get(context.TODO(), req.NamespacedName, &resAnalysis) + require.Nil(t, err) + require.Equal(t, *tt.status, resAnalysis.Status) + } + }) + } +} + +func getTestCRDs() (metricsapi.Analysis, metricsapi.AnalysisDefinition, metricsapi.AnalysisValueTemplate, metricsapi.KeptnMetricsProvider) { + analysis := metricsapi.Analysis{ + ObjectMeta: metav1.ObjectMeta{ + Name: "my-analysis", + Namespace: "default", + }, + Spec: metricsapi.AnalysisSpec{ + Timeframe: metricsapi.Timeframe{ + From: metav1.Time{ + Time: time.Now(), + }, + To: metav1.Time{ + Time: time.Now(), + }, + }, + Args: map[string]string{ + "good": "good", + "dot": ".", + }, + AnalysisDefinition: metricsapi.ObjectReference{ + Name: "my-analysis-def", + Namespace: "default", + }, + }, + } + + analysisDef := metricsapi.AnalysisDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: "my-analysis-def", + Namespace: "default", + }, + Spec: metricsapi.AnalysisDefinitionSpec{ + Objectives: []metricsapi.Objective{ + { + AnalysisValueTemplateRef: metricsapi.ObjectReference{ + Name: "my-template", + Namespace: "default", + }, + Weight: 1, + KeyObjective: false, + }, + }, + TotalScore: metricsapi.TotalScore{ + PassPercentage: 0, + WarningPercentage: 0, + }, + }, + } + + template := metricsapi.AnalysisValueTemplate{ + ObjectMeta: metav1.ObjectMeta{ + Name: "my-template", + Namespace: "default", + }, + Spec: metricsapi.AnalysisValueTemplateSpec{ + Provider: metricsapi.ObjectReference{ + Name: "my-provider", + Namespace: "default", + }, + Query: "this is a {{.good}} query{{.dot}}", + }, + } + + provider := metricsapi.KeptnMetricsProvider{ + ObjectMeta: metav1.ObjectMeta{ + Name: "my-provider", + Namespace: "default", + }, + Spec: metricsapi.KeptnMetricsProviderSpec{ + Type: "prometheus", + TargetServer: "localhost:2000", + }, + } + return analysis, analysisDef, template, provider +} + +func Test_extractMissingObjectives(t *testing.T) { + + missing := metricsapi.ObjectReference{ + Name: "missing", + Namespace: "test", + } + + done := metricsapi.ObjectReference{ + Name: "done", + Namespace: "test", + } + + needToRetry := metricsapi.ObjectReference{ + Name: "need-to-retry", + Namespace: "test", + } + + ad := &metricsapi.AnalysisDefinition{Spec: metricsapi.AnalysisDefinitionSpec{Objectives: []metricsapi.Objective{ + { + AnalysisValueTemplateRef: missing, + Target: metricsapi.Target{}, + Weight: 1, + KeyObjective: false, + }, + { + AnalysisValueTemplateRef: done, + Target: metricsapi.Target{}, + Weight: 1, + KeyObjective: false, + }, + { + AnalysisValueTemplateRef: needToRetry, + Target: metricsapi.Target{}, + Weight: 1, + KeyObjective: false, + }, + }}} + + existingValues := map[string]metricsapi.ProviderResult{ + common.ComputeKey(ad.Spec.Objectives[1].AnalysisValueTemplateRef): { + Value: "1.0", + }, + common.ComputeKey(ad.Spec.Objectives[2].AnalysisValueTemplateRef): { + ErrMsg: "error", + }, + } + todo, existing := extractMissingObjectives(ad.Spec.Objectives, existingValues) + + require.Len(t, todo, 2) + require.Equal(t, missing, todo[0].AnalysisValueTemplateRef) + require.Equal(t, needToRetry, todo[1].AnalysisValueTemplateRef) + require.Len(t, existing, 1) + require.Equal(t, "1.0", existing[common.ComputeKey(done)].Value) + + // verify that the analysisDefinition has not been changed + require.Len(t, ad.Spec.Objectives, 3) +} diff --git a/metrics-operator/controllers/analysis/fake/analysispool_mock.go b/metrics-operator/controllers/analysis/fake/analysispool_mock.go new file mode 100644 index 00000000000..5130d326696 --- /dev/null +++ b/metrics-operator/controllers/analysis/fake/analysispool_mock.go @@ -0,0 +1,72 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fake + +import ( + "context" + "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "sync" +) + +// IAnalysisPoolMock is a mock implementation of analysis.IAnalysisPool. +// +// func TestSomethingThatUsesIAnalysisPool(t *testing.T) { +// +// // make and configure a mocked analysis.IAnalysisPool +// mockedIAnalysisPool := &IAnalysisPoolMock{ +// DispatchAndCollectFunc: func(ctx context.Context) (map[string]metricsapi.ProviderResult, error) { +// panic("mock out the DispatchAndCollect method") +// }, +// } +// +// // use mockedIAnalysisPool in code that requires analysis.IAnalysisPool +// // and then make assertions. +// +// } +type IAnalysisPoolMock struct { + // DispatchAndCollectFunc mocks the DispatchAndCollect method. + DispatchAndCollectFunc func(ctx context.Context) (map[string]v1alpha3.ProviderResult, error) + + // calls tracks calls to the methods. + calls struct { + // DispatchAndCollect holds details about calls to the DispatchAndCollect method. + DispatchAndCollect []struct { + // Ctx is the ctx argument value. + Ctx context.Context + } + } + lockDispatchAndCollect sync.RWMutex +} + +// DispatchAndCollect calls DispatchAndCollectFunc. +func (mock *IAnalysisPoolMock) DispatchAndCollect(ctx context.Context) (map[string]v1alpha3.ProviderResult, error) { + if mock.DispatchAndCollectFunc == nil { + panic("IAnalysisPoolMock.DispatchAndCollectFunc: method is nil but IAnalysisPool.DispatchAndCollect was just called") + } + callInfo := struct { + Ctx context.Context + }{ + Ctx: ctx, + } + mock.lockDispatchAndCollect.Lock() + mock.calls.DispatchAndCollect = append(mock.calls.DispatchAndCollect, callInfo) + mock.lockDispatchAndCollect.Unlock() + return mock.DispatchAndCollectFunc(ctx) +} + +// DispatchAndCollectCalls gets all the calls that were made to DispatchAndCollect. +// Check the length with: +// +// len(mockedIAnalysisPool.DispatchAndCollectCalls()) +func (mock *IAnalysisPoolMock) DispatchAndCollectCalls() []struct { + Ctx context.Context +} { + var calls []struct { + Ctx context.Context + } + mock.lockDispatchAndCollect.RLock() + calls = mock.calls.DispatchAndCollect + mock.lockDispatchAndCollect.RUnlock() + return calls +} diff --git a/metrics-operator/controllers/analysis/fake/evaluator_mock.go b/metrics-operator/controllers/analysis/fake/evaluator_mock.go new file mode 100644 index 00000000000..d5ff3a5add2 --- /dev/null +++ b/metrics-operator/controllers/analysis/fake/evaluator_mock.go @@ -0,0 +1,84 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fake + +import ( + "context" + metricstypes "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis/types" + "sync" +) + +// IObjectivesEvaluatorMock is a mock implementation of analysis.IObjectivesEvaluator. +// +// func TestSomethingThatUsesIObjectivesEvaluator(t *testing.T) { +// +// // make and configure a mocked analysis.IObjectivesEvaluator +// mockedIObjectivesEvaluator := &IObjectivesEvaluatorMock{ +// EvaluateFunc: func(ctx context.Context, providerType string, obj chan metricstypes.ProviderRequest) { +// panic("mock out the Evaluate method") +// }, +// } +// +// // use mockedIObjectivesEvaluator in code that requires analysis.IObjectivesEvaluator +// // and then make assertions. +// +// } +type IObjectivesEvaluatorMock struct { + // EvaluateFunc mocks the Evaluate method. + EvaluateFunc func(ctx context.Context, providerType string, obj chan metricstypes.ProviderRequest) + + // calls tracks calls to the methods. + calls struct { + // Evaluate holds details about calls to the Evaluate method. + Evaluate []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // ProviderType is the providerType argument value. + ProviderType string + // Obj is the obj argument value. + Obj chan metricstypes.ProviderRequest + } + } + lockEvaluate sync.RWMutex +} + +// Evaluate calls EvaluateFunc. +func (mock *IObjectivesEvaluatorMock) Evaluate(ctx context.Context, providerType string, obj chan metricstypes.ProviderRequest) { + if mock.EvaluateFunc == nil { + panic("IObjectivesEvaluatorMock.EvaluateFunc: method is nil but IObjectivesEvaluator.Evaluate was just called") + } + callInfo := struct { + Ctx context.Context + ProviderType string + Obj chan metricstypes.ProviderRequest + }{ + Ctx: ctx, + ProviderType: providerType, + Obj: obj, + } + mock.lockEvaluate.Lock() + mock.calls.Evaluate = append(mock.calls.Evaluate, callInfo) + mock.lockEvaluate.Unlock() + mock.EvaluateFunc(ctx, providerType, obj) +} + +// EvaluateCalls gets all the calls that were made to Evaluate. +// Check the length with: +// +// len(mockedIObjectivesEvaluator.EvaluateCalls()) +func (mock *IObjectivesEvaluatorMock) EvaluateCalls() []struct { + Ctx context.Context + ProviderType string + Obj chan metricstypes.ProviderRequest +} { + var calls []struct { + Ctx context.Context + ProviderType string + Obj chan metricstypes.ProviderRequest + } + mock.lockEvaluate.RLock() + calls = mock.calls.Evaluate + mock.lockEvaluate.RUnlock() + return calls +} diff --git a/metrics-operator/controllers/analysis/fake/providers_pool_mock.go b/metrics-operator/controllers/analysis/fake/providers_pool_mock.go new file mode 100644 index 00000000000..46ead7d885d --- /dev/null +++ b/metrics-operator/controllers/analysis/fake/providers_pool_mock.go @@ -0,0 +1,202 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fake + +import ( + "context" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "sync" +) + +// IProvidersPoolMock is a mock implementation of analysis.IProvidersPool. +// +// func TestSomethingThatUsesIProvidersPool(t *testing.T) { +// +// // make and configure a mocked analysis.IProvidersPool +// mockedIProvidersPool := &IProvidersPoolMock{ +// DispatchToProvidersFunc: func(ctx context.Context, id int) { +// panic("mock out the DispatchToProviders method") +// }, +// GetResultFunc: func() metricsapi.ProviderResult { +// panic("mock out the GetResult method") +// }, +// StartProvidersFunc: func(ctx context.Context, numJobs int) { +// panic("mock out the StartProviders method") +// }, +// StopProvidersFunc: func() { +// panic("mock out the StopProviders method") +// }, +// } +// +// // use mockedIProvidersPool in code that requires analysis.IProvidersPool +// // and then make assertions. +// +// } +type IProvidersPoolMock struct { + // DispatchToProvidersFunc mocks the DispatchToProviders method. + DispatchToProvidersFunc func(ctx context.Context, id int) + + // GetResultFunc mocks the GetResult method. + GetResultFunc func() metricsapi.ProviderResult + + // StartProvidersFunc mocks the StartProviders method. + StartProvidersFunc func(ctx context.Context, numJobs int) + + // StopProvidersFunc mocks the StopProviders method. + StopProvidersFunc func() + + // calls tracks calls to the methods. + calls struct { + // DispatchToProviders holds details about calls to the DispatchToProviders method. + DispatchToProviders []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // ID is the id argument value. + ID int + } + // GetResult holds details about calls to the GetResult method. + GetResult []struct { + } + // StartProviders holds details about calls to the StartProviders method. + StartProviders []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // NumJobs is the numJobs argument value. + NumJobs int + } + // StopProviders holds details about calls to the StopProviders method. + StopProviders []struct { + } + } + lockDispatchToProviders sync.RWMutex + lockGetResult sync.RWMutex + lockStartProviders sync.RWMutex + lockStopProviders sync.RWMutex +} + +// DispatchToProviders calls DispatchToProvidersFunc. +func (mock *IProvidersPoolMock) DispatchToProviders(ctx context.Context, id int) { + if mock.DispatchToProvidersFunc == nil { + panic("IProvidersPoolMock.DispatchToProvidersFunc: method is nil but IProvidersPool.DispatchToProviders was just called") + } + callInfo := struct { + Ctx context.Context + ID int + }{ + Ctx: ctx, + ID: id, + } + mock.lockDispatchToProviders.Lock() + mock.calls.DispatchToProviders = append(mock.calls.DispatchToProviders, callInfo) + mock.lockDispatchToProviders.Unlock() + mock.DispatchToProvidersFunc(ctx, id) +} + +// DispatchToProvidersCalls gets all the calls that were made to DispatchToProviders. +// Check the length with: +// +// len(mockedIProvidersPool.DispatchToProvidersCalls()) +func (mock *IProvidersPoolMock) DispatchToProvidersCalls() []struct { + Ctx context.Context + ID int +} { + var calls []struct { + Ctx context.Context + ID int + } + mock.lockDispatchToProviders.RLock() + calls = mock.calls.DispatchToProviders + mock.lockDispatchToProviders.RUnlock() + return calls +} + +// GetResult calls GetResultFunc. +func (mock *IProvidersPoolMock) GetResult() metricsapi.ProviderResult { + if mock.GetResultFunc == nil { + panic("IProvidersPoolMock.GetResultFunc: method is nil but IProvidersPool.GetResult was just called") + } + callInfo := struct { + }{} + mock.lockGetResult.Lock() + mock.calls.GetResult = append(mock.calls.GetResult, callInfo) + mock.lockGetResult.Unlock() + return mock.GetResultFunc() +} + +// GetResultCalls gets all the calls that were made to GetResult. +// Check the length with: +// +// len(mockedIProvidersPool.GetResultCalls()) +func (mock *IProvidersPoolMock) GetResultCalls() []struct { +} { + var calls []struct { + } + mock.lockGetResult.RLock() + calls = mock.calls.GetResult + mock.lockGetResult.RUnlock() + return calls +} + +// StartProviders calls StartProvidersFunc. +func (mock *IProvidersPoolMock) StartProviders(ctx context.Context, numJobs int) { + if mock.StartProvidersFunc == nil { + panic("IProvidersPoolMock.StartProvidersFunc: method is nil but IProvidersPool.StartProviders was just called") + } + callInfo := struct { + Ctx context.Context + NumJobs int + }{ + Ctx: ctx, + NumJobs: numJobs, + } + mock.lockStartProviders.Lock() + mock.calls.StartProviders = append(mock.calls.StartProviders, callInfo) + mock.lockStartProviders.Unlock() + mock.StartProvidersFunc(ctx, numJobs) +} + +// StartProvidersCalls gets all the calls that were made to StartProviders. +// Check the length with: +// +// len(mockedIProvidersPool.StartProvidersCalls()) +func (mock *IProvidersPoolMock) StartProvidersCalls() []struct { + Ctx context.Context + NumJobs int +} { + var calls []struct { + Ctx context.Context + NumJobs int + } + mock.lockStartProviders.RLock() + calls = mock.calls.StartProviders + mock.lockStartProviders.RUnlock() + return calls +} + +// StopProviders calls StopProvidersFunc. +func (mock *IProvidersPoolMock) StopProviders() { + if mock.StopProvidersFunc == nil { + panic("IProvidersPoolMock.StopProvidersFunc: method is nil but IProvidersPool.StopProviders was just called") + } + callInfo := struct { + }{} + mock.lockStopProviders.Lock() + mock.calls.StopProviders = append(mock.calls.StopProviders, callInfo) + mock.lockStopProviders.Unlock() + mock.StopProvidersFunc() +} + +// StopProvidersCalls gets all the calls that were made to StopProviders. +// Check the length with: +// +// len(mockedIProvidersPool.StopProvidersCalls()) +func (mock *IProvidersPoolMock) StopProvidersCalls() []struct { +} { + var calls []struct { + } + mock.lockStopProviders.RLock() + calls = mock.calls.StopProviders + mock.lockStopProviders.RUnlock() + return calls +} diff --git a/metrics-operator/controllers/analysis/objectives_assigner.go b/metrics-operator/controllers/analysis/objectives_assigner.go new file mode 100644 index 00000000000..c46ef97d76d --- /dev/null +++ b/metrics-operator/controllers/analysis/objectives_assigner.go @@ -0,0 +1,32 @@ +package analysis + +import metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + +type ITaskAssigner interface { + AssignTasks(tasks []metricsapi.Objective, numWorkers int) [][]metricsapi.Objective +} + +type TaskAssigner struct { + numWorkers int + tasks []metricsapi.Objective +} + +func (ta TaskAssigner) assignTasks() map[int][]metricsapi.Objective { + totalTasks := len(ta.tasks) + taskMap := make(map[int][]metricsapi.Objective, ta.numWorkers) + if ta.numWorkers == 0 { + return taskMap + } + tasksPerWorker := totalTasks / ta.numWorkers + start := 0 + for i := 0; i < ta.numWorkers && start < totalTasks; i++ { + end := start + tasksPerWorker + if i < totalTasks%ta.numWorkers { + end++ // distribute the remainder tasks + } + taskMap[i+1] = ta.tasks[start:end] + start = end + } + + return taskMap +} diff --git a/metrics-operator/controllers/analysis/objectives_assigner_test.go b/metrics-operator/controllers/analysis/objectives_assigner_test.go new file mode 100644 index 00000000000..e31c64de33e --- /dev/null +++ b/metrics-operator/controllers/analysis/objectives_assigner_test.go @@ -0,0 +1,67 @@ +package analysis + +import ( + "testing" + + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "github.com/stretchr/testify/require" +) + +func TestAssignTasks(t *testing.T) { + tests := []struct { + name string + tasks []metricsapi.Objective + numWorkers int + expected map[int][]metricsapi.Objective + }{ + { + name: "Equal Workers and Tasks", + tasks: []metricsapi.Objective{{}, {}, {}}, + numWorkers: 3, + expected: map[int][]metricsapi.Objective{ + 1: {{}}, + 2: {{}}, + 3: {{}}, + }, + }, + { + name: "More Workers than Tasks", + tasks: []metricsapi.Objective{{}, {}}, + numWorkers: 3, + expected: map[int][]metricsapi.Objective{ + 1: {{}}, + 2: {{}}, + }, + }, + { + name: "More Tasks", + tasks: []metricsapi.Objective{{}, {}, {}}, + numWorkers: 2, + expected: map[int][]metricsapi.Objective{ + 1: {{}, {}}, + 2: {{}}, + }, + }, { + name: "No Tasks", + tasks: []metricsapi.Objective{}, + numWorkers: 2, + expected: map[int][]metricsapi.Objective{}, + }, { + name: "No Workers", + tasks: []metricsapi.Objective{}, + numWorkers: 0, + expected: map[int][]metricsapi.Objective{}, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + assigner := TaskAssigner{ + numWorkers: test.numWorkers, + tasks: test.tasks, + } + result := assigner.assignTasks() + require.Equal(t, test.expected, result) + }) + } +} diff --git a/metrics-operator/controllers/analysis/objectives_evaluator.go b/metrics-operator/controllers/analysis/objectives_evaluator.go new file mode 100644 index 00000000000..a4d0cd8c887 --- /dev/null +++ b/metrics-operator/controllers/analysis/objectives_evaluator.go @@ -0,0 +1,49 @@ +package analysis + +import ( + "github.com/go-logr/logr" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + metricstypes "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis/types" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/providers" + "golang.org/x/net/context" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +//go:generate moq -pkg fake -skip-ensure -out ./fake/evaluator_mock.go . IObjectivesEvaluator +type IObjectivesEvaluator interface { + Evaluate(ctx context.Context, providerType string, obj chan metricstypes.ProviderRequest) +} + +type ObjectivesEvaluator struct { + *metricsapi.Analysis + providers.ProviderFactory + client.Client + log logr.Logger + results chan metricsapi.ProviderResult + cancel context.CancelFunc +} + +func (oe ObjectivesEvaluator) Evaluate(ctx context.Context, providerType string, obj chan metricstypes.ProviderRequest) { + provider, err := oe.ProviderFactory(providerType, oe.log, oe.Client) + if err != nil { + oe.log.Error(err, "Failed to get the correct Provider") + oe.cancel() + return + } + for o := range obj { + value := "" + var strErr string + value, err = provider.FetchAnalysisValue(ctx, o.Query, oe.Analysis.Spec, o.Provider) + + if err != nil { + strErr = err.Error() + } + result := metricsapi.ProviderResult{ + Objective: o.Objective.AnalysisValueTemplateRef, + Value: value, + ErrMsg: strErr, + } + oe.log.Info("provider", "id:", providerType, "finished job:", o.Objective.AnalysisValueTemplateRef.Name, "result:", result) + oe.results <- result + } +} diff --git a/metrics-operator/controllers/analysis/objectives_evaluator_test.go b/metrics-operator/controllers/analysis/objectives_evaluator_test.go new file mode 100644 index 00000000000..7edebdd2839 --- /dev/null +++ b/metrics-operator/controllers/analysis/objectives_evaluator_test.go @@ -0,0 +1,124 @@ +package analysis + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/go-logr/logr" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + metricstypes "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis/types" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/fake" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/providers" + fake2 "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/providers/fake" + "github.com/stretchr/testify/require" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func TestEvaluate(t *testing.T) { + // Define test cases + testCases := []struct { + name string + providerType string + mockProvider providers.KeptnSLIProvider + providerRequest metricstypes.ProviderRequest + expectedResult metricsapi.ProviderResult + expectedError string + }{ + { + name: "SuccessfulEvaluation", + providerType: "mockProvider", + mockProvider: &fake2.KeptnSLIProviderMock{ + FetchAnalysisValueFunc: func(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) { + return "10", nil + }, + }, + providerRequest: metricstypes.ProviderRequest{ + Objective: &metricsapi.Objective{ + AnalysisValueTemplateRef: metricsapi.ObjectReference{ + Name: "mytemp", + Namespace: "default", + }, + }, + Query: "query_fake_metric", + Provider: &metricsapi.KeptnMetricsProvider{Spec: metricsapi.KeptnMetricsProviderSpec{Type: "prometheus"}}, + }, + expectedResult: metricsapi.ProviderResult{ + Objective: metricsapi.ObjectReference{ + Name: "mytemp", + Namespace: "default", + }, + Value: "10", + ErrMsg: "", + }, + expectedError: "", + }, + { + name: "FailedEvaluation", + providerType: "mockProvider", + mockProvider: &fake2.KeptnSLIProviderMock{ + FetchAnalysisValueFunc: func(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) { + return "", fmt.Errorf("something bad") + }, + }, + providerRequest: metricstypes.ProviderRequest{ + Objective: &metricsapi.Objective{ + AnalysisValueTemplateRef: metricsapi.ObjectReference{ + Name: "mytemp", + Namespace: "default", + }, + }, + Query: "query_fake_metric", + Provider: &metricsapi.KeptnMetricsProvider{Spec: metricsapi.KeptnMetricsProviderSpec{Type: "prometheus"}}, + }, + expectedResult: metricsapi.ProviderResult{ + Objective: metricsapi.ObjectReference{ + Name: "mytemp", + Namespace: "default", + }, + Value: "", + ErrMsg: "something bad", + }, + expectedError: "something bad", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + mockProviderFactory := func(providerType string, log logr.Logger, client client.Client) (providers.KeptnSLIProvider, error) { + // Define your mock provider implementation + return tc.mockProvider, nil + } + objectivesEvaluator := ObjectivesEvaluator{ + // Initialize ObjectivesEvaluator fields here + Client: fake.NewClient(), + log: logr.Discard(), + ProviderFactory: mockProviderFactory, + Analysis: &metricsapi.Analysis{ + Spec: metricsapi.AnalysisSpec{ + AnalysisDefinition: metricsapi.ObjectReference{ + Name: "a", + Namespace: "d", + }, + }, + }, + results: make(chan metricsapi.ProviderResult, 1), + } + + ctx := context.TODO() + objChan := make(chan metricstypes.ProviderRequest, 1) + go func() { + time.Sleep(time.Second * 5) + objChan <- tc.providerRequest + close(objChan) + }() + objectivesEvaluator.Evaluate(ctx, tc.providerType, objChan) + close(objectivesEvaluator.results) + result := <-objectivesEvaluator.results + + require.Equal(t, tc.expectedResult, result) + require.Equal(t, tc.expectedError, result.ErrMsg) + }) + } +} diff --git a/metrics-operator/controllers/analysis/provider_selector.go b/metrics-operator/controllers/analysis/provider_selector.go new file mode 100644 index 00000000000..1ec5e6e6079 --- /dev/null +++ b/metrics-operator/controllers/analysis/provider_selector.go @@ -0,0 +1,138 @@ +package analysis + +import ( + "bytes" + "context" + "errors" + "fmt" + "text/template" + + "github.com/go-logr/logr" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + metricstypes "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis/types" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/providers" + "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +//go:generate moq -pkg fake -skip-ensure -out ./fake/providers_pool_mock.go . IProvidersPool +type IProvidersPool interface { + StartProviders(ctx context.Context, numJobs int) + DispatchToProviders(ctx context.Context, id int) + GetResult(ctx context.Context) (*metricsapi.ProviderResult, error) + StopProviders() +} + +type ProvidersPool struct { + IObjectivesEvaluator + client.Client + log logr.Logger + Namespace string + Objectives map[int][]metricsapi.Objective + *metricsapi.Analysis + results chan metricsapi.ProviderResult + providers map[string]chan metricstypes.ProviderRequest + cancel context.CancelFunc +} + +func (ps ProvidersPool) StartProviders(ctx context.Context, numJobs int) { + for _, provider := range providers.SupportedProviders { + channel := make(chan metricstypes.ProviderRequest, numJobs) + ps.providers[provider] = channel + go ps.Evaluate(ctx, provider, channel) + } + +} + +func (ps ProvidersPool) DispatchToProviders(ctx context.Context, id int) { + + for _, j := range ps.Objectives[id] { + select { + case <-ctx.Done(): + ps.log.Info("Worker: Exiting due to context.Done()") + return + default: + ps.log.Info("worker", "id:", id, "started job:", j.AnalysisValueTemplateRef.Name) + templ := &metricsapi.AnalysisValueTemplate{} + if j.AnalysisValueTemplateRef.Namespace == "" { + j.AnalysisValueTemplateRef.Namespace = ps.Namespace + } + err := ps.Client.Get(ctx, + types.NamespacedName{ + Name: j.AnalysisValueTemplateRef.Name, + Namespace: j.AnalysisValueTemplateRef.Namespace}, + templ, + ) + + if err != nil { + ps.log.Error(err, "Failed to get the correct Provider") + ps.results <- metricsapi.ProviderResult{Objective: j.AnalysisValueTemplateRef, ErrMsg: err.Error()} + ps.cancel() + return + } + + providerRef := &metricsapi.KeptnMetricsProvider{} + if templ.Spec.Provider.Namespace == "" { + templ.Spec.Provider.Namespace = ps.Namespace + } + err = ps.Client.Get(ctx, + types.NamespacedName{ + Name: templ.Spec.Provider.Name, + Namespace: templ.Spec.Provider.Namespace}, + providerRef, + ) + + if err != nil { + ps.log.Error(err, "Failed to get Provider") + ps.results <- metricsapi.ProviderResult{Objective: j.AnalysisValueTemplateRef, ErrMsg: err.Error()} + ps.cancel() + return + } + + templatedQuery, err := generateQuery(templ.Spec.Query, ps.Analysis.Spec.Args) + if err != nil { + ps.log.Error(err, "Failed to substitute args in templ") + ps.results <- metricsapi.ProviderResult{Objective: j.AnalysisValueTemplateRef, ErrMsg: err.Error()} + ps.cancel() + return + } + //send job to provider solver + ps.providers[providerRef.Spec.Type] <- metricstypes.ProviderRequest{ + Objective: &j, + Query: templatedQuery, + Provider: providerRef, + } + } + } +} + +func (ps ProvidersPool) StopProviders() { + for _, ch := range ps.providers { + close(ch) + } + close(ps.results) +} + +func (ps ProvidersPool) GetResult(ctx context.Context) (*metricsapi.ProviderResult, error) { + select { + case <-ctx.Done(): + return nil, errors.New("context has been cancelled") + case res := <-ps.results: + return &res, nil + } +} + +func generateQuery(query string, selectors map[string]string) (string, error) { + tmpl, err := template.New("").Parse(query) + if err != nil { + return "", fmt.Errorf("could not create a template: %w", err) + } + + var resultBuf bytes.Buffer + err = tmpl.Execute(&resultBuf, selectors) + if err != nil { + return "", fmt.Errorf("could not template the args: %w", err) + } + + return resultBuf.String(), nil +} diff --git a/metrics-operator/controllers/analysis/provider_selector_test.go b/metrics-operator/controllers/analysis/provider_selector_test.go new file mode 100644 index 00000000000..9716cef6639 --- /dev/null +++ b/metrics-operator/controllers/analysis/provider_selector_test.go @@ -0,0 +1,182 @@ +package analysis + +import ( + "context" + "testing" + "time" + + "github.com/go-logr/logr" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/analysis/fake" + metricstypes "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis/types" + fake2 "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/fake" + "github.com/stretchr/testify/require" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func Test_generateQuery(t *testing.T) { + + tests := []struct { + name string + query string + selectors map[string]string + want string + wanterror string + }{ + { + name: "successful, all args exist", + query: "this is a {{.good}} query{{.dot}}", + selectors: map[string]string{ + "good": "good", + "dot": ".", + }, + want: "this is a good query.", + }, + { + name: "no substitution, all args missing", + query: "this is a {{.good}} query{{.dot}}", + selectors: map[string]string{ + "bad": "good", + "dotted": ".", + }, + want: "this is a query", + }, + { + name: "no substitution, bad template", + query: "this is a {{.good} query{{.dot}}", + selectors: map[string]string{ + "bad": "good", + "dotted": ".", + }, + want: "", + wanterror: "could not create a template:", + }, + { + name: "nothing to do", + query: "this is a query", + selectors: map[string]string{}, + want: "this is a query", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := generateQuery(tt.query, tt.selectors) + if tt.wanterror != "" { + require.NotNil(t, err) + require.Contains(t, err.Error(), tt.wanterror) + } + require.Equal(t, tt.want, got) + }) + } +} + +func TestProvidersPool(t *testing.T) { + // Define your test cases + + analysis, analysisDef, template, provider := getTestCRDs() + + provider.Spec.Type = "mock-provider" + + testCases := []struct { + name string + expectedErr string + mockClient client.Client + providerResult *metricstypes.ProviderRequest + }{ + + { + name: "MissingTemplate", + expectedErr: "analysisvaluetemplates.metrics.keptn.sh \"my-template\" not found", + mockClient: fake2.NewClient(&analysis, &analysisDef), + }, + { + name: "MissingProvider", + expectedErr: "keptnmetricsproviders.metrics.keptn.sh \"my-provider\" not found", + mockClient: fake2.NewClient(&analysis, &analysisDef, &template), + }, + { + name: "Success", + mockClient: fake2.NewClient(&analysis, &analysisDef, &template, &provider), + providerResult: &metricstypes.ProviderRequest{ + Query: "this is a good query.", + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + // Create a mock context for testing + ctx, cancel := context.WithCancel(context.TODO()) + + resultChan := make(chan metricsapi.ProviderResult, 1) + + // Create a mock IObjectivesEvaluator and Logger for testing + mockEvaluator := &fake.IObjectivesEvaluatorMock{} + mockLogger := logr.Discard() + providerChan := make(chan metricstypes.ProviderRequest, 1) + pool := ProvidersPool{ + IObjectivesEvaluator: mockEvaluator, + Client: tc.mockClient, + log: mockLogger, + Namespace: "default", + Objectives: map[int][]metricsapi.Objective{ + 1: analysisDef.Spec.Objectives, + }, + Analysis: &analysis, + results: resultChan, + cancel: cancel, + providers: map[string]chan metricstypes.ProviderRequest{ + "mock-provider": providerChan, + }, + } + + // Call DispatchToProviders with the test context and example ID + pool.DispatchToProviders(ctx, 1) + + if tc.expectedErr == "" { + res := <-providerChan + require.Equal(t, tc.providerResult.Query, res.Query) + } else { + res := <-resultChan + require.Contains(t, res.ErrMsg, tc.expectedErr) + } + pool.StopProviders() + }) + } +} + +func TestProvidersPool_StartProviders(t *testing.T) { + + numJobs := 4 + ctx, cancel := context.WithCancel(context.Background()) + resChan := make(chan metricsapi.ProviderResult) + // Create a mock IObjectivesEvaluator, Client, and Logger for testing + mockEvaluator := &fake.IObjectivesEvaluatorMock{ + EvaluateFunc: func(ctx context.Context, providerType string, obj chan metricstypes.ProviderRequest) { + }, + } + + // Create a ProvidersPool instance with the mock objects + pool := ProvidersPool{ + IObjectivesEvaluator: mockEvaluator, + Namespace: "test-namespace", + Objectives: make(map[int][]metricsapi.Objective), + Analysis: &metricsapi.Analysis{}, + results: resChan, + cancel: cancel, + providers: make(map[string]chan metricstypes.ProviderRequest), + } + + // Call StartProviders with the test context and example numJobs + pool.StartProviders(ctx, numJobs) + + // Wait for a short time to allow the goroutines to start + time.Sleep(time.Millisecond * 100) + + // Assert the expected number of workers (goroutines) were started + require.Equal(t, 4, len(pool.providers)) + require.Equal(t, numJobs, cap(pool.providers["prometheus"])) + // Stop the providers after testing + pool.StopProviders() + +} diff --git a/metrics-operator/controllers/analysis/worker_pool.go b/metrics-operator/controllers/analysis/worker_pool.go new file mode 100644 index 00000000000..88189b8826b --- /dev/null +++ b/metrics-operator/controllers/analysis/worker_pool.go @@ -0,0 +1,99 @@ +package analysis + +import ( + "github.com/go-logr/logr" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis" + metricstypes "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis/types" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/providers" + "github.com/pkg/errors" + "golang.org/x/net/context" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +//go:generate moq -pkg fake -skip-ensure -out ./fake/analysispool_mock.go . IAnalysisPool +type IAnalysisPool interface { + DispatchAndCollect(ctx context.Context) (map[string]metricsapi.ProviderResult, error) +} + +type NewWorkersPoolFactory func(ctx context.Context, analysis *metricsapi.Analysis, objectives []metricsapi.Objective, numWorkers int, c client.Client, log logr.Logger, namespace string) (context.Context, IAnalysisPool) + +func NewWorkersPool(ctx context.Context, analysis *metricsapi.Analysis, objectives []metricsapi.Objective, numWorkers int, c client.Client, log logr.Logger, namespace string) (context.Context, IAnalysisPool) { + numJobs := len(objectives) + if numJobs <= numWorkers { // do not start useless go routines + numWorkers = numJobs + } + _, cancel := context.WithCancel(ctx) + providerChans := make(map[string]chan metricstypes.ProviderRequest, len(providers.SupportedProviders)) + + assigner := TaskAssigner{tasks: objectives, numWorkers: numWorkers} + results := make(chan metricsapi.ProviderResult, numJobs) + evaluator := ObjectivesEvaluator{ + ProviderFactory: providers.NewProvider, + log: log, + Client: c, + Analysis: analysis, + results: results, + cancel: cancel, + } + retriever := ProvidersPool{ + Client: c, + log: log, + Analysis: analysis, + results: results, + Namespace: namespace, + Objectives: assigner.assignTasks(), + IObjectivesEvaluator: evaluator, + providers: providerChans, + cancel: cancel, + } + return ctx, WorkersPool{ + numWorkers: numWorkers, + numJobs: numJobs, + cancel: cancel, + IProvidersPool: retriever, + } +} + +type WorkersPool struct { + IProvidersPool + numWorkers int + numJobs int + cancel context.CancelFunc +} + +func (aw WorkersPool) DispatchAndCollect(ctx context.Context) (map[string]metricsapi.ProviderResult, error) { + aw.StartProviders(ctx, aw.numJobs) + for w := 1; w <= aw.numWorkers; w++ { + go aw.DispatchToProviders(ctx, w) + } + return aw.CollectAnalysisResults(ctx) +} + +func (aw WorkersPool) CollectAnalysisResults(ctx context.Context) (map[string]metricsapi.ProviderResult, error) { + var err error + results := make(map[string]metricsapi.ProviderResult, aw.numJobs) +loop: + for a := 1; a <= aw.numJobs; a++ { + select { + case <-ctx.Done(): + err = errors.New("Collection terminated") + break loop + default: + res, err2 := aw.GetResult(ctx) + if err2 != nil { + err = err2 + aw.cancel() + break loop + } + results[analysis.ComputeKey(res.Objective)] = *res + if res.ErrMsg != "" { + err = errors.New(res.ErrMsg) + aw.cancel() + break loop + } + } + } + aw.StopProviders() + return results, err +} diff --git a/metrics-operator/controllers/analysis/worker_pool_test.go b/metrics-operator/controllers/analysis/worker_pool_test.go new file mode 100644 index 00000000000..bb5f0cffb88 --- /dev/null +++ b/metrics-operator/controllers/analysis/worker_pool_test.go @@ -0,0 +1,114 @@ +package analysis + +import ( + "context" + "testing" + "time" + + "github.com/go-logr/logr/testr" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "github.com/stretchr/testify/require" +) + +func TestNewWorkerPool(t *testing.T) { + + analysis := metricsapi.Analysis{ + Spec: metricsapi.AnalysisSpec{Args: map[string]string{"hi": "there"}}, + } + objs := []metricsapi.Objective{{ + Weight: 10, + KeyObjective: true, + }, + } + + log := testr.New(t) + want := WorkersPool{ + numWorkers: 4, + numJobs: 1, + } + + _, got := NewWorkersPool(context.TODO(), &analysis, objs, 4, nil, log, "default") + //make sure never to create more workers than needed + require.Equal(t, want.numJobs, got.(WorkersPool).numWorkers) + //make sure all objectives are processed + require.Equal(t, want.numJobs, got.(WorkersPool).numJobs) +} + +func TestWorkersPool_CollectAnalysisResults(t *testing.T) { + // Create a fake WorkersPool instance for testing + resChan := make(chan metricsapi.ProviderResult, 2) + fakePool := WorkersPool{ + IProvidersPool: ProvidersPool{ + results: resChan, + }, + numJobs: 2, + } + + res1 := metricsapi.ProviderResult{ + Objective: metricsapi.ObjectReference{Name: "t1"}, + Value: "result1", + ErrMsg: "", + } + + res2 := metricsapi.ProviderResult{ + Objective: metricsapi.ObjectReference{Name: "t2"}, + Value: "result2", + ErrMsg: "", + } + + // Create and send mock results to the results channel + go func() { + time.Sleep(time.Second) + resChan <- res1 + resChan <- res2 + }() + + // Collect the results + results, err := fakePool.CollectAnalysisResults(context.TODO()) + + // Check the collected results + require.Nil(t, err) + require.Equal(t, res1, results["t1"]) + require.Equal(t, res2, results["t2"]) +} + +func TestWorkersPool_CollectAnalysisResultsTimeout(t *testing.T) { + // Create a fake WorkersPool instance for testing + resChan := make(chan metricsapi.ProviderResult, 2) + fakePool := WorkersPool{ + IProvidersPool: ProvidersPool{ + results: resChan, + }, + numJobs: 2, + } + + ctx, cancel := context.WithTimeout(context.TODO(), 1*time.Second) + + fakePool.cancel = cancel + + // Collect the results + results, err := fakePool.CollectAnalysisResults(ctx) + + // Check the collected results + require.NotNil(t, err) + require.Empty(t, results) +} + +func TestWorkersPool_CollectAnalysisResultsNoJob(t *testing.T) { + // Create a fake WorkersPool instance for testing + resChan := make(chan metricsapi.ProviderResult, 1) + fakePool := WorkersPool{ + IProvidersPool: ProvidersPool{ + results: resChan, + }, + numJobs: 0, + } + // Collect that func returns + results, err := fakePool.CollectAnalysisResults(context.TODO()) + _, open := <-resChan + // Check the collected results + require.Nil(t, err) + require.Equal(t, results, map[string]metricsapi.ProviderResult{}) + require.False(t, open) + +} diff --git a/metrics-operator/controllers/common/analysis/analysis_evaluator.go b/metrics-operator/controllers/common/analysis/analysis_evaluator.go index 7874606a720..b68ef6ed9db 100644 --- a/metrics-operator/controllers/common/analysis/analysis_evaluator.go +++ b/metrics-operator/controllers/common/analysis/analysis_evaluator.go @@ -15,7 +15,7 @@ func NewAnalysisEvaluator(o IObjectiveEvaluator) AnalysisEvaluator { } } -func (ae *AnalysisEvaluator) Evaluate(values map[string]string, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult { +func (ae *AnalysisEvaluator) Evaluate(values map[string]v1alpha3.ProviderResult, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult { result := types.AnalysisResult{ ObjectiveResults: make([]types.ObjectiveResult, len(ad.Spec.Objectives)), } diff --git a/metrics-operator/controllers/common/analysis/analysis_evaluator_test.go b/metrics-operator/controllers/common/analysis/analysis_evaluator_test.go index 713a454ea92..28770a180e5 100644 --- a/metrics-operator/controllers/common/analysis/analysis_evaluator_test.go +++ b/metrics-operator/controllers/common/analysis/analysis_evaluator_test.go @@ -12,14 +12,14 @@ import ( func TestAnalysisEvaluator_Evaluate(t *testing.T) { tests := []struct { name string - values map[string]string + values map[string]v1alpha3.ProviderResult a v1alpha3.AnalysisDefinition want types.AnalysisResult mockedEvaluator IObjectiveEvaluator }{ { name: "no objectives", - values: map[string]string{}, + values: map[string]v1alpha3.ProviderResult{}, a: v1alpha3.AnalysisDefinition{ Spec: v1alpha3.AnalysisDefinitionSpec{ Objectives: []v1alpha3.Objective{}, @@ -36,7 +36,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, { name: "pass scenario", - values: map[string]string{}, + values: map[string]v1alpha3.ProviderResult{}, a: v1alpha3.AnalysisDefinition{ Spec: v1alpha3.AnalysisDefinitionSpec{ Objectives: []v1alpha3.Objective{ @@ -65,7 +65,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, }, mockedEvaluator: &fake.IObjectiveEvaluatorMock{ - EvaluateFunc: func(values map[string]string, objective *v1alpha3.Objective) types.ObjectiveResult { + EvaluateFunc: func(values map[string]v1alpha3.ProviderResult, objective *v1alpha3.Objective) types.ObjectiveResult { return types.ObjectiveResult{ Result: types.TargetResult{}, Value: 5.0, @@ -77,7 +77,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, { name: "pass scenario - multiple objectives", - values: map[string]string{}, + values: map[string]v1alpha3.ProviderResult{}, a: v1alpha3.AnalysisDefinition{ Spec: v1alpha3.AnalysisDefinitionSpec{ Objectives: []v1alpha3.Objective{ @@ -115,7 +115,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, }, mockedEvaluator: &fake.IObjectiveEvaluatorMock{ - EvaluateFunc: func(values map[string]string, objective *v1alpha3.Objective) types.ObjectiveResult { + EvaluateFunc: func(values map[string]v1alpha3.ProviderResult, objective *v1alpha3.Objective) types.ObjectiveResult { return types.ObjectiveResult{ Result: types.TargetResult{}, Value: 5.0, @@ -127,7 +127,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, { name: "warning scenario", - values: map[string]string{}, + values: map[string]v1alpha3.ProviderResult{}, a: v1alpha3.AnalysisDefinition{ Spec: v1alpha3.AnalysisDefinitionSpec{ Objectives: []v1alpha3.Objective{ @@ -156,7 +156,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, }, mockedEvaluator: &fake.IObjectiveEvaluatorMock{ - EvaluateFunc: func(values map[string]string, objective *v1alpha3.Objective) types.ObjectiveResult { + EvaluateFunc: func(values map[string]v1alpha3.ProviderResult, objective *v1alpha3.Objective) types.ObjectiveResult { return types.ObjectiveResult{ Result: types.TargetResult{}, Value: 5.0, @@ -168,7 +168,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, { name: "fail scenario", - values: map[string]string{}, + values: map[string]v1alpha3.ProviderResult{}, a: v1alpha3.AnalysisDefinition{ Spec: v1alpha3.AnalysisDefinitionSpec{ Objectives: []v1alpha3.Objective{ @@ -197,7 +197,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, }, mockedEvaluator: &fake.IObjectiveEvaluatorMock{ - EvaluateFunc: func(values map[string]string, objective *v1alpha3.Objective) types.ObjectiveResult { + EvaluateFunc: func(values map[string]v1alpha3.ProviderResult, objective *v1alpha3.Objective) types.ObjectiveResult { return types.ObjectiveResult{ Result: types.TargetResult{}, Value: 5.0, @@ -209,7 +209,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, { name: "fail scenario - key objective failed", - values: map[string]string{}, + values: map[string]v1alpha3.ProviderResult{}, a: v1alpha3.AnalysisDefinition{ Spec: v1alpha3.AnalysisDefinitionSpec{ Objectives: []v1alpha3.Objective{ @@ -249,7 +249,7 @@ func TestAnalysisEvaluator_Evaluate(t *testing.T) { }, }, mockedEvaluator: &fake.IObjectiveEvaluatorMock{ - EvaluateFunc: func(values map[string]string, objective *v1alpha3.Objective) types.ObjectiveResult { + EvaluateFunc: func(values map[string]v1alpha3.ProviderResult, objective *v1alpha3.Objective) types.ObjectiveResult { if objective.KeyObjective { return types.ObjectiveResult{ Result: types.TargetResult{}, diff --git a/metrics-operator/controllers/common/analysis/fake/analysis_evaluator_mock.go b/metrics-operator/controllers/common/analysis/fake/analysis_evaluator_mock.go index 381a3c73c73..63eb12ebce1 100644 --- a/metrics-operator/controllers/common/analysis/fake/analysis_evaluator_mock.go +++ b/metrics-operator/controllers/common/analysis/fake/analysis_evaluator_mock.go @@ -15,7 +15,7 @@ import ( // // // make and configure a mocked analysis.IAnalysisEvaluator // mockedIAnalysisEvaluator := &IAnalysisEvaluatorMock{ -// EvaluateFunc: func(values map[string]string, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult { +// EvaluateFunc: func(values map[string]v1alpha3.ProviderResult, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult { // panic("mock out the Evaluate method") // }, // } @@ -26,14 +26,14 @@ import ( // } type IAnalysisEvaluatorMock struct { // EvaluateFunc mocks the Evaluate method. - EvaluateFunc func(values map[string]string, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult + EvaluateFunc func(values map[string]v1alpha3.ProviderResult, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult // calls tracks calls to the methods. calls struct { // Evaluate holds details about calls to the Evaluate method. Evaluate []struct { // Values is the values argument value. - Values map[string]string + Values map[string]v1alpha3.ProviderResult // Ad is the ad argument value. Ad *v1alpha3.AnalysisDefinition } @@ -42,12 +42,12 @@ type IAnalysisEvaluatorMock struct { } // Evaluate calls EvaluateFunc. -func (mock *IAnalysisEvaluatorMock) Evaluate(values map[string]string, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult { +func (mock *IAnalysisEvaluatorMock) Evaluate(values map[string]v1alpha3.ProviderResult, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult { if mock.EvaluateFunc == nil { panic("IAnalysisEvaluatorMock.EvaluateFunc: method is nil but IAnalysisEvaluator.Evaluate was just called") } callInfo := struct { - Values map[string]string + Values map[string]v1alpha3.ProviderResult Ad *v1alpha3.AnalysisDefinition }{ Values: values, @@ -64,11 +64,11 @@ func (mock *IAnalysisEvaluatorMock) Evaluate(values map[string]string, ad *v1alp // // len(mockedIAnalysisEvaluator.EvaluateCalls()) func (mock *IAnalysisEvaluatorMock) EvaluateCalls() []struct { - Values map[string]string + Values map[string]v1alpha3.ProviderResult Ad *v1alpha3.AnalysisDefinition } { var calls []struct { - Values map[string]string + Values map[string]v1alpha3.ProviderResult Ad *v1alpha3.AnalysisDefinition } mock.lockEvaluate.RLock() diff --git a/metrics-operator/controllers/common/analysis/fake/objective_evaluator_mock.go b/metrics-operator/controllers/common/analysis/fake/objective_evaluator_mock.go index 2201e8c8dcb..1ea54f496c3 100644 --- a/metrics-operator/controllers/common/analysis/fake/objective_evaluator_mock.go +++ b/metrics-operator/controllers/common/analysis/fake/objective_evaluator_mock.go @@ -15,7 +15,7 @@ import ( // // // make and configure a mocked analysis.IObjectiveEvaluator // mockedIObjectiveEvaluator := &IObjectiveEvaluatorMock{ -// EvaluateFunc: func(values map[string]string, objective *v1alpha3.Objective) types.ObjectiveResult { +// EvaluateFunc: func(values map[string]v1alpha3.ProviderResult, objective *v1alpha3.Objective) types.ObjectiveResult { // panic("mock out the Evaluate method") // }, // } @@ -26,14 +26,14 @@ import ( // } type IObjectiveEvaluatorMock struct { // EvaluateFunc mocks the Evaluate method. - EvaluateFunc func(values map[string]string, objective *v1alpha3.Objective) types.ObjectiveResult + EvaluateFunc func(values map[string]v1alpha3.ProviderResult, objective *v1alpha3.Objective) types.ObjectiveResult // calls tracks calls to the methods. calls struct { // Evaluate holds details about calls to the Evaluate method. Evaluate []struct { // Values is the values argument value. - Values map[string]string + Values map[string]v1alpha3.ProviderResult // Objective is the objective argument value. Objective *v1alpha3.Objective } @@ -42,12 +42,12 @@ type IObjectiveEvaluatorMock struct { } // Evaluate calls EvaluateFunc. -func (mock *IObjectiveEvaluatorMock) Evaluate(values map[string]string, objective *v1alpha3.Objective) types.ObjectiveResult { +func (mock *IObjectiveEvaluatorMock) Evaluate(values map[string]v1alpha3.ProviderResult, objective *v1alpha3.Objective) types.ObjectiveResult { if mock.EvaluateFunc == nil { panic("IObjectiveEvaluatorMock.EvaluateFunc: method is nil but IObjectiveEvaluator.Evaluate was just called") } callInfo := struct { - Values map[string]string + Values map[string]v1alpha3.ProviderResult Objective *v1alpha3.Objective }{ Values: values, @@ -64,11 +64,11 @@ func (mock *IObjectiveEvaluatorMock) Evaluate(values map[string]string, objectiv // // len(mockedIObjectiveEvaluator.EvaluateCalls()) func (mock *IObjectiveEvaluatorMock) EvaluateCalls() []struct { - Values map[string]string + Values map[string]v1alpha3.ProviderResult Objective *v1alpha3.Objective } { var calls []struct { - Values map[string]string + Values map[string]v1alpha3.ProviderResult Objective *v1alpha3.Objective } mock.lockEvaluate.RLock() diff --git a/metrics-operator/controllers/common/analysis/fake/operator_evaluator_mock.go b/metrics-operator/controllers/common/analysis/fake/operator_evaluator_mock.go new file mode 100644 index 00000000000..f9c9921c1fe --- /dev/null +++ b/metrics-operator/controllers/common/analysis/fake/operator_evaluator_mock.go @@ -0,0 +1,78 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fake + +import ( + "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis/types" + "sync" +) + +// IOperatorEvaluatorMock is a mock implementation of analysis.IOperatorEvaluator. +// +// func TestSomethingThatUsesIOperatorEvaluator(t *testing.T) { +// +// // make and configure a mocked analysis.IOperatorEvaluator +// mockedIOperatorEvaluator := &IOperatorEvaluatorMock{ +// EvaluateFunc: func(val float64, criteria *v1alpha3.Operator) types.OperatorResult { +// panic("mock out the Evaluate method") +// }, +// } +// +// // use mockedIOperatorEvaluator in code that requires analysis.IOperatorEvaluator +// // and then make assertions. +// +// } +type IOperatorEvaluatorMock struct { + // EvaluateFunc mocks the Evaluate method. + EvaluateFunc func(val float64, criteria *v1alpha3.Operator) types.OperatorResult + + // calls tracks calls to the methods. + calls struct { + // Evaluate holds details about calls to the Evaluate method. + Evaluate []struct { + // Val is the val argument value. + Val float64 + // Criteria is the criteria argument value. + Criteria *v1alpha3.Operator + } + } + lockEvaluate sync.RWMutex +} + +// Evaluate calls EvaluateFunc. +func (mock *IOperatorEvaluatorMock) Evaluate(val float64, criteria *v1alpha3.Operator) types.OperatorResult { + if mock.EvaluateFunc == nil { + panic("IOperatorEvaluatorMock.EvaluateFunc: method is nil but IOperatorEvaluator.Evaluate was just called") + } + callInfo := struct { + Val float64 + Criteria *v1alpha3.Operator + }{ + Val: val, + Criteria: criteria, + } + mock.lockEvaluate.Lock() + mock.calls.Evaluate = append(mock.calls.Evaluate, callInfo) + mock.lockEvaluate.Unlock() + return mock.EvaluateFunc(val, criteria) +} + +// EvaluateCalls gets all the calls that were made to Evaluate. +// Check the length with: +// +// len(mockedIOperatorEvaluator.EvaluateCalls()) +func (mock *IOperatorEvaluatorMock) EvaluateCalls() []struct { + Val float64 + Criteria *v1alpha3.Operator +} { + var calls []struct { + Val float64 + Criteria *v1alpha3.Operator + } + mock.lockEvaluate.RLock() + calls = mock.calls.Evaluate + mock.lockEvaluate.RUnlock() + return calls +} diff --git a/metrics-operator/controllers/common/analysis/interfaces.go b/metrics-operator/controllers/common/analysis/interfaces.go index 2b081f6c8ca..1fcc751c4db 100644 --- a/metrics-operator/controllers/common/analysis/interfaces.go +++ b/metrics-operator/controllers/common/analysis/interfaces.go @@ -7,12 +7,12 @@ import ( //go:generate moq -pkg fake -skip-ensure -out ./fake/analysis_evaluator_mock.go . IAnalysisEvaluator type IAnalysisEvaluator interface { - Evaluate(values map[string]string, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult + Evaluate(values map[string]v1alpha3.ProviderResult, ad *v1alpha3.AnalysisDefinition) types.AnalysisResult } //go:generate moq -pkg fake -skip-ensure -out ./fake/objective_evaluator_mock.go . IObjectiveEvaluator type IObjectiveEvaluator interface { - Evaluate(values map[string]string, objective *v1alpha3.Objective) types.ObjectiveResult + Evaluate(values map[string]v1alpha3.ProviderResult, objective *v1alpha3.Objective) types.ObjectiveResult } //go:generate moq -pkg fake -skip-ensure -out ./fake/target_evaluator_mock.go . ITargetEvaluator diff --git a/metrics-operator/controllers/common/analysis/objective_evaluator.go b/metrics-operator/controllers/common/analysis/objective_evaluator.go index a48de180d6e..c958918bbce 100644 --- a/metrics-operator/controllers/common/analysis/objective_evaluator.go +++ b/metrics-operator/controllers/common/analysis/objective_evaluator.go @@ -18,14 +18,14 @@ func NewObjectiveEvaluator(t ITargetEvaluator) ObjectiveEvaluator { } } -func (oe *ObjectiveEvaluator) Evaluate(values map[string]string, obj *v1alpha3.Objective) types.ObjectiveResult { +func (oe *ObjectiveEvaluator) Evaluate(values map[string]v1alpha3.ProviderResult, obj *v1alpha3.Objective) types.ObjectiveResult { result := types.ObjectiveResult{ Score: 0.0, Value: 0.0, } // get the value - floatVal, err := getValueFromMap(values, computeKey(obj.AnalysisValueTemplateRef)) + floatVal, err := getValueFromMap(values, ComputeKey(obj.AnalysisValueTemplateRef)) if err != nil { result.Error = err return result @@ -49,13 +49,12 @@ func (oe *ObjectiveEvaluator) Evaluate(values map[string]string, obj *v1alpha3.O return result } -func getValueFromMap(values map[string]string, key string) (float64, error) { +func getValueFromMap(values map[string]v1alpha3.ProviderResult, key string) (float64, error) { val, ok := values[key] if !ok { return 0.0, fmt.Errorf("required value '%s' not available", key) } - - floatVal, err := strconv.ParseFloat(val, 64) + floatVal, err := strconv.ParseFloat(val.Value, 64) if err != nil { return 0.0, err } @@ -63,7 +62,7 @@ func getValueFromMap(values map[string]string, key string) (float64, error) { return floatVal, nil } -func computeKey(obj v1alpha3.ObjectReference) string { +func ComputeKey(obj v1alpha3.ObjectReference) string { if obj.Namespace == "" { return obj.Name } diff --git a/metrics-operator/controllers/common/analysis/objective_evaluator_test.go b/metrics-operator/controllers/common/analysis/objective_evaluator_test.go index 19dcd3f47d1..f428667b096 100644 --- a/metrics-operator/controllers/common/analysis/objective_evaluator_test.go +++ b/metrics-operator/controllers/common/analysis/objective_evaluator_test.go @@ -13,14 +13,14 @@ import ( func TestObjectiveEvaluator_Evaluate(t *testing.T) { tests := []struct { name string - values map[string]string + values map[string]v1alpha3.ProviderResult o v1alpha3.Objective want types.ObjectiveResult mockedEvaluator ITargetEvaluator }{ { name: "no value in results map", - values: map[string]string{}, + values: map[string]v1alpha3.ProviderResult{}, o: v1alpha3.Objective{ AnalysisValueTemplateRef: v1alpha3.ObjectReference{ Name: "name", @@ -34,8 +34,8 @@ func TestObjectiveEvaluator_Evaluate(t *testing.T) { }, { name: "evaluation passed", - values: map[string]string{ - "name": "20", + values: map[string]v1alpha3.ProviderResult{ + "name": {Value: "20"}, }, o: v1alpha3.Objective{ AnalysisValueTemplateRef: v1alpha3.ObjectReference{ @@ -61,8 +61,8 @@ func TestObjectiveEvaluator_Evaluate(t *testing.T) { }, { name: "evaluation finished with warning", - values: map[string]string{ - "name": "20", + values: map[string]v1alpha3.ProviderResult{ + "name": {Value: "20"}, }, o: v1alpha3.Objective{ AnalysisValueTemplateRef: v1alpha3.ObjectReference{ @@ -90,8 +90,8 @@ func TestObjectiveEvaluator_Evaluate(t *testing.T) { }, { name: "evaluation failed", - values: map[string]string{ - "name": "20", + values: map[string]v1alpha3.ProviderResult{ + "name": {Value: "20"}, }, o: v1alpha3.Objective{ AnalysisValueTemplateRef: v1alpha3.ObjectReference{ @@ -129,24 +129,24 @@ func TestObjectiveEvaluator_Evaluate(t *testing.T) { func TestGetValueFromMap(t *testing.T) { tests := []struct { name string - values map[string]string + values map[string]v1alpha3.ProviderResult in string val float64 wantErr bool }{ { name: "happy path", - values: map[string]string{ - "key": "7", + values: map[string]v1alpha3.ProviderResult{ + "key1": {Value: "7"}, }, - in: "key", + in: "key1", val: 7.0, wantErr: false, }, { name: "key not found", - values: map[string]string{ - "key1": "7", + values: map[string]v1alpha3.ProviderResult{ + "key1": {Value: "7"}, }, in: "key", val: 0.0, @@ -154,10 +154,10 @@ func TestGetValueFromMap(t *testing.T) { }, { name: "value not float", - values: map[string]string{ - "key": "", + values: map[string]v1alpha3.ProviderResult{ + "key": {}, }, - in: "key", + in: "key1", val: 0.0, wantErr: true, }, @@ -179,9 +179,9 @@ func TestComputeKey(t *testing.T) { Name: "key", } - require.Equal(t, "key", computeKey(obj)) + require.Equal(t, "key", ComputeKey(obj)) obj.Namespace = "namespace" - require.Equal(t, "key-namespace", computeKey(obj)) + require.Equal(t, "key-namespace", ComputeKey(obj)) } diff --git a/metrics-operator/controllers/common/analysis/target_evaluator.go b/metrics-operator/controllers/common/analysis/target_evaluator.go index b20e71c50e6..45170fb2619 100644 --- a/metrics-operator/controllers/common/analysis/target_evaluator.go +++ b/metrics-operator/controllers/common/analysis/target_evaluator.go @@ -15,7 +15,7 @@ func NewTargetEvaluator(o IOperatorEvaluator) TargetEvaluator { } } -func (te *TargetEvaluator) Evaluate(val float64, t v1alpha3.Target) types.TargetResult { +func (te *TargetEvaluator) Evaluate(val float64, t *v1alpha3.Target) types.TargetResult { result := types.TargetResult{ Warning: false, Pass: false, diff --git a/metrics-operator/controllers/common/analysis/target_evaluator_test.go b/metrics-operator/controllers/common/analysis/target_evaluator_test.go index 4305aba647c..453adc3b4a9 100644 --- a/metrics-operator/controllers/common/analysis/target_evaluator_test.go +++ b/metrics-operator/controllers/common/analysis/target_evaluator_test.go @@ -149,7 +149,7 @@ func TestTargetEvaluator_Evaluate(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { te := NewTargetEvaluator(&OperatorEvaluator{}) - require.Equal(t, tt.want, te.Evaluate(tt.val, tt.t)) + require.Equal(t, tt.want, te.Evaluate(tt.val, &tt.t)) }) } } diff --git a/metrics-operator/controllers/common/analysis/types/types.go b/metrics-operator/controllers/common/analysis/types/types.go index b948c356ce9..f2069fe8aab 100644 --- a/metrics-operator/controllers/common/analysis/types/types.go +++ b/metrics-operator/controllers/common/analysis/types/types.go @@ -1,12 +1,20 @@ package types -import "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" +import ( + "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" +) + +type ProviderRequest struct { + Objective *v1alpha3.Objective + Query string + Provider *v1alpha3.KeptnMetricsProvider +} type TargetResult struct { - FailResult OperatorResult - WarnResult OperatorResult - Warning bool - Pass bool + FailResult OperatorResult `json:"failResult,omitempty"` + WarnResult OperatorResult `json:"warnResult,omitempty"` + Warning bool `json:"warning,omitempty"` + Pass bool `json:"pass,omitempty"` } func (t *TargetResult) IsFail() bool { @@ -18,15 +26,15 @@ func (t *TargetResult) IsWarn() bool { } type OperatorResult struct { - Operator v1alpha3.Operator - Fulfilled bool + Operator v1alpha3.Operator `json:"operator,omitempty"` + Fulfilled bool `json:"fulfilled,omitempty"` } type ObjectiveResult struct { - Result TargetResult - Value float64 - Score float64 - Error error + Result TargetResult `json:"result,omitempty"` + Value float64 `json:"value,omitempty"` + Score float64 `json:"score,omitempty"` + Error error `json:"error,omitempty"` } func (o *ObjectiveResult) IsFail() bool { @@ -42,11 +50,11 @@ func (o *ObjectiveResult) IsWarn() bool { } type AnalysisResult struct { - ObjectiveResults []ObjectiveResult - TotalScore float64 - MaximumScore float64 - Pass bool - Warning bool + ObjectiveResults []ObjectiveResult `json:"objectiveResults,omitempty"` + TotalScore float64 `json:"totalScore,omitempty"` + MaximumScore float64 `json:"maximumScore,omitempty"` + Pass bool `json:"pass,omitempty"` + Warning bool `json:"warning,omitempty"` } func (a *AnalysisResult) GetAchievedPercentage() float64 { diff --git a/metrics-operator/controllers/common/providers/datadog/datadog.go b/metrics-operator/controllers/common/providers/datadog/datadog.go index b230d4f8c38..93adbafd8a2 100644 --- a/metrics-operator/controllers/common/providers/datadog/datadog.go +++ b/metrics-operator/controllers/common/providers/datadog/datadog.go @@ -26,10 +26,11 @@ type KeptnDataDogProvider struct { K8sClient client.Client } -func (d *KeptnDataDogProvider) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, []byte, error) { +func (d *KeptnDataDogProvider) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) { ctx, cancel := context.WithTimeout(ctx, 20*time.Second) defer cancel() - return d.query(ctx, query, *provider, spec.From.Unix(), spec.To.Unix()) + res, _, err := d.query(ctx, query, *provider, spec.From.Unix(), spec.To.Unix()) + return res, err } // EvaluateQuery fetches the SLI values from datadog provider diff --git a/metrics-operator/controllers/common/providers/datadog/datadog_test.go b/metrics-operator/controllers/common/providers/datadog/datadog_test.go index 14b0b78b50e..73412c76f30 100644 --- a/metrics-operator/controllers/common/providers/datadog/datadog_test.go +++ b/metrics-operator/controllers/common/providers/datadog/datadog_test.go @@ -919,6 +919,54 @@ func TestEvaluateQueryForStep_WrongStep(t *testing.T) { require.Empty(t, r) } +func TestFetchAnalysisValue_HappyPath(t *testing.T) { + svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, err := w.Write([]byte(ddPayload)) + require.Nil(t, err) + })) + defer svr.Close() + + secretName := "datadogSecret" + apiKey, apiKeyValue := "DD_CLIENT_API_KEY", "fake-api-key" + appKey, appKeyValue := "DD_CLIENT_APP_KEY", "fake-app-key" + apiToken := &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: secretName, + Namespace: "", + }, + Data: map[string][]byte{ + apiKey: []byte(apiKeyValue), + appKey: []byte(appKeyValue), + }, + } + kdd := setupTest(apiToken) + + b := true + p := metricsapi.KeptnMetricsProvider{ + Spec: metricsapi.KeptnMetricsProviderSpec{ + SecretKeyRef: v1.SecretKeySelector{ + LocalObjectReference: v1.LocalObjectReference{ + Name: secretName, + }, + Optional: &b, + }, + TargetServer: svr.URL, + }, + } + + spec := metricsapi.AnalysisSpec{ + Timeframe: metricsapi.Timeframe{ + From: metav1.Time{Time: time.Now()}, + To: metav1.Time{Time: time.Now()}, + }, + } + + r, e := kdd.FetchAnalysisValue(context.TODO(), "system.cpu.idle{*}", spec, &p) + require.Nil(t, e) + require.Equal(t, fmt.Sprintf("%.3f", 89.116), r) + +} + func TestGetSingleValue_EmptyPoints(t *testing.T) { kdd := setupTest() var points [][]*float64 diff --git a/metrics-operator/controllers/common/providers/dynatrace/dynatrace.go b/metrics-operator/controllers/common/providers/dynatrace/dynatrace.go index 36a1d5d7398..41887ca43e3 100644 --- a/metrics-operator/controllers/common/providers/dynatrace/dynatrace.go +++ b/metrics-operator/controllers/common/providers/dynatrace/dynatrace.go @@ -38,11 +38,12 @@ type DynatraceData struct { Values []*float64 `json:"values"` } -func (d *KeptnDynatraceProvider) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, []byte, error) { +func (d *KeptnDynatraceProvider) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) { baseURL := d.normalizeAPIURL(provider.Spec.TargetServer) escapedQ := urlEncodeQuery(query) qURL := baseURL + "v2/metrics/query?metricSelector=" + escapedQ + "&from=" + spec.From.String() + "&to=" + spec.To.String() - return d.runQuery(ctx, qURL, *provider) + res, _, err := d.runQuery(ctx, qURL, *provider) + return res, err } // EvaluateQuery fetches the SLI values from dynatrace provider diff --git a/metrics-operator/controllers/common/providers/dynatrace/dynatrace_dql.go b/metrics-operator/controllers/common/providers/dynatrace/dynatrace_dql.go index 8b25dca6d84..22c75cd8b04 100644 --- a/metrics-operator/controllers/common/providers/dynatrace/dynatrace_dql.go +++ b/metrics-operator/controllers/common/providers/dynatrace/dynatrace_dql.go @@ -31,7 +31,7 @@ type keptnDynatraceDQLProvider struct { clock clock.Clock } -func (d *keptnDynatraceDQLProvider) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, []byte, error) { +func (d *keptnDynatraceDQLProvider) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) { //TODO implement me panic("implement me") } diff --git a/metrics-operator/controllers/common/providers/fake/provider_mock.go b/metrics-operator/controllers/common/providers/fake/provider_mock.go new file mode 100644 index 00000000000..2ee3f8d229f --- /dev/null +++ b/metrics-operator/controllers/common/providers/fake/provider_mock.go @@ -0,0 +1,146 @@ +// Code generated by moq; DO NOT EDIT. +// github.com/matryer/moq + +package fake + +import ( + "context" + metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "sync" +) + +// KeptnSLIProviderMock is a mock implementation of providers.KeptnSLIProvider. +// +// func TestSomethingThatUsesKeptnSLIProvider(t *testing.T) { +// +// // make and configure a mocked providers.KeptnSLIProvider +// mockedKeptnSLIProvider := &KeptnSLIProviderMock{ +// EvaluateQueryFunc: func(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) (string, []byte, error) { +// panic("mock out the EvaluateQuery method") +// }, +// FetchAnalysisValueFunc: func(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) { +// panic("mock out the FetchAnalysisValue method") +// }, +// } +// +// // use mockedKeptnSLIProvider in code that requires providers.KeptnSLIProvider +// // and then make assertions. +// +// } +type KeptnSLIProviderMock struct { + // EvaluateQueryFunc mocks the EvaluateQuery method. + EvaluateQueryFunc func(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) (string, []byte, error) + + // FetchAnalysisValueFunc mocks the FetchAnalysisValue method. + FetchAnalysisValueFunc func(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) + + // calls tracks calls to the methods. + calls struct { + // EvaluateQuery holds details about calls to the EvaluateQuery method. + EvaluateQuery []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Metric is the metric argument value. + Metric metricsapi.KeptnMetric + // Provider is the provider argument value. + Provider metricsapi.KeptnMetricsProvider + } + // FetchAnalysisValue holds details about calls to the FetchAnalysisValue method. + FetchAnalysisValue []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Query is the query argument value. + Query string + // Spec is the spec argument value. + Spec metricsapi.AnalysisSpec + // Provider is the provider argument value. + Provider *metricsapi.KeptnMetricsProvider + } + } + lockEvaluateQuery sync.RWMutex + lockFetchAnalysisValue sync.RWMutex +} + +// EvaluateQuery calls EvaluateQueryFunc. +func (mock *KeptnSLIProviderMock) EvaluateQuery(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) (string, []byte, error) { + if mock.EvaluateQueryFunc == nil { + panic("KeptnSLIProviderMock.EvaluateQueryFunc: method is nil but KeptnSLIProvider.EvaluateQuery was just called") + } + callInfo := struct { + Ctx context.Context + Metric metricsapi.KeptnMetric + Provider metricsapi.KeptnMetricsProvider + }{ + Ctx: ctx, + Metric: metric, + Provider: provider, + } + mock.lockEvaluateQuery.Lock() + mock.calls.EvaluateQuery = append(mock.calls.EvaluateQuery, callInfo) + mock.lockEvaluateQuery.Unlock() + return mock.EvaluateQueryFunc(ctx, metric, provider) +} + +// EvaluateQueryCalls gets all the calls that were made to EvaluateQuery. +// Check the length with: +// +// len(mockedKeptnSLIProvider.EvaluateQueryCalls()) +func (mock *KeptnSLIProviderMock) EvaluateQueryCalls() []struct { + Ctx context.Context + Metric metricsapi.KeptnMetric + Provider metricsapi.KeptnMetricsProvider +} { + var calls []struct { + Ctx context.Context + Metric metricsapi.KeptnMetric + Provider metricsapi.KeptnMetricsProvider + } + mock.lockEvaluateQuery.RLock() + calls = mock.calls.EvaluateQuery + mock.lockEvaluateQuery.RUnlock() + return calls +} + +// FetchAnalysisValue calls FetchAnalysisValueFunc. +func (mock *KeptnSLIProviderMock) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) { + if mock.FetchAnalysisValueFunc == nil { + panic("KeptnSLIProviderMock.FetchAnalysisValueFunc: method is nil but KeptnSLIProvider.FetchAnalysisValue was just called") + } + callInfo := struct { + Ctx context.Context + Query string + Spec metricsapi.AnalysisSpec + Provider *metricsapi.KeptnMetricsProvider + }{ + Ctx: ctx, + Query: query, + Spec: spec, + Provider: provider, + } + mock.lockFetchAnalysisValue.Lock() + mock.calls.FetchAnalysisValue = append(mock.calls.FetchAnalysisValue, callInfo) + mock.lockFetchAnalysisValue.Unlock() + return mock.FetchAnalysisValueFunc(ctx, query, spec, provider) +} + +// FetchAnalysisValueCalls gets all the calls that were made to FetchAnalysisValue. +// Check the length with: +// +// len(mockedKeptnSLIProvider.FetchAnalysisValueCalls()) +func (mock *KeptnSLIProviderMock) FetchAnalysisValueCalls() []struct { + Ctx context.Context + Query string + Spec metricsapi.AnalysisSpec + Provider *metricsapi.KeptnMetricsProvider +} { + var calls []struct { + Ctx context.Context + Query string + Spec metricsapi.AnalysisSpec + Provider *metricsapi.KeptnMetricsProvider + } + mock.lockFetchAnalysisValue.RLock() + calls = mock.calls.FetchAnalysisValue + mock.lockFetchAnalysisValue.RUnlock() + return calls +} diff --git a/metrics-operator/controllers/common/providers/prometheus/prometheus.go b/metrics-operator/controllers/common/providers/prometheus/prometheus.go index dbd6ca4a122..93190a153a9 100644 --- a/metrics-operator/controllers/common/providers/prometheus/prometheus.go +++ b/metrics-operator/controllers/common/providers/prometheus/prometheus.go @@ -23,13 +23,13 @@ type KeptnPrometheusProvider struct { HttpClient http.Client } -func (r *KeptnPrometheusProvider) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, []byte, error) { +func (r *KeptnPrometheusProvider) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) { ctx, cancel := context.WithTimeout(ctx, 20*time.Second) defer cancel() client, err := promapi.NewClient(promapi.Config{Address: provider.Spec.TargetServer, Client: &r.HttpClient}) if err != nil { - return "", nil, err + return "", err } api := prometheus.NewAPI(client) r.Log.Info(fmt.Sprintf( @@ -40,6 +40,7 @@ func (r *KeptnPrometheusProvider) FetchAnalysisValue(ctx context.Context, query queryRange := prometheus.Range{ Start: spec.From.Time, End: spec.To.Time, + Step: time.Minute, } result, warnings, err := api.QueryRange( ctx, @@ -49,12 +50,13 @@ func (r *KeptnPrometheusProvider) FetchAnalysisValue(ctx context.Context, query ) if err != nil { - return "", nil, err + return "", err } if len(warnings) != 0 { r.Log.Info("Prometheus API returned warnings: " + warnings[0]) } - return getResultForMatrix(result) + res, _, err := getResultForMatrix(result) + return res, err } // EvaluateQuery fetches the SLI values from prometheus provider diff --git a/metrics-operator/controllers/common/providers/prometheus/prometheus_test.go b/metrics-operator/controllers/common/providers/prometheus/prometheus_test.go index 8c0558cdd4c..7d527fb385f 100644 --- a/metrics-operator/controllers/common/providers/prometheus/prometheus_test.go +++ b/metrics-operator/controllers/common/providers/prometheus/prometheus_test.go @@ -360,7 +360,7 @@ func TestFetchAnalysisValue(t *testing.T) { expectedResult := "1" // Call the function - result, _, err := provider.FetchAnalysisValue(context.Background(), "your_query_string_here", analysisSpec, mockProvider) + result, err := provider.FetchAnalysisValue(context.Background(), "your_query_string_here", analysisSpec, mockProvider) // Assertions require.NoError(t, err) diff --git a/metrics-operator/controllers/common/providers/provider.go b/metrics-operator/controllers/common/providers/provider.go index 779d75eb863..fa1597f5380 100644 --- a/metrics-operator/controllers/common/providers/provider.go +++ b/metrics-operator/controllers/common/providers/provider.go @@ -15,11 +15,15 @@ import ( ) // KeptnSLIProvider is the interface that describes the operations that an SLI provider must implement +// +//go:generate moq -pkg fake -skip-ensure -out ./fake/provider_mock.go . KeptnSLIProvider type KeptnSLIProvider interface { EvaluateQuery(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) (string, []byte, error) - FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, []byte, error) + FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) } +type ProviderFactory func(providerType string, log logr.Logger, k8sClient client.Client) (KeptnSLIProvider, error) + // NewProvider is a factory method that chooses the right implementation of KeptnSLIProvider func NewProvider(providerType string, log logr.Logger, k8sClient client.Client) (KeptnSLIProvider, error) { diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index 528ed325e27..f8be103ac5d 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -14,6 +14,8 @@ require ( github.com/prometheus/client_golang v1.16.0 github.com/prometheus/common v0.44.0 github.com/stretchr/testify v1.8.4 + golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb + golang.org/x/net v0.10.0 gopkg.in/inf.v0 v0.9.1 k8s.io/api v0.26.7 k8s.io/apiextensions-apiserver v0.26.7 @@ -96,8 +98,6 @@ require ( go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.12.0 // indirect - golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb // indirect - golang.org/x/net v0.10.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect golang.org/x/sync v0.2.0 // indirect golang.org/x/sys v0.11.0 // indirect diff --git a/metrics-operator/main.go b/metrics-operator/main.go index 7bfa322bab5..ced779a28a6 100644 --- a/metrics-operator/main.go +++ b/metrics-operator/main.go @@ -34,6 +34,8 @@ import ( metricsv1alpha2 "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha2" metricsv1alpha3 "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" "github.com/keptn/lifecycle-toolkit/metrics-operator/cmd/metrics/adapter" + analysiscontroller "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/analysis" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/analysis" metricscontroller "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/metrics" "github.com/keptn/lifecycle-toolkit/metrics-operator/converter" keptnserver "github.com/keptn/lifecycle-toolkit/metrics-operator/pkg/metrics" @@ -47,6 +49,7 @@ import ( ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" + "sigs.k8s.io/controller-runtime/pkg/manager" ) var ( @@ -68,7 +71,9 @@ type envConfig struct { PodNamespace string `envconfig:"POD_NAMESPACE" default:""` PodName string `envconfig:"POD_NAME" default:""` KeptnMetricControllerLogLevel int `envconfig:"METRICS_CONTROLLER_LOG_LEVEL" default:"0"` + AnalysisControllerLogLevel int `envconfig:"ANALYSIS_CONTROLLER_LOG_LEVEL" default:"0"` ExposeKeptnMetrics bool `envconfig:"EXPOSE_KEPTN_METRICS" default:"true"` + EnableKeptnAnalysis bool `envconfig:"ENABLE_ANALYSIS" default:"false"` } //nolint:gocyclo,funlen @@ -174,24 +179,31 @@ func main() { setupLog.Error(err, "unable to create controller", "controller", "KeptnMetric") os.Exit(1) } - if err = (&metricsv1alpha3.KeptnMetric{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "KeptnMetric") - os.Exit(1) - } - if err = (&metricsv1alpha3.AnalysisDefinition{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "AnalysisDefinition") - os.Exit(1) + + if env.EnableKeptnAnalysis { + + analysisLogger := ctrl.Log.WithName("KeptnAnalysis Controller") + targetEval := analysis.NewTargetEvaluator(&analysis.OperatorEvaluator{}) + objEval := analysis.NewObjectiveEvaluator(&targetEval) + analysisEval := analysis.NewAnalysisEvaluator(&objEval) + + if err = (&analysiscontroller.AnalysisReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + Log: analysisLogger.V(env.AnalysisControllerLogLevel), + MaxWorkers: 2, + Namespace: env.PodNamespace, + NewWorkersPoolFactory: analysiscontroller.NewWorkersPool, + IAnalysisEvaluator: &analysisEval, + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "KeptnMetric") + os.Exit(1) + } } // +kubebuilder:scaffold:builder - if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { - setupLog.Error(err, "unable to set up health check") - os.Exit(1) - } - if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil { - setupLog.Error(err, "unable to set up ready check") - os.Exit(1) - } + setupValidationWebhooks(mgr) + setupProbes(mgr) if !disableWebhook { webhookBuilder := webhook.NewWebhookBuilder(). @@ -228,6 +240,29 @@ func main() { } } +func setupValidationWebhooks(mgr manager.Manager) { + if err := (&metricsv1alpha3.KeptnMetric{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "KeptnMetric") + os.Exit(1) + } + if err := (&metricsv1alpha3.AnalysisDefinition{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "AnalysisDefinition") + os.Exit(1) + } +} + +func setupProbes(mgr manager.Manager) { + + if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { + setupLog.Error(err, "unable to set up health check") + os.Exit(1) + } + if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil { + setupLog.Error(err, "unable to set up ready check") + os.Exit(1) + } +} + func startCustomMetricsAdapter(namespace string) { ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGTERM) defer cancel() diff --git a/test/integration/analysis-controller/00-install.yaml b/test/integration/analysis-controller/00-install.yaml new file mode 100644 index 00000000000..bdaa9f30bab --- /dev/null +++ b/test/integration/analysis-controller/00-install.yaml @@ -0,0 +1,42 @@ +apiVersion: metrics.keptn.sh/v1alpha3 +kind: AnalysisValueTemplate +metadata: + name: ready + namespace: keptn-lifecycle-toolkit-system +spec: + provider: + name: my-provider + namespace: keptn-lifecycle-toolkit-system + query: 'sum(kube_pod_container_status_ready{namespace="{{.ns}}"})' +--- +apiVersion: metrics.keptn.sh/v1alpha3 +kind: AnalysisDefinition +metadata: + name: ed-my-proj-dev-svc1 + namespace: keptn-lifecycle-toolkit-system +spec: + objectives: + - analysisValueTemplateRef: + name: ready + namespace: keptn-lifecycle-toolkit-system + target: + failure: + lessThan: + fixedValue: 2 + warning: + lessThan: + fixedValue: 3 + weight: 1 + keyObjective: false + totalScore: + passPercentage: 90 + warningPercentage: 75 +--- +apiVersion: metrics.keptn.sh/v1alpha3 +kind: KeptnMetricsProvider +metadata: + name: my-provider + namespace: keptn-lifecycle-toolkit-system +spec: + type: prometheus + targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" diff --git a/test/integration/analysis-controller/00-teststep-template.yaml b/test/integration/analysis-controller/00-teststep-template.yaml new file mode 100644 index 00000000000..a105480b85c --- /dev/null +++ b/test/integration/analysis-controller/00-teststep-template.yaml @@ -0,0 +1,19 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + # substitutes current time and namespace, making sure they are changed to env var first + # to prevent bad files in case of a test interrupt + - script: | + current_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + initial_timestamp=$(date -u -d "$current_time" +%s) + seconds_to_add=20 + new_timestamp=$((initial_timestamp + seconds_to_add)) + time_20_seconds_later=$(date -u -d "@$new_timestamp" +"%Y-%m-%dT%H:%M:%SZ") + export CURRENT_TIME="$current_time" + export LATER="$time_20_seconds_later" + echo "templating time" $CURRENT_TIME $LATER + envsubst <"install.yaml" >out.yaml + - command: kubectl apply -f out.yaml + # rewrites the env var not to push useless date changes when running locally + - script: | + rm out.yaml diff --git a/test/integration/analysis-controller/01-assert.yaml b/test/integration/analysis-controller/01-assert.yaml new file mode 100644 index 00000000000..1b3218cb979 --- /dev/null +++ b/test/integration/analysis-controller/01-assert.yaml @@ -0,0 +1,12 @@ +apiVersion: metrics.keptn.sh/v1alpha3 +kind: Analysis +metadata: + name: analysis-sample +spec: + analysisDefinition: + name: ed-my-proj-dev-svc1 + namespace: keptn-lifecycle-toolkit-system +status: + pass: true + # yamllint disable-line rule:line-length + raw: '{"objectiveResults":[{"result":{"failResult":{"operator":{"lessThan":{"fixedValue":"2"}}},"warnResult":{"operator":{"lessThan":{"fixedValue":"3"}}},"pass":true},"value":4,"score":1}],"totalScore":1,"maximumScore":1,"pass":true}' diff --git a/test/integration/analysis-controller/install.yaml b/test/integration/analysis-controller/install.yaml new file mode 100644 index 00000000000..ad872b5f0af --- /dev/null +++ b/test/integration/analysis-controller/install.yaml @@ -0,0 +1,14 @@ +apiVersion: metrics.keptn.sh/v1alpha3 +kind: Analysis +metadata: + name: analysis-sample + namespace: $NAMESPACE +spec: + timeframe: + from: $CURRENT_TIME + to: $LATER + args: + "ns": "keptn-lifecycle-toolkit-system" + analysisDefinition: + name: ed-my-proj-dev-svc1 + namespace: keptn-lifecycle-toolkit-system From 00f3cd3f1d9f27046f31cd36924c0bed855faed2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:23:19 +0200 Subject: [PATCH 30/78] deps: update module github.com/datadog/datadog-api-client-go/v2 to v2.16.0 (#1957) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- metrics-operator/go.mod | 9 ++++----- metrics-operator/go.sum | 15 +++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index f8be103ac5d..12fc377877a 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -3,7 +3,7 @@ module github.com/keptn/lifecycle-toolkit/metrics-operator go 1.20 require ( - github.com/DataDog/datadog-api-client-go/v2 v2.15.0 + github.com/DataDog/datadog-api-client-go/v2 v2.16.0 github.com/benbjohnson/clock v1.3.5 github.com/go-logr/logr v1.2.4 github.com/gorilla/mux v1.8.0 @@ -15,7 +15,7 @@ require ( github.com/prometheus/common v0.44.0 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb - golang.org/x/net v0.10.0 + golang.org/x/net v0.12.0 gopkg.in/inf.v0 v0.9.1 k8s.io/api v0.26.7 k8s.io/apiextensions-apiserver v0.26.7 @@ -31,7 +31,6 @@ require ( ) require ( - cloud.google.com/go/compute/metadata v0.2.3 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect @@ -98,7 +97,7 @@ require ( go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.12.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/sync v0.2.0 // indirect golang.org/x/sys v0.11.0 // indirect golang.org/x/term v0.11.0 // indirect @@ -108,7 +107,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd // indirect google.golang.org/grpc v1.52.3 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/metrics-operator/go.sum b/metrics-operator/go.sum index 628021208ca..afbf714e897 100644 --- a/metrics-operator/go.sum +++ b/metrics-operator/go.sum @@ -24,9 +24,8 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.14.0 h1:hfm2+FfxVmnRlh6LpB7cg1ZNU+5edAHmW679JePztk0= +cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -43,8 +42,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-api-client-go/v2 v2.15.0 h1:5UVON1xs6Lul4d6R5TmLDqqSJxOkunkm/UdM/fjm+zc= -github.com/DataDog/datadog-api-client-go/v2 v2.15.0/go.mod h1:ZG8wS+y2rUmkRDJZQq7Og7EAPFPage+7vXcmuah2I9o= +github.com/DataDog/datadog-api-client-go/v2 v2.16.0 h1:wwroXLmBlO5/o+uS1UxDpuMIkhIL6gJAu6m0ttGM5Yc= +github.com/DataDog/datadog-api-client-go/v2 v2.16.0/go.mod h1:uJd7G1BONVIyiVw684VMn2XYI1FfN1tx4bRGenAf2bo= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= @@ -484,8 +483,8 @@ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -734,8 +733,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From a0a1a7e97906ab56ed85da7ab9b6d1e13c902397 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:23:29 +0200 Subject: [PATCH 31/78] deps: update opentelemetry-go monorepo (minor) (#1931) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- lifecycle-operator/go.mod | 30 ++++++++-------- lifecycle-operator/go.sum | 72 ++++++++++++++++----------------------- 2 files changed, 43 insertions(+), 59 deletions(-) diff --git a/lifecycle-operator/go.mod b/lifecycle-operator/go.mod index e87db664dc3..929689a5ed3 100644 --- a/lifecycle-operator/go.mod +++ b/lifecycle-operator/go.mod @@ -16,14 +16,14 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 github.com/stretchr/testify v1.8.4 - go.opentelemetry.io/otel v1.15.1 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 - go.opentelemetry.io/otel/exporters/prometheus v0.38.1 - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1 - go.opentelemetry.io/otel/metric v0.38.1 - go.opentelemetry.io/otel/sdk v1.15.1 - go.opentelemetry.io/otel/sdk/metric v0.38.1 - go.opentelemetry.io/otel/trace v1.15.1 + go.opentelemetry.io/otel v1.17.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.17.0 + go.opentelemetry.io/otel/exporters/prometheus v0.40.0 + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.17.0 + go.opentelemetry.io/otel/metric v1.17.0 + go.opentelemetry.io/otel/sdk v1.17.0 + go.opentelemetry.io/otel/sdk/metric v0.40.0 + go.opentelemetry.io/otel/trace v1.17.0 google.golang.org/grpc v1.57.0 k8s.io/api v0.26.7 k8s.io/apiextensions-apiserver v0.26.7 @@ -68,7 +68,7 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -82,19 +82,17 @@ require ( github.com/prometheus/procfs v0.10.1 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/pflag v1.0.5 // indirect - go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 // indirect - go.opentelemetry.io/proto/otlp v0.19.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.17.0 // indirect + go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.9.3 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/component-base v0.26.7 // indirect diff --git a/lifecycle-operator/go.sum b/lifecycle-operator/go.sum index 97bc53fb2f5..c70f06c06b6 100644 --- a/lifecycle-operator/go.sum +++ b/lifecycle-operator/go.sum @@ -54,7 +54,6 @@ github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqy github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -66,11 +65,7 @@ github.com/cloudevents/sdk-go/v2 v2.14.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUE github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -83,7 +78,6 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= @@ -118,7 +112,6 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -164,7 +157,6 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -193,8 +185,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -287,29 +279,27 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opentelemetry.io/otel v1.15.1 h1:3Iwq3lfRByPaws0f6bU3naAqOR1n5IeDWd9390kWHa8= -go.opentelemetry.io/otel v1.15.1/go.mod h1:mHHGEHVDLal6YrKMmk9LqC4a3sF5g+fHfrttQIB1NTc= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1 h1:XYDQtNzdb2T4uM1pku2m76eSMDJgqhJ+6KzkqgQBALc= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1/go.mod h1:uOTV75+LOzV+ODmL8ahRLWkFA3eQcSC2aAsbxIu4duk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 h1:tyoeaUh8REKay72DVYsSEBYV18+fGONe+YYPaOxgLoE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1/go.mod h1:HUSnrjQQ19KX9ECjpQxufsF+3ioD3zISPMlauTPZu2g= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 h1:pIfoG5IAZFzp9EUlJzdSkpUwpaUAAnD+Ru1nBLTACIQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1/go.mod h1:poNKBqF5+nR/6ke2oGTDjHfksrsHDOHXAl2g4+9ONsY= -go.opentelemetry.io/otel/exporters/prometheus v0.38.1 h1:GwalIvFIx91qIA8qyAyqYj9lql5Ba2Oxj/jDG6+3UoU= -go.opentelemetry.io/otel/exporters/prometheus v0.38.1/go.mod h1:6K7aBvWHXRUcNYFSj6Hi5hHwzA1jYflG/T8snrX4dYM= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1 h1:2PunuO5SbkN5MhCbuHCd3tC6qrcaj+uDAkX/qBU5BAs= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1/go.mod h1:q8+Tha+5LThjeSU8BW93uUC5w5/+DnYHMKBMpRCsui0= -go.opentelemetry.io/otel/metric v0.38.1 h1:2MM7m6wPw9B8Qv8iHygoAgkbejed59uUR6ezR5T3X2s= -go.opentelemetry.io/otel/metric v0.38.1/go.mod h1:FwqNHD3I/5iX9pfrRGZIlYICrJv0rHEUl2Ln5vdIVnQ= -go.opentelemetry.io/otel/sdk v1.15.1 h1:5FKR+skgpzvhPQHIEfcwMYjCBr14LWzs3uSqKiQzETI= -go.opentelemetry.io/otel/sdk v1.15.1/go.mod h1:8rVtxQfrbmbHKfqzpQkT5EzZMcbMBwTzNAggbEAM0KA= -go.opentelemetry.io/otel/sdk/metric v0.38.1 h1:EkO5wI4NT/fUaoPMGc0fKV28JaWe7q4vfVpEVasGb+8= -go.opentelemetry.io/otel/sdk/metric v0.38.1/go.mod h1:Rn4kSXFF9ZQZ5lL1pxQjCbK4seiO+U7s0ncmIFJaj34= -go.opentelemetry.io/otel/trace v1.15.1 h1:uXLo6iHJEzDfrNC0L0mNjItIp06SyaBQxu5t3xMlngY= -go.opentelemetry.io/otel/trace v1.15.1/go.mod h1:IWdQG/5N1x7f6YUlmdLeJvH9yxtuJAfc4VW5Agv9r/8= +go.opentelemetry.io/otel v1.17.0 h1:MW+phZ6WZ5/uk2nd93ANk/6yJ+dVrvNWUjGhnnFU5jM= +go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.17.0 h1:U5GYackKpVKlPrd/5gKMlrTlP2dCESAAFU682VCpieY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.17.0/go.mod h1:aFsJfCEnLzEu9vRRAcUiB/cpRTbVsNdF3OHSPpdjxZQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.17.0 h1:iGeIsSYwpYSvh5UGzWrJfTDJvPjrXtxl3GUppj6IXQU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.17.0/go.mod h1:1j3H3G1SBYpZFti6OI4P0uRQCW20MXkG5v4UWXppLLE= +go.opentelemetry.io/otel/exporters/prometheus v0.40.0 h1:9h6lCssr1j5aYVvWT6oc+ERB6R034zmsHjBRLyxrAR8= +go.opentelemetry.io/otel/exporters/prometheus v0.40.0/go.mod h1:5USWZ0ovyQB5CIM3IO3bGRSoDPMXiT3t+15gu8Zo9HQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.17.0 h1:Ut6hgtYcASHwCzRHkXEtSsM251cXJPW+Z9DyLwEn6iI= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.17.0/go.mod h1:TYeE+8d5CjrgBa0ZuRaDeMpIC1xZ7atg4g+nInjuSjc= +go.opentelemetry.io/otel/metric v1.17.0 h1:iG6LGVz5Gh+IuO0jmgvpTB6YVrCGngi8QGm+pMd8Pdc= +go.opentelemetry.io/otel/metric v1.17.0/go.mod h1:h4skoxdZI17AxwITdmdZjjYJQH5nzijUUjm+wtPph5o= +go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0IpE= +go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ= +go.opentelemetry.io/otel/sdk/metric v0.40.0 h1:qOM29YaGcxipWjL5FzpyZDpCYrDREvX0mVlmXdOjCHU= +go.opentelemetry.io/otel/sdk/metric v0.40.0/go.mod h1:dWxHtdzdJvg+ciJUKLTKwrMe5P6Dv3FyDbh8UkfgkVs= +go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYOdSKWQ= +go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= -go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -375,7 +365,6 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -572,14 +561,12 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M= -google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= +google.golang.org/genproto v0.0.0-20230526203410-71b5a4ffd15e h1:Ao9GzfUMPH3zjVfzXG5rlWlk+Q8MXWKwWpwVQE1MXfw= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= +google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -599,7 +586,6 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -615,8 +601,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 7e4bab4a89ae9fc984083840bd719f12ecd995e0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:23:42 +0200 Subject: [PATCH 32/78] deps: update otel/opentelemetry-collector docker tag to v0.84.0 (#1916) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- examples/support/observability/config/otel-collector.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/support/observability/config/otel-collector.yaml b/examples/support/observability/config/otel-collector.yaml index 83272a178bf..9268f1e104f 100644 --- a/examples/support/observability/config/otel-collector.yaml +++ b/examples/support/observability/config/otel-collector.yaml @@ -103,7 +103,7 @@ spec: env: - name: GOGC value: "80" - image: otel/opentelemetry-collector:0.81.0 + image: otel/opentelemetry-collector:0.84.0 name: otel-collector resources: limits: From 8b34b63404d0339633ef41ff1cf2005deae8d2b7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:23:52 +0200 Subject: [PATCH 33/78] deps: update dependency kubernetes-sigs/controller-tools to v0.13.0 (#1930) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/CI.yaml | 2 +- .github/workflows/release.yml | 2 +- klt-cert-manager/Dockerfile | 2 +- klt-cert-manager/Makefile | 2 +- lifecycle-operator/Dockerfile | 2 +- lifecycle-operator/Makefile | 2 +- metrics-operator/Dockerfile | 2 +- metrics-operator/Makefile | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 21c0085016c..99c4cc700b4 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -17,7 +17,7 @@ on: env: GO_VERSION: "~1.20" # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools - CONTROLLER_TOOLS_VERSION: "v0.12.1" + CONTROLLER_TOOLS_VERSION: "v0.13.0" ENVTEST_K8S_VERSION: "1.24.2" SCHEDULER_COMPATIBLE_K8S_VERSION: "v0.24.3" defaults: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a6aa0a98dd..7731f9cb2c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ defaults: env: GO_VERSION: "~1.20" # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools - CONTROLLER_TOOLS_VERSION: "v0.12.1" + CONTROLLER_TOOLS_VERSION: "v0.13.0" SCHEDULER_COMPATIBLE_K8S_VERSION: "v0.24.3" PUBLISHABLE_ITEMS: '[".", "lifecycle-operator", "metrics-operator", "klt-cert-manager", "runtimes/deno-runtime", "runtimes/python-runtime"]' diff --git a/klt-cert-manager/Dockerfile b/klt-cert-manager/Dockerfile index aa272def4ca..4f6963517d8 100644 --- a/klt-cert-manager/Dockerfile +++ b/klt-cert-manager/Dockerfile @@ -13,7 +13,7 @@ RUN go mod download COPY ./ ./ # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools -ARG CONTROLLER_TOOLS_VERSION=v0.12.1 +ARG CONTROLLER_TOOLS_VERSION=v0.13.0 RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@$CONTROLLER_TOOLS_VERSION ARG GIT_HASH diff --git a/klt-cert-manager/Makefile b/klt-cert-manager/Makefile index 84f85ad6588..da47aec5edb 100644 --- a/klt-cert-manager/Makefile +++ b/klt-cert-manager/Makefile @@ -119,7 +119,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest # renovate: datasource=github-tags depName=kubernetes-sigs/kustomize KUSTOMIZE_VERSION?=v5.1.1 # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools -CONTROLLER_TOOLS_VERSION?=v0.12.1 +CONTROLLER_TOOLS_VERSION?=v0.13.0 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize diff --git a/lifecycle-operator/Dockerfile b/lifecycle-operator/Dockerfile index 4cd5efbee6b..dafe6e51a08 100644 --- a/lifecycle-operator/Dockerfile +++ b/lifecycle-operator/Dockerfile @@ -8,7 +8,7 @@ COPY go.mod go.sum ./ RUN go mod download # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools -ARG CONTROLLER_TOOLS_VERSION=v0.12.1 +ARG CONTROLLER_TOOLS_VERSION=v0.13.0 RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@$CONTROLLER_TOOLS_VERSION # Copy the go source diff --git a/lifecycle-operator/Makefile b/lifecycle-operator/Makefile index fa7b4a219c8..70826b91061 100644 --- a/lifecycle-operator/Makefile +++ b/lifecycle-operator/Makefile @@ -27,7 +27,7 @@ ENVTEST_K8S_VERSION=1.24.2 # renovate: datasource=github-tags depName=kubernetes-sigs/kustomize KUSTOMIZE_VERSION?=v5.1.1 # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools -CONTROLLER_TOOLS_VERSION?=v0.12.1 +CONTROLLER_TOOLS_VERSION?=v0.13.0 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) diff --git a/metrics-operator/Dockerfile b/metrics-operator/Dockerfile index c71dd3c1f96..db55a816d83 100644 --- a/metrics-operator/Dockerfile +++ b/metrics-operator/Dockerfile @@ -8,7 +8,7 @@ COPY go.mod go.sum ./ RUN go mod download # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools -ARG CONTROLLER_TOOLS_VERSION=v0.12.1 +ARG CONTROLLER_TOOLS_VERSION=v0.13.0 RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@$CONTROLLER_TOOLS_VERSION # Copy the go source diff --git a/metrics-operator/Makefile b/metrics-operator/Makefile index aca503a0627..77724360f92 100644 --- a/metrics-operator/Makefile +++ b/metrics-operator/Makefile @@ -27,7 +27,7 @@ ENVTEST_K8S_VERSION=1.24.2 # renovate: datasource=github-tags depName=kubernetes-sigs/kustomize KUSTOMIZE_VERSION?=v5.1.1 # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools -CONTROLLER_TOOLS_VERSION?=v0.12.1 +CONTROLLER_TOOLS_VERSION?=v0.13.0 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) From fb23f0948aa0395636b1290f3c7b3b28cbf54976 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:24:09 +0200 Subject: [PATCH 34/78] deps: update module k8s.io/kubernetes to v1.25.13 (#1958) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Signed-off-by: odubajDT Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: odubajDT --- scheduler/go.mod | 66 ++++++++++++++++++++++++------------------------ scheduler/go.sum | 48 +++++++++++++++++------------------ 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/scheduler/go.mod b/scheduler/go.mod index 403d3679e3f..715e20ccf85 100644 --- a/scheduler/go.mod +++ b/scheduler/go.mod @@ -14,13 +14,13 @@ require ( go.opentelemetry.io/otel/sdk v0.20.0 go.opentelemetry.io/otel/trace v0.20.0 google.golang.org/grpc v1.57.0 - k8s.io/api v0.25.12 - k8s.io/apimachinery v0.25.12 - k8s.io/apiserver v0.25.12 - k8s.io/client-go v0.25.12 - k8s.io/component-base v0.25.12 + k8s.io/api v0.25.13 + k8s.io/apimachinery v0.25.13 + k8s.io/apiserver v0.25.13 + k8s.io/client-go v0.25.13 + k8s.io/component-base v0.25.13 k8s.io/klog/v2 v2.100.1 - k8s.io/kubernetes v1.25.12 + k8s.io/kubernetes v1.25.13 sigs.k8s.io/controller-runtime v0.13.1 ) @@ -110,7 +110,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.25.0 // indirect k8s.io/cloud-provider v0.25.4 // indirect - k8s.io/component-helpers v0.25.12 // indirect + k8s.io/component-helpers v0.25.13 // indirect k8s.io/csi-translation-lib v0.25.4 // indirect k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect k8s.io/kube-scheduler v0.0.0 // indirect @@ -125,30 +125,30 @@ require ( replace ( github.com/keptn/lifecycle-toolkit/scheduler/pkg/klcpermit => /pkg/klcpermit golang.org/x/net => golang.org/x/net v0.14.0 - k8s.io/api => k8s.io/api v0.25.12 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.12 - k8s.io/apimachinery => k8s.io/apimachinery v0.25.12 - k8s.io/apiserver => k8s.io/apiserver v0.25.12 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.12 - k8s.io/client-go => k8s.io/client-go v0.25.12 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.25.12 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.25.12 - k8s.io/code-generator => k8s.io/code-generator v0.25.12 - k8s.io/component-base => k8s.io/component-base v0.25.12 - k8s.io/component-helpers => k8s.io/component-helpers v0.25.12 - k8s.io/controller-manager => k8s.io/controller-manager v0.25.12 - k8s.io/cri-api => k8s.io/cri-api v0.25.12 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.25.12 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.25.12 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.25.12 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.25.12 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.25.12 - k8s.io/kubectl => k8s.io/kubectl v0.25.12 - k8s.io/kubelet => k8s.io/kubelet v0.25.12 - k8s.io/kubernetes => k8s.io/kubernetes v1.25.12 - k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.25.12 - k8s.io/metrics => k8s.io/metrics v0.25.12 - k8s.io/mount-utils => k8s.io/mount-utils v0.25.12 - k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.25.12 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.25.12 + k8s.io/api => k8s.io/api v0.25.13 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.13 + k8s.io/apimachinery => k8s.io/apimachinery v0.25.13 + k8s.io/apiserver => k8s.io/apiserver v0.25.13 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.13 + k8s.io/client-go => k8s.io/client-go v0.25.13 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.25.13 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.25.13 + k8s.io/code-generator => k8s.io/code-generator v0.25.13 + k8s.io/component-base => k8s.io/component-base v0.25.13 + k8s.io/component-helpers => k8s.io/component-helpers v0.25.13 + k8s.io/controller-manager => k8s.io/controller-manager v0.25.13 + k8s.io/cri-api => k8s.io/cri-api v0.25.13 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.25.13 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.25.13 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.25.13 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.25.13 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.25.13 + k8s.io/kubectl => k8s.io/kubectl v0.25.13 + k8s.io/kubelet => k8s.io/kubelet v0.25.13 + k8s.io/kubernetes => k8s.io/kubernetes v1.25.13 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.25.13 + k8s.io/metrics => k8s.io/metrics v0.25.13 + k8s.io/mount-utils => k8s.io/mount-utils v0.25.13 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.25.13 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.25.13 ) diff --git a/scheduler/go.sum b/scheduler/go.sum index 1ff2e1e46d1..d5c710595e4 100644 --- a/scheduler/go.sum +++ b/scheduler/go.sum @@ -709,35 +709,35 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.12 h1:vMyRHX3SASysor6zk81DsYXbkVdvzQEIL4gA+6+j6mQ= -k8s.io/api v0.25.12/go.mod h1:pAGhdr4HvJlOa1g26QpNeiQLNnzc6nwU92MQSqY2pBk= -k8s.io/apiextensions-apiserver v0.25.12 h1:rj5T38RuGOb22BvPT7e5DftQp2jz1LoeQD2ORb3HWNU= -k8s.io/apiextensions-apiserver v0.25.12/go.mod h1:4c8gLxAG1VUWq0XQblCrvo70f9IC2Ho6TPq+xcne7ME= -k8s.io/apimachinery v0.25.12 h1:xLVMeHrUfO4Eq2CK60YS+ElVYv0AUNSGVYdHKZFBHRE= -k8s.io/apimachinery v0.25.12/go.mod h1:IFwbcNi3gKkfDhuy0VYu3+BwbxbiIov3p6FR8ge1Epc= -k8s.io/apiserver v0.25.12 h1:Dn32Ow5NKztp8+4qzFrM11q5/HjL39tkvuRqiTyNfU8= -k8s.io/apiserver v0.25.12/go.mod h1:k98t1f3cE6DJf7P8qIEGuzBWIv4h9v9P5N24zHTp7ng= -k8s.io/client-go v0.25.12 h1:LSwQNUqm368OjEoITifwM8+P/B+7wxvZ+yPKbFanVWI= -k8s.io/client-go v0.25.12/go.mod h1:WD2cp9N7NLyz2jMoq49vC6+8HKkjhqaDkk93l3eJO0M= -k8s.io/cloud-provider v0.25.12 h1:9/1kKkTcizV3QpAUgaJqyiqWX7E6xmkdbzjD8eanJQ4= -k8s.io/cloud-provider v0.25.12/go.mod h1:eR1AJ+H018aqWiLk7wRXQSstDi04slgMWjSpABRltFQ= -k8s.io/component-base v0.25.12 h1:TAmD4poBNt08FQgtKbdiYr7AMbUmYw5b+51CX7UTOBc= -k8s.io/component-base v0.25.12/go.mod h1:tkIm/OiTy1PcV/EtYU8uiHQrCYhdejrOWnzT2AMBM4Y= -k8s.io/component-helpers v0.25.12 h1:DaaHbV1G6XGfPMCUVX0P6GBDyEB2HUcbjIUGDLRUTVs= -k8s.io/component-helpers v0.25.12/go.mod h1:/LobXzLYiOOS44f1eVIwEQf+xmKG8UPeGRQof10Dsok= -k8s.io/csi-translation-lib v0.25.12 h1:U7V/1al+tN39BtcBMjCtMLFEwpvKjDSoZ9WipBgVb38= -k8s.io/csi-translation-lib v0.25.12/go.mod h1:y5jczv+eEJY26/8p/idJfAkUdxD7WjmEFRfN+rgVAwU= +k8s.io/api v0.25.13 h1:nOQWK5/ngLIG2CqmVV7uTFDsPCGkDk4kIGJ26t2AwIo= +k8s.io/api v0.25.13/go.mod h1:yGpHyrivZ0enqWqT5s1pN98a4Q834rZkIUEABpleEtw= +k8s.io/apiextensions-apiserver v0.25.13 h1:tdB/ULSvlbZIecU2bDOoCb46Ozk5VyLL6IPysC8gUpE= +k8s.io/apiextensions-apiserver v0.25.13/go.mod h1:uqYfnY2GOYXlfpnT6No9dxrxDbMjaYvh/Bpm0iNMYnA= +k8s.io/apimachinery v0.25.13 h1:byRHkSinOOVdo0pvjdblauFYfwAnx+JB8Pqi9w9weik= +k8s.io/apimachinery v0.25.13/go.mod h1:IFwbcNi3gKkfDhuy0VYu3+BwbxbiIov3p6FR8ge1Epc= +k8s.io/apiserver v0.25.13 h1:vROP8uv4tqcASYUm6gsBbM04p5umfZI0vHd5WmNbxj4= +k8s.io/apiserver v0.25.13/go.mod h1:EdnRllTlbHg4sjuzFUxoJU8h0OWtJyJbB45dK4QCnrs= +k8s.io/client-go v0.25.13 h1:Wan/8RXVNxSgFI/wMfWwJjmLglRYuLItytMWNiGo9LY= +k8s.io/client-go v0.25.13/go.mod h1:b2on3RSCwHdmvnUQx4/bkgMAs19M7BlUDze3WJuK0TE= +k8s.io/cloud-provider v0.25.13 h1:wZup58yLSBWkX3LBN5vlDyLGCC6/vEeUz0iy3XvfLus= +k8s.io/cloud-provider v0.25.13/go.mod h1:ilW82pf7O5febXlXLlXDnygij3Rjpus+claEwUOssq4= +k8s.io/component-base v0.25.13 h1:Lxpq2nu7Q4SueubBlU8kEcTgdaNXsktYg9bLsqvAV+4= +k8s.io/component-base v0.25.13/go.mod h1:Fh9SqG+Uyumtc+7HNT2FBZCxksIIFaukoL2LjqbBtgY= +k8s.io/component-helpers v0.25.13 h1:rhQWsHCoL+fCEME6JeHbBP5/r5a3ho/UBtuwz+LNrC8= +k8s.io/component-helpers v0.25.13/go.mod h1:TqKOMIyq8P85i8YO0qnUzU1eQL1dh3tfpJJdJ51l4nc= +k8s.io/csi-translation-lib v0.25.13 h1:9aoqZHhytmreeOrBLHsh84bA3u+tp2xfzse9Oqj1QaY= +k8s.io/csi-translation-lib v0.25.13/go.mod h1:aNrBnPa6bgL5Le0ovObRuwPz4PbBs7fZM+x88QPYHlM= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/kube-scheduler v0.25.12 h1:uCJmiTr5TedKyYg1tsoLDZ2GBBl/2ERSuRtLX0ikiyA= -k8s.io/kube-scheduler v0.25.12/go.mod h1:8WpYeJkcXtGXsfwfkMmjAdcAQ4xapG2pHgGKzlPb/JI= -k8s.io/kubernetes v1.25.12 h1:KSvhgELGV/GOYRqxbuhzrxPpU2ON4Xp1/k08E2v/7SY= -k8s.io/kubernetes v1.25.12/go.mod h1:CjSm5tJyKxHyGhK5aAID68YMErzDhAjWLL7Nd7NMonU= -k8s.io/mount-utils v0.25.12 h1:wHRywLgHq4VxEFpTDrPsrMNjtnrdIHTggGyReU9wIHc= -k8s.io/mount-utils v0.25.12/go.mod h1:IM9QOFh15E1a4Nb6Rcn8FJ9Z1PbBpuyAPCty/qvKSAw= +k8s.io/kube-scheduler v0.25.13 h1:Xs+E+HgdySfbwx1ZhNFq/ZURlKd08DvgXHvDkWYArV8= +k8s.io/kube-scheduler v0.25.13/go.mod h1:Kq4iNIhnzlGJoAD9gN0IVKmpv8TtbRl5wspMcVjOCC8= +k8s.io/kubernetes v1.25.13 h1:3q5BQlaI1xkvj4/K50ZjjYwxRWF5ZRcyzuGaDYRiZO8= +k8s.io/kubernetes v1.25.13/go.mod h1:CjSm5tJyKxHyGhK5aAID68YMErzDhAjWLL7Nd7NMonU= +k8s.io/mount-utils v0.25.13 h1:YVJxbJ+3SRTzST6Pz7ubesPneRVYueErOzembc3vbPo= +k8s.io/mount-utils v0.25.13/go.mod h1:IM9QOFh15E1a4Nb6Rcn8FJ9Z1PbBpuyAPCty/qvKSAw= k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From ca1fe57fecd5978d63e900a0cb060f29ba7fbe74 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:24:24 +0200 Subject: [PATCH 35/78] deps: update dependency cloud-bulldozer/kube-burner to v1.7.6 (#2000) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/load-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/load-test.yml b/.github/workflows/load-test.yml index 45b876c9358..6ed7b8df662 100644 --- a/.github/workflows/load-test.yml +++ b/.github/workflows/load-test.yml @@ -9,7 +9,7 @@ on: env: GO_VERSION: "~1.20" # renovate: datasource=github-tags depName=cloud-bulldozer/kube-burner - KUBE_BURNER_VERSION: "v1.7.5" + KUBE_BURNER_VERSION: "v1.7.6" defaults: run: shell: bash From 04456d5a75dd855e675bd7375e360612e2a24057 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:24:43 +0200 Subject: [PATCH 36/78] deps: update dependency argoproj/argo-cd to v2.8.2 (#1956) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- examples/support/argo/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/support/argo/Makefile b/examples/support/argo/Makefile index 7df8deb2e67..88993da8187 100644 --- a/examples/support/argo/Makefile +++ b/examples/support/argo/Makefile @@ -2,7 +2,7 @@ LFC_NAMESPACE ?= keptn-lifecycle-toolkit-system PODTATO_NAMESPACE ?= podtato-kubectl ARGO_NAMESPACE ?= argocd # renovate: datasource=github-tags depName=argoproj/argo-cd -ARGO_VERSION ?= v2.8.0 +ARGO_VERSION ?= v2.8.2 ARGO_SECRET = $(shell kubectl -n ${ARGO_NAMESPACE} get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo) .PHONY: install From 6ce03d600cbb3d3d3988573c616ec7f3830ba324 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:57:51 +0200 Subject: [PATCH 37/78] deps: update kubernetes packages to v0.26.8 (patch) (#1945) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- klt-cert-manager/go.mod | 10 +++++----- klt-cert-manager/go.sum | 20 ++++++++++---------- lifecycle-operator/go.mod | 12 ++++++------ lifecycle-operator/go.sum | 24 ++++++++++++------------ metrics-operator/go.mod | 16 ++++++++-------- metrics-operator/go.sum | 32 ++++++++++++++++---------------- 6 files changed, 57 insertions(+), 57 deletions(-) diff --git a/klt-cert-manager/go.mod b/klt-cert-manager/go.mod index e2ccdebee63..8c7c619e5f1 100644 --- a/klt-cert-manager/go.mod +++ b/klt-cert-manager/go.mod @@ -8,10 +8,10 @@ require ( github.com/pkg/errors v0.9.1 github.com/spf13/afero v1.9.5 github.com/stretchr/testify v1.8.4 - k8s.io/api v0.26.7 - k8s.io/apiextensions-apiserver v0.26.7 - k8s.io/apimachinery v0.26.7 - k8s.io/client-go v0.26.7 + k8s.io/api v0.26.8 + k8s.io/apiextensions-apiserver v0.26.8 + k8s.io/apimachinery v0.26.8 + k8s.io/client-go v0.26.8 sigs.k8s.io/controller-runtime v0.14.6 ) @@ -63,7 +63,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/component-base v0.26.7 // indirect + k8s.io/component-base v0.26.8 // indirect k8s.io/klog/v2 v2.80.1 // indirect k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect diff --git a/klt-cert-manager/go.sum b/klt-cert-manager/go.sum index ccd5bbd2d74..ef2a55dfede 100644 --- a/klt-cert-manager/go.sum +++ b/klt-cert-manager/go.sum @@ -620,16 +620,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.7 h1:Lf4iEBEJb5OFNmawtBfSZV/UNi9riSJ0t1qdhyZqI40= -k8s.io/api v0.26.7/go.mod h1:Vk9bMadzA49UHPmHB//lX7VRCQSXGoVwfLd3Sc1SSXI= -k8s.io/apiextensions-apiserver v0.26.7 h1:L7ImW831auK1ZQBtNJPaG5qyrFxeISEBlgfZJfnaIPk= -k8s.io/apiextensions-apiserver v0.26.7/go.mod h1:3DbZBfS3kO7/Jaj7qqzcBtPcKP0/KcklyAnk8zc+fs4= -k8s.io/apimachinery v0.26.7 h1:590jSBwaSHCAFCqltaEogY/zybFlhGsnLteLpuF2wig= -k8s.io/apimachinery v0.26.7/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= -k8s.io/client-go v0.26.7 h1:hyU9aKHlwVOykgyxzGYkrDSLCc4+mimZVyUJjPyUn1E= -k8s.io/client-go v0.26.7/go.mod h1:okYjy0jtq6sdeztALDvCh24tg4opOQS1XNvsJlERDAo= -k8s.io/component-base v0.26.7 h1:uqsOyZh0Zqoaup8tmHa491D/CvgFdGUs+X2H/inNUKM= -k8s.io/component-base v0.26.7/go.mod h1:CZe1HTmX/DQdeBrb9XYOXzs96jXth8ZbFvhLMsoJLUg= +k8s.io/api v0.26.8 h1:k2OtFmQPWfDUyAuYAwQPftVygF/vz4BMGSKnd15iddM= +k8s.io/api v0.26.8/go.mod h1:QaflR7cmG3V9lIz0VLBM+ylndNN897OAUAoJDcgwiQw= +k8s.io/apiextensions-apiserver v0.26.8 h1:ESVQ22MH6YfcpflpZMIvkgnHs/EwOgKKSCkS9AfxJOY= +k8s.io/apiextensions-apiserver v0.26.8/go.mod h1:ySo6rPc9ulNtKoZczw7ljCAdZN3DbyxLNat8wuYk4r8= +k8s.io/apimachinery v0.26.8 h1:SzpGtRX3/j/Ylg8Eg65Iobpxi9Jz4vOvI0qcBZyPVrM= +k8s.io/apimachinery v0.26.8/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= +k8s.io/client-go v0.26.8 h1:pPuTYaVtLlg/7n6rqs3MsKLi4XgNaJ3rTMyS37Y5CKU= +k8s.io/client-go v0.26.8/go.mod h1:1sBQqKmdy9rWZYQnoedpc0gnRXG7kU3HrKZvBe2QbGM= +k8s.io/component-base v0.26.8 h1:j+W9y9id4CLW85+5GhRMgcYLaezw6bK+ZQ2eN3uZtJc= +k8s.io/component-base v0.26.8/go.mod h1:tOQmHjTJBLjzWLWqbxz7sVgX9XMMphEcy0tWhk+u2BI= k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= diff --git a/lifecycle-operator/go.mod b/lifecycle-operator/go.mod index 929689a5ed3..49f8430176b 100644 --- a/lifecycle-operator/go.mod +++ b/lifecycle-operator/go.mod @@ -25,11 +25,11 @@ require ( go.opentelemetry.io/otel/sdk/metric v0.40.0 go.opentelemetry.io/otel/trace v1.17.0 google.golang.org/grpc v1.57.0 - k8s.io/api v0.26.7 - k8s.io/apiextensions-apiserver v0.26.7 - k8s.io/apimachinery v0.26.7 - k8s.io/apiserver v0.26.7 - k8s.io/client-go v0.26.7 + k8s.io/api v0.26.8 + k8s.io/apiextensions-apiserver v0.26.8 + k8s.io/apimachinery v0.26.8 + k8s.io/apiserver v0.26.8 + k8s.io/client-go v0.26.8 sigs.k8s.io/controller-runtime v0.14.6 ) @@ -95,7 +95,7 @@ require ( google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/component-base v0.26.7 // indirect + k8s.io/component-base v0.26.8 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect diff --git a/lifecycle-operator/go.sum b/lifecycle-operator/go.sum index c70f06c06b6..bb1c2ebba46 100644 --- a/lifecycle-operator/go.sum +++ b/lifecycle-operator/go.sum @@ -628,18 +628,18 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.7 h1:Lf4iEBEJb5OFNmawtBfSZV/UNi9riSJ0t1qdhyZqI40= -k8s.io/api v0.26.7/go.mod h1:Vk9bMadzA49UHPmHB//lX7VRCQSXGoVwfLd3Sc1SSXI= -k8s.io/apiextensions-apiserver v0.26.7 h1:L7ImW831auK1ZQBtNJPaG5qyrFxeISEBlgfZJfnaIPk= -k8s.io/apiextensions-apiserver v0.26.7/go.mod h1:3DbZBfS3kO7/Jaj7qqzcBtPcKP0/KcklyAnk8zc+fs4= -k8s.io/apimachinery v0.26.7 h1:590jSBwaSHCAFCqltaEogY/zybFlhGsnLteLpuF2wig= -k8s.io/apimachinery v0.26.7/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= -k8s.io/apiserver v0.26.7 h1:NX/zBZZn4R+Cq6shwyn8Pn8REd0yJJ16dbtv9WkEVEU= -k8s.io/apiserver v0.26.7/go.mod h1:r0wDRWHI7VL/KlQLTkJJBVGZ3KeNfv+VetlyRtr86xs= -k8s.io/client-go v0.26.7 h1:hyU9aKHlwVOykgyxzGYkrDSLCc4+mimZVyUJjPyUn1E= -k8s.io/client-go v0.26.7/go.mod h1:okYjy0jtq6sdeztALDvCh24tg4opOQS1XNvsJlERDAo= -k8s.io/component-base v0.26.7 h1:uqsOyZh0Zqoaup8tmHa491D/CvgFdGUs+X2H/inNUKM= -k8s.io/component-base v0.26.7/go.mod h1:CZe1HTmX/DQdeBrb9XYOXzs96jXth8ZbFvhLMsoJLUg= +k8s.io/api v0.26.8 h1:k2OtFmQPWfDUyAuYAwQPftVygF/vz4BMGSKnd15iddM= +k8s.io/api v0.26.8/go.mod h1:QaflR7cmG3V9lIz0VLBM+ylndNN897OAUAoJDcgwiQw= +k8s.io/apiextensions-apiserver v0.26.8 h1:ESVQ22MH6YfcpflpZMIvkgnHs/EwOgKKSCkS9AfxJOY= +k8s.io/apiextensions-apiserver v0.26.8/go.mod h1:ySo6rPc9ulNtKoZczw7ljCAdZN3DbyxLNat8wuYk4r8= +k8s.io/apimachinery v0.26.8 h1:SzpGtRX3/j/Ylg8Eg65Iobpxi9Jz4vOvI0qcBZyPVrM= +k8s.io/apimachinery v0.26.8/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= +k8s.io/apiserver v0.26.8 h1:N6y2rVkMo4q+ZJWjQOYYIPY/jlxqiNFsiAsrB6JjsoA= +k8s.io/apiserver v0.26.8/go.mod h1:rQ3thye841vuya4oxnvmPV6ZjlrJP3Ru7vEXRF/lAk8= +k8s.io/client-go v0.26.8 h1:pPuTYaVtLlg/7n6rqs3MsKLi4XgNaJ3rTMyS37Y5CKU= +k8s.io/client-go v0.26.8/go.mod h1:1sBQqKmdy9rWZYQnoedpc0gnRXG7kU3HrKZvBe2QbGM= +k8s.io/component-base v0.26.8 h1:j+W9y9id4CLW85+5GhRMgcYLaezw6bK+ZQ2eN3uZtJc= +k8s.io/component-base v0.26.8/go.mod h1:tOQmHjTJBLjzWLWqbxz7sVgX9XMMphEcy0tWhk+u2BI= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index 12fc377877a..0110aa15bae 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -17,14 +17,14 @@ require ( golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb golang.org/x/net v0.12.0 gopkg.in/inf.v0 v0.9.1 - k8s.io/api v0.26.7 - k8s.io/apiextensions-apiserver v0.26.7 - k8s.io/apimachinery v0.26.7 - k8s.io/apiserver v0.26.7 - k8s.io/client-go v0.26.7 - k8s.io/component-base v0.26.7 + k8s.io/api v0.26.8 + k8s.io/apiextensions-apiserver v0.26.8 + k8s.io/apimachinery v0.26.8 + k8s.io/apiserver v0.26.8 + k8s.io/client-go v0.26.8 + k8s.io/component-base v0.26.8 k8s.io/klog/v2 v2.100.1 - k8s.io/metrics v0.26.7 + k8s.io/metrics v0.26.8 sigs.k8s.io/controller-runtime v0.14.6 sigs.k8s.io/custom-metrics-apiserver v1.25.1-0.20230116101851-63817c8ac8f2 sigs.k8s.io/yaml v1.3.0 @@ -111,7 +111,7 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/kms v0.26.7 // indirect + k8s.io/kms v0.26.8 // indirect k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.37 // indirect diff --git a/metrics-operator/go.sum b/metrics-operator/go.sum index afbf714e897..49b9c8912b0 100644 --- a/metrics-operator/go.sum +++ b/metrics-operator/go.sum @@ -767,26 +767,26 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.7 h1:Lf4iEBEJb5OFNmawtBfSZV/UNi9riSJ0t1qdhyZqI40= -k8s.io/api v0.26.7/go.mod h1:Vk9bMadzA49UHPmHB//lX7VRCQSXGoVwfLd3Sc1SSXI= -k8s.io/apiextensions-apiserver v0.26.7 h1:L7ImW831auK1ZQBtNJPaG5qyrFxeISEBlgfZJfnaIPk= -k8s.io/apiextensions-apiserver v0.26.7/go.mod h1:3DbZBfS3kO7/Jaj7qqzcBtPcKP0/KcklyAnk8zc+fs4= -k8s.io/apimachinery v0.26.7 h1:590jSBwaSHCAFCqltaEogY/zybFlhGsnLteLpuF2wig= -k8s.io/apimachinery v0.26.7/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= -k8s.io/apiserver v0.26.7 h1:NX/zBZZn4R+Cq6shwyn8Pn8REd0yJJ16dbtv9WkEVEU= -k8s.io/apiserver v0.26.7/go.mod h1:r0wDRWHI7VL/KlQLTkJJBVGZ3KeNfv+VetlyRtr86xs= -k8s.io/client-go v0.26.7 h1:hyU9aKHlwVOykgyxzGYkrDSLCc4+mimZVyUJjPyUn1E= -k8s.io/client-go v0.26.7/go.mod h1:okYjy0jtq6sdeztALDvCh24tg4opOQS1XNvsJlERDAo= -k8s.io/component-base v0.26.7 h1:uqsOyZh0Zqoaup8tmHa491D/CvgFdGUs+X2H/inNUKM= -k8s.io/component-base v0.26.7/go.mod h1:CZe1HTmX/DQdeBrb9XYOXzs96jXth8ZbFvhLMsoJLUg= +k8s.io/api v0.26.8 h1:k2OtFmQPWfDUyAuYAwQPftVygF/vz4BMGSKnd15iddM= +k8s.io/api v0.26.8/go.mod h1:QaflR7cmG3V9lIz0VLBM+ylndNN897OAUAoJDcgwiQw= +k8s.io/apiextensions-apiserver v0.26.8 h1:ESVQ22MH6YfcpflpZMIvkgnHs/EwOgKKSCkS9AfxJOY= +k8s.io/apiextensions-apiserver v0.26.8/go.mod h1:ySo6rPc9ulNtKoZczw7ljCAdZN3DbyxLNat8wuYk4r8= +k8s.io/apimachinery v0.26.8 h1:SzpGtRX3/j/Ylg8Eg65Iobpxi9Jz4vOvI0qcBZyPVrM= +k8s.io/apimachinery v0.26.8/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= +k8s.io/apiserver v0.26.8 h1:N6y2rVkMo4q+ZJWjQOYYIPY/jlxqiNFsiAsrB6JjsoA= +k8s.io/apiserver v0.26.8/go.mod h1:rQ3thye841vuya4oxnvmPV6ZjlrJP3Ru7vEXRF/lAk8= +k8s.io/client-go v0.26.8 h1:pPuTYaVtLlg/7n6rqs3MsKLi4XgNaJ3rTMyS37Y5CKU= +k8s.io/client-go v0.26.8/go.mod h1:1sBQqKmdy9rWZYQnoedpc0gnRXG7kU3HrKZvBe2QbGM= +k8s.io/component-base v0.26.8 h1:j+W9y9id4CLW85+5GhRMgcYLaezw6bK+ZQ2eN3uZtJc= +k8s.io/component-base v0.26.8/go.mod h1:tOQmHjTJBLjzWLWqbxz7sVgX9XMMphEcy0tWhk+u2BI= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kms v0.26.7 h1:vruEJNh2IyFnPHbCH8CpUjekHy1HFJtHd/lE2K0lU78= -k8s.io/kms v0.26.7/go.mod h1:AYuV9ZebRhr6cb1eT9L6kZVxvgIUxmE1Fe6kPhqYvuc= +k8s.io/kms v0.26.8 h1:79S9Ub26OX4s6b3vdLCNLxurJhlnLOJwyboJqPqS4LQ= +k8s.io/kms v0.26.8/go.mod h1:AYuV9ZebRhr6cb1eT9L6kZVxvgIUxmE1Fe6kPhqYvuc= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/metrics v0.26.7 h1:GziC+HlH1Gpbh4xrI5Vfz8QxBmy5nXzzRiul2HS5Ioc= -k8s.io/metrics v0.26.7/go.mod h1:k1LCQu9vAS1HRZ2BGAosFHy2qSGZEUYn6bqHVMiFNK0= +k8s.io/metrics v0.26.8 h1:TQDI347hRbEpPc7NiMQfFK7z7dsK3xo4eiiTKQyYLWg= +k8s.io/metrics v0.26.8/go.mod h1:9gAXrgL2yEWW6LzZyCxqnSlsNQMXZ1kiajn+LOJ4wl4= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From 8dbec2d6116fb20bac86162aaea2b75c24eb96be Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 08:57:58 +0200 Subject: [PATCH 38/78] deps: update dependency autoprefixer to v10.4.15 (#1909) Signed-off-by: odubajDT Co-authored-by: odubajDT --- .../content/en/docs/getting-started/_index.md | 2 +- .../en/docs/intro-klt/usecase-orchestrate.md | 9 +-- .../en/docs/yaml-crd-ref/taskdefinition.md | 4 +- docs/package-lock.json | 64 +++++++++++-------- docs/package.json | 2 +- runtimes/deno-runtime/README.md | 2 +- 6 files changed, 48 insertions(+), 35 deletions(-) diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md index b666681e372..f982b8dcf27 100644 --- a/docs/content/en/docs/getting-started/_index.md +++ b/docs/content/en/docs/getting-started/_index.md @@ -10,7 +10,7 @@ The following is an imperative walkthrough. ## Prerequisites -- [Docker](https://docker.com) +- [Docker](https://docs.docker.com/get-started/overview/) - [kubectl](https://kubernetes.io/docs/reference/kubectl/) - A Kubernetes cluster >= 1.24 (we recommend [Kubernetes kind](https://kind.sigs.k8s.io/docs/user/quick-start/)) (`kind create cluster`) diff --git a/docs/content/en/docs/intro-klt/usecase-orchestrate.md b/docs/content/en/docs/intro-klt/usecase-orchestrate.md index a78b441aaca..eb2917db47a 100644 --- a/docs/content/en/docs/intro-klt/usecase-orchestrate.md +++ b/docs/content/en/docs/intro-klt/usecase-orchestrate.md @@ -50,9 +50,10 @@ example. The steps to implement pre- and post-deployment orchestration are: -1. [Define evaluations to be performed pre- and post-deployment](#define-evaluations-to-be-performed-pre--and-post-deployment) -1. [Define tasks to be performed pre- and post-deployment](#define-tasks-to-be-performed-pre--and-post-deployment) -1. [Integrate evaluations and tasks into the cluster](#integrate-evaluations-and-tasks-into-the-cluster) +* [Using this exercise](#using-this-exercise) +* [Define evaluations to be performed pre- and post-deployment](#define-evaluations-to-be-performed-pre--and-post-deployment) +* [Define tasks to be performed pre- and post-deployment](#define-tasks-to-be-performed-pre--and-post-deployment) +* [Integrate evaluations and tasks into the cluster](#integrate-evaluations-and-tasks-into-the-cluster) This is the third of three exercises in the [Introducing the Keptn Lifecycle Toolkit](_index.md) @@ -148,7 +149,7 @@ spec: For more information about sending Slack notifications with KLT, see [Implement Slack notifications](../implementing/slack.md). The code to be executed is expressed as a -[Deno](https://deno.land/) +[Deno](https://deno.com) script, which uses JavaScript syntax. It can be embedded in the definition file or pulled in from a remote webserver that is specified. diff --git a/docs/content/en/docs/yaml-crd-ref/taskdefinition.md b/docs/content/en/docs/yaml-crd-ref/taskdefinition.md index 1f85022d1e2..3d011bd8a31 100644 --- a/docs/content/en/docs/yaml-crd-ref/taskdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/taskdefinition.md @@ -122,7 +122,7 @@ When using the `deno-runtime` runner to define a task, the task is coded in Deno-script (which is mostly the same as JavaScript and TypeScript) and executed in the -[Deno](https://deno.land/manual) runner, +[Deno](https://deno.com/manual) runner, which is a lightweight runtime environment that executes in your namespace. Note that Deno has tighter restrictions @@ -149,7 +149,7 @@ spec: * **spec** * **deno** -- Specify that the task uses the `deno-runtime` - and is expressed as a [Deno](https://deno.land/) script. + and is expressed as a [Deno](https://deno.com/) script. Refer to [deno runtime](https://github.com/keptn/lifecycle-toolkit/tree/main/runtimes/deno-runtime) for more information about this runner. diff --git a/docs/package-lock.json b/docs/package-lock.json index 5d3ed371096..321dbd3d462 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "autoprefixer": "^10.4.14", + "autoprefixer": "^10.4.15", "postcss-cli": "^10.1.0" } }, @@ -76,9 +76,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.4.14", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.14.tgz", - "integrity": "sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==", + "version": "10.4.15", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.15.tgz", + "integrity": "sha512-KCuPB8ZCIqFdA4HwKXsvz7j6gvSDNhDP7WnUjBleRkKjPdvCmHFuQ77ocavI8FT6NdvlBnE2UFr2H4Mycn8Vew==", "funding": [ { "type": "opencollective", @@ -87,11 +87,15 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "browserslist": "^4.21.5", - "caniuse-lite": "^1.0.30001464", + "browserslist": "^4.21.10", + "caniuse-lite": "^1.0.30001520", "fraction.js": "^4.2.0", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", @@ -127,9 +131,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", "funding": [ { "type": "opencollective", @@ -138,13 +142,17 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.11" }, "bin": { "browserslist": "cli.js" @@ -154,9 +162,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001505", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001505.tgz", - "integrity": "sha512-jaAOR5zVtxHfL0NjZyflVTtXm3D3J9P15zSJ7HmQF8dSKGA6tqzQq+0ZI3xkjyQj46I4/M0K2GbMpcAFOcbr3A==", + "version": "1.0.30001522", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001522.tgz", + "integrity": "sha512-TKiyTVZxJGhsTszLuzb+6vUZSjVOAhClszBr2Ta2k9IwtNBT/4dzmL6aywt0HCgEZlmwJzXJd8yNiob6HgwTRg==", "funding": [ { "type": "opencollective", @@ -247,9 +255,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.308", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.308.tgz", - "integrity": "sha512-qyTx2aDFjEni4UnRWEME9ubd2Xc9c0zerTUl/ZinvD4QPsF0S7kJTV/Es/lPCTkNX6smyYar+z/n8Cl6pFr8yQ==" + "version": "1.4.498", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.498.tgz", + "integrity": "sha512-4LODxAzKGVy7CJyhhN5mebwe7U2L29P+0G+HUriHnabm0d7LSff8Yn7t+Wq+2/9ze2Fu1dhX7mww090xfv7qXQ==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -512,9 +520,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==" + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" }, "node_modules/normalize-path": { "version": "3.0.0", @@ -826,9 +834,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", "funding": [ { "type": "opencollective", @@ -837,6 +845,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { @@ -844,7 +856,7 @@ "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" diff --git a/docs/package.json b/docs/package.json index 5d17b2ac29b..90b4e52b6d2 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "autoprefixer": "^10.4.13", + "autoprefixer": "^10.4.15", "postcss-cli": "^10.1.0" } } diff --git a/runtimes/deno-runtime/README.md b/runtimes/deno-runtime/README.md index 2216282303a..51792db2436 100644 --- a/runtimes/deno-runtime/README.md +++ b/runtimes/deno-runtime/README.md @@ -8,7 +8,7 @@ docker build -t keptnsandbox/klc-runtime:${VERSION} . ## Usage -The Keptn deno runtime uses [Deno](https://deno.land/) +The Keptn deno runtime uses [Deno](https://deno.com/) to execute Javascript/Typescript code. The Keptn Lifecycle Toolkit uses this runtime to run [KeptnTask](https://lifecycle.keptn.sh/docs/tasks/write-tasks/) for pre- and post-checks. From 2f5144540c4b3876e800bff29c30bfded334be40 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 09:18:42 +0200 Subject: [PATCH 39/78] deps: update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 8dbec2d (#1995) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- lifecycle-operator/go.mod | 2 +- lifecycle-operator/go.sum | 4 ++-- metrics-operator/go.mod | 2 +- metrics-operator/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lifecycle-operator/go.mod b/lifecycle-operator/go.mod index 49f8430176b..644f3532a58 100644 --- a/lifecycle-operator/go.mod +++ b/lifecycle-operator/go.mod @@ -9,7 +9,7 @@ require ( github.com/cloudevents/sdk-go/v2 v2.14.0 github.com/go-logr/logr v1.2.4 github.com/kelseyhightower/envconfig v1.4.0 - github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3 + github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f github.com/magiconair/properties v1.8.7 github.com/onsi/ginkgo/v2 v2.11.0 github.com/onsi/gomega v1.27.10 diff --git a/lifecycle-operator/go.sum b/lifecycle-operator/go.sum index bb1c2ebba46..f7b7c9c119e 100644 --- a/lifecycle-operator/go.sum +++ b/lifecycle-operator/go.sum @@ -202,8 +202,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3 h1:YkozPCcc6yNx1ET5HiM/yj2AziVG+uX90uved8h/YjQ= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3/go.mod h1:8L3D7pL1WWNHfp0Fm0hGroIlNWaEDeCA35wlFDPSEMo= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f h1:aKMtACmfrS++heUT5WNpV5hzMTVCwZDt+Lh1sBiSRmM= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f/go.mod h1:d+4PMPRSDRLXgyFXdpJZut/j/xRRES6RV+mc4dYNAoA= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index 0110aa15bae..728b0978bd4 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-logr/logr v1.2.4 github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3 + github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f github.com/open-feature/go-sdk v1.7.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 diff --git a/metrics-operator/go.sum b/metrics-operator/go.sum index 49b9c8912b0..a9ae529ed9b 100644 --- a/metrics-operator/go.sum +++ b/metrics-operator/go.sum @@ -266,8 +266,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3 h1:YkozPCcc6yNx1ET5HiM/yj2AziVG+uX90uved8h/YjQ= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230830072336-bb133cfd2ac3/go.mod h1:8L3D7pL1WWNHfp0Fm0hGroIlNWaEDeCA35wlFDPSEMo= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f h1:aKMtACmfrS++heUT5WNpV5hzMTVCwZDt+Lh1sBiSRmM= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f/go.mod h1:d+4PMPRSDRLXgyFXdpJZut/j/xRRES6RV+mc4dYNAoA= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= From f2f316271d86209da124ea3554fa2e821d79e953 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 10:07:10 +0200 Subject: [PATCH 40/78] deps: update denoland/deno docker tag to alpine-1.36.4 (#2012) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Signed-off-by: odubajDT Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: odubajDT --- runtimes/deno-runtime/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtimes/deno-runtime/Dockerfile b/runtimes/deno-runtime/Dockerfile index ea6d8e048f7..a1e37311c2b 100644 --- a/runtimes/deno-runtime/Dockerfile +++ b/runtimes/deno-runtime/Dockerfile @@ -1,4 +1,4 @@ -FROM denoland/deno:alpine-1.36.3 AS production +FROM denoland/deno:alpine-1.36.4 AS production LABEL org.opencontainers.image.source="https://github.com/keptn/lifecycle-toolkit" \ org.opencontainers.image.url="https://keptn.sh" \ From 12ee7b6f37c2422a37da1e53e4b9e250db6d8ca3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 10:07:17 +0200 Subject: [PATCH 41/78] deps: update golang.org/x/exp digest to d852ddb (#2011) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- metrics-operator/go.mod | 2 +- metrics-operator/go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index 728b0978bd4..3b7a96f0cf7 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -14,7 +14,7 @@ require ( github.com/prometheus/client_golang v1.16.0 github.com/prometheus/common v0.44.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb + golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 golang.org/x/net v0.12.0 gopkg.in/inf.v0 v0.9.1 k8s.io/api v0.26.8 diff --git a/metrics-operator/go.sum b/metrics-operator/go.sum index a9ae529ed9b..85450f2a118 100644 --- a/metrics-operator/go.sum +++ b/metrics-operator/go.sum @@ -442,8 +442,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= +golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -620,7 +620,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 h1:Vve/L0v7CXXuxUmaMGIEK/dEeq7uiqb5qBgQrZzIE7E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 044d3b52338f027c2095d3949e4f21a2848016bf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 10:08:04 +0200 Subject: [PATCH 42/78] deps: update sigstore/cosign-installer action to v3.1.2 (#2009) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7731f9cb2c5..e49deab561f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -156,7 +156,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Cosign - uses: sigstore/cosign-installer@v3.1.1 + uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2 - name: Clean up image tag id: clean-image-tag From 093670caded5e7d78de5923eed2b795b71ca0eac Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 11:37:06 +0200 Subject: [PATCH 43/78] deps: update aquasecurity/trivy-action action to v0.12.0 (#2010) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: odubajDT --- .github/workflows/security-scans.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/security-scans.yml b/.github/workflows/security-scans.yml index d25f239f76d..93ffcf3ffed 100644 --- a/.github/workflows/security-scans.yml +++ b/.github/workflows/security-scans.yml @@ -193,7 +193,6 @@ jobs: fail-fast: false matrix: image: - - "functions-runtime" - "deno-runtime" - "python-runtime" - "lifecycle-operator" @@ -209,7 +208,7 @@ jobs: path: images - name: Trivy image scan - uses: aquasecurity/trivy-action@0.11.2 + uses: aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f # 0.12.0 with: input: "images/${{ matrix.image }}-image.tar/${{ matrix.image }}-image.tar" severity: 'CRITICAL,HIGH' From c96cb727931abdeeb9bcbbc2e551dc5722a9ed88 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 4 Sep 2023 06:29:32 -0700 Subject: [PATCH 44/78] docs: how to use GitHub Codespaces to contribute to Keptn (#1977) Signed-off-by: Meg McRoberts --- .../en/contribute/general/codespace/_index.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/content/en/contribute/general/codespace/_index.md diff --git a/docs/content/en/contribute/general/codespace/_index.md b/docs/content/en/contribute/general/codespace/_index.md new file mode 100644 index 00000000000..382b9734f9e --- /dev/null +++ b/docs/content/en/contribute/general/codespace/_index.md @@ -0,0 +1,46 @@ +--- +title: Codespaces +description: Use GitHub Codespaces to contribute documentation and software +weight: 200 +--- + +Use GitHub codespaces as a pre-built and pre-configured development environment. +This is especially useful for Windows users +who may not have `make` installed. +It is also useful for Linux and MacOS users +who may not wish to download tools just to contribute to docs. + +Review [this video](https://www.youtube.com/watch?v=sFNzOhZw7Eg) to see how this works. + +[![Keptn + GitHub codespaces video](https://img.youtube.com/vi/sFNzOhZw7Eg/0.jpg)](https://www.youtube.com/watch?v=sFNzOhZw7Eg) + +As shown in the video, the steps to set up a new Codespace are: + +1. Create a fork of the repository. + Keptn software and documentation are in the + [link](https://github.com/keptn/lifecycle-toolkit) + repository. +1. In your fork, click the green `Code` button +1. Switch to `Codespaces` tab and create a new codespace + +You will be presented with a fully configured environment +with access to all the tools you require +to develop software or documentation for Keptn. + +The interface is similar to that of +[Visual Studio Code](https://code.visualstudio.com/). + +To develop or modify software or documentation, the steps are: + +1. Make your modifications and test those modifications +1. Go back to Codespaces and click on the "Source Control" button on the left +1. Find the file(s) that you modified and click the "**+**" button + to create a commit + - Supply a commit message, adhering to the conventions for Keptn commits + - Sign the commit by clicking the "**...**" button + and selecting "Commit -> Commit Staged" +1. Click the "**...**" button again + and select "Push" to push your changes to your fork +1. Go to the UI for your fork and create a PR in the normal way. +1. After your PR has been merged, + go to your github page, select "Codespaces", and delete this codespace. From 61f92c335b26e79cf058db39c9b31fb44088951c Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 4 Sep 2023 06:58:54 -0700 Subject: [PATCH 45/78] docs: add info to implementing/tasks about sequential execution (#1950) Signed-off-by: Meg McRoberts Co-authored-by: Giovanni Liva --- .../en/docs/implementing/tasks/_index.md | 128 ++++++++++++++++-- 1 file changed, 120 insertions(+), 8 deletions(-) diff --git a/docs/content/en/docs/implementing/tasks/_index.md b/docs/content/en/docs/implementing/tasks/_index.md index 5e692c7ccad..40534306e6e 100644 --- a/docs/content/en/docs/implementing/tasks/_index.md +++ b/docs/content/en/docs/implementing/tasks/_index.md @@ -7,28 +7,34 @@ hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.htm A [KeptnTaskDefinition](../../yaml-crd-ref/taskdefinition.md/) -resource defines tasks that the Keptn Lifecycle Toolkit runs +resource defines one or more "executables" +(functions, programs, scripts, etc) +that the Keptn Lifecycle Toolkit runs as part of the pre- and post-deployment phases of a [KeptnApp](../../yaml-crd-ref/app.md) or [KeptnWorkload](../../crd-ref/lifecycle/v1alpha3/#keptnworkload). -A Keptn task executes as a runner in an application +A +[KeptnTask](../../crd-ref/lifecycle/v1alpha3/#keptntask) +executes as a runner in an application [container](https://kubernetes.io/docs/concepts/containers/), which runs as part of a Kubernetes [job](https://kubernetes.io/docs/concepts/workloads/controllers/job/). -A `KeptnTaskDefinition` includes a function -that defines the action taken by that task. +A `KeptnTaskDefinition` includes calls to executables to be run. -To implement a Keptn task: +To implement a `KeptnTask`: - Define a [KeptnTaskDefinition](../../yaml-crd-ref/taskdefinition.md) resource that defines the runner to use for the container + and the executables to be run +pre- and post-deployment - Apply [basic-annotations](../integrate/#basic-annotations) to your workloads to integrate your task with Kubernetes -- Add your task to the [KeptnApp](../../yaml-crd-ref/app.md) - resource that associates your `KeptnTaskDefinition` - with the pre- and post-deployment tasks that should run in it; +- Annotate the appropriate + [KeptnApp](../../yaml-crd-ref/app.md) + resource to associate your `KeptnTaskDefinition` + with the pre- and post-deployment tasks that should run it; see [Pre- and post-deployment tasks and checks](../integrate/#pre--and-post-deployment-checks) for more information. @@ -36,6 +42,10 @@ To implement a Keptn task: This page provides information to help you create your tasks: - Code your task in an appropriate [runner](#runners-and-containers) +- How to control the + [execution order](#executing-sequential-tasks) + of functions, programs, and scripts + since all `KeptnTask` resources at the same level run in parallel - Understand how to use [Context](#context) that contains a Kubernetes cluster, a user, a namespace, the application name, workload name, and version. @@ -53,6 +63,9 @@ to define the task. The `spec` section of the `KeptnTaskDefinition` defines the runner to use for the container: +KLT provides a general Kubernetes that you can configure +to do almost anything you want: + - The `container-runtime` runner provides a pure custom Kubernetes application container that you define to includes a runtime, an application @@ -84,6 +97,105 @@ See the [KeptnTaskDefinition](../../yaml-crd-ref/taskdefinition.md) reference page for the synopsis and examples for each runner. +## Executing sequential tasks + +All `KeptnTask` resources that are defined by +`KeptnTaskDefinition` resources at the same level +(either pre-deployment or post-deployment) execute in parallel. +This is by design, because Keptn is not a pipeline engine. +**Task sequences that are not part of the lifecycle workflow +should not be handled by KLT** +but should instead be handled by the pipeline engine tools being used +such as Jenkins, Argo Workflows, Flux, and Tekton. + +If your lifecycle workflow includes +a sequence of executables that need to be run in order, +you can put them all in one `KeptnTaskDefinition` resource, +which can execute a virtually unlimited number +of programs, scripts, and functions, +as long as they all need the same runner, such as Python. + +Another option is to encode all your steps in the language of your choice +and build a container that Keptn executes. +This is often the best solution if you need to execute complex sequences. + +If you use either the `deno-runtime` or `python-runtime` runner, +you can specify the actions to take by coding the actual calls +inline in the manifest, +by calling scripts from a remote webserver, +or by calling other `KeptnTaskDefinition` resources you have defined. +This provides great flexibility in +how you define your `KeptnTaskDefinition` resources, +allowing you to define the ideal mix of executables that run sequentially +and executables (or sets of executables) that run in parallel. + +As an example, let's say you need to run a set of integration tests, +a set of performance tests, and a set of regression tests. + +- You can create one `KeptnTaskDefinition` that calls all the tasks, + in order, either by putting the actual calls + in the `KeptnTaskDefinition` resource (`inline` syntax) + or by calling scripts from a remote webserver (`httpRef` syntax), or by providing a container to run. + +- You can create separate `KeptnTaskDefinition` resources + for integration tests, performance tests, and regression tests. + + - If you annotate the `KeptnApp` resource to call + each of these `KeptnTask` resources, + the three sets of tests run in parallel. + + - You can create a "parent" `KeptnTaskDefinition` resource + that uses the `functionref` syntax + to call the `KeptnTaskDefinition` resources + for integration tests, performance tests, and regression tests. + If you annotate the `KeptnApp` resource + to run this parent `KeptnTask` resource, + all tests run sequentially. + + This approach also allows you to run the test sequence if, for example, + the integration tests require the `deno-runtime` runner + but the performance and regression tests + require the `python-runtime` runner. + The parent `KeptnTaskDefinition` can run `KeptnTask` resources + that use different runners, + although the "parent" definition runtime is used + for the container that runs all the tests. + In other words, the parent `KeptnTaskDefinition` resources + is not a merge of other `KeptnTaskDefinition` resources + but rather the code/container of the parent runner. + +- If you need to test your deployment for different platforms + (such as Linux, MacOS, and Windows) + or for different software versions + (such as Java 11, Java 17, and Java 21), + parallel testing can improve performance. + In this case, you can construct different `KeptnTaskDefinition` resources + for each platform, + perhaps defining different input parameters + (such as different secrets or environment variables). + +- Define one `KeptnTaskDefinition` resource that runs + integration tests, then regression test, then performance tests + in order. + + - You could use the `functionRef` syntax + and code the calling sequences for all tests + inside your `KeptnTaskDefinition` resource + or you could use the `httpRef` syntax + to call scripts from an external webserver. + - You could code separate `KeptnTaskDefinition` resources + for integration tests, regression tests, and performance tests. + These three test sets could then run in parallel. + - You could create a `KeptnTaskDefinition` resource + that uses the `functionRef` syntax to call the + `KeptnTaskDefinition` resources for each type of testing. + Executing that resource would execute the three types of tests + in sequential order. + +If you define a `container-runtime` runner container +for your `KeptnTaskDefinition`, +you can do anything allowed by the configuration you define for that container. + ## Context A Kubernetes context is a set of access parameters From 8516716c8c7a7a265df3a9d65b2291707c96cd76 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 4 Sep 2023 23:27:57 -0700 Subject: [PATCH 46/78] docs: implement KLT -> Keptn name change for tasks page (#2016) --- docs/content/en/docs/implementing/tasks/_index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/content/en/docs/implementing/tasks/_index.md b/docs/content/en/docs/implementing/tasks/_index.md index 40534306e6e..fa1f390a968 100644 --- a/docs/content/en/docs/implementing/tasks/_index.md +++ b/docs/content/en/docs/implementing/tasks/_index.md @@ -9,7 +9,7 @@ A [KeptnTaskDefinition](../../yaml-crd-ref/taskdefinition.md/) resource defines one or more "executables" (functions, programs, scripts, etc) -that the Keptn Lifecycle Toolkit runs +that Keptn runs as part of the pre- and post-deployment phases of a [KeptnApp](../../yaml-crd-ref/app.md) or [KeptnWorkload](../../crd-ref/lifecycle/v1alpha3/#keptnworkload). @@ -63,7 +63,7 @@ to define the task. The `spec` section of the `KeptnTaskDefinition` defines the runner to use for the container: -KLT provides a general Kubernetes that you can configure +Keptn provides a general Kubernetes that you can configure to do almost anything you want: - The `container-runtime` runner provides @@ -73,7 +73,7 @@ to do almost anything you want: This gives you the greatest flexibility to define tasks using the language and facilities of your choice -KLT also includes two "pre-defined" runners: +Keptn also includes two "pre-defined" runners: - Use the `deno-runtime` runner to define tasks using Deno scripts, which use JavaScript/Typescript syntax with a few limitations. @@ -104,7 +104,7 @@ All `KeptnTask` resources that are defined by (either pre-deployment or post-deployment) execute in parallel. This is by design, because Keptn is not a pipeline engine. **Task sequences that are not part of the lifecycle workflow -should not be handled by KLT** +should not be handled by Keptn** but should instead be handled by the pipeline engine tools being used such as Jenkins, Argo Workflows, Flux, and Tekton. @@ -256,7 +256,7 @@ spec: Note the following about using parameters with functions: -- The Lifecycle Toolkit passes the values +- Keptn passes the values defined inside the `map` field as a JSON object. - Multi-level maps are not currently supported. - The JSON object can be read through the environment variable `DATA` From 41e878ff8bbb438efa4b221470a571687dd392e9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 08:43:42 +0200 Subject: [PATCH 47/78] deps: update module github.com/onsi/ginkgo/v2 to v2.12.0 (#2019) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Signed-off-by: odubajDT Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: odubajDT --- lifecycle-operator/go.mod | 4 ++-- lifecycle-operator/go.sum | 10 +++++----- scheduler/go.mod | 8 ++++---- scheduler/go.sum | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lifecycle-operator/go.mod b/lifecycle-operator/go.mod index 644f3532a58..dea3d8cf55e 100644 --- a/lifecycle-operator/go.mod +++ b/lifecycle-operator/go.mod @@ -11,7 +11,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f github.com/magiconair/properties v1.8.7 - github.com/onsi/ginkgo/v2 v2.11.0 + github.com/onsi/ginkgo/v2 v2.12.0 github.com/onsi/gomega v1.27.10 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 @@ -87,7 +87,7 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.9.3 // indirect + golang.org/x/tools v0.12.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect diff --git a/lifecycle-operator/go.sum b/lifecycle-operator/go.sum index f7b7c9c119e..e7eefba878d 100644 --- a/lifecycle-operator/go.sum +++ b/lifecycle-operator/go.sum @@ -228,8 +228,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= +github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= +github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -353,7 +353,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -489,8 +489,8 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/scheduler/go.mod b/scheduler/go.mod index 715e20ccf85..ca87c0a1f74 100644 --- a/scheduler/go.mod +++ b/scheduler/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/kelseyhightower/envconfig v1.4.0 - github.com/onsi/ginkgo/v2 v2.11.0 + github.com/onsi/ginkgo/v2 v2.12.0 github.com/onsi/gomega v1.27.10 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.8.4 @@ -91,14 +91,14 @@ require ( go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.21.0 // indirect golang.org/x/crypto v0.12.0 // indirect - golang.org/x/net v0.12.0 // indirect + golang.org/x/net v0.14.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sync v0.2.0 // indirect + golang.org/x/sync v0.3.0 // indirect golang.org/x/sys v0.11.0 // indirect golang.org/x/term v0.11.0 // indirect golang.org/x/text v0.12.0 // indirect golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - golang.org/x/tools v0.9.3 // indirect + golang.org/x/tools v0.12.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect diff --git a/scheduler/go.sum b/scheduler/go.sum index d5c710595e4..3d4934bc139 100644 --- a/scheduler/go.sum +++ b/scheduler/go.sum @@ -272,8 +272,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= +github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= +github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= @@ -437,7 +437,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -461,8 +461,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -573,8 +573,8 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 14573cd1b3a0fec12ceb7bd3f23c3fa8432d8528 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 08:43:59 +0200 Subject: [PATCH 48/78] deps: update module golang.org/x/net to v0.14.0 (#2020) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- metrics-operator/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index 3b7a96f0cf7..f199dc83356 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -15,7 +15,7 @@ require ( github.com/prometheus/common v0.44.0 github.com/stretchr/testify v1.8.4 golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 - golang.org/x/net v0.12.0 + golang.org/x/net v0.14.0 gopkg.in/inf.v0 v0.9.1 k8s.io/api v0.26.8 k8s.io/apiextensions-apiserver v0.26.8 From 257b220a6171ccc82d1b471002b6cf773ec9bd09 Mon Sep 17 00:00:00 2001 From: Florian Bacher Date: Tue, 5 Sep 2023 08:52:07 +0200 Subject: [PATCH 49/78] feat(lifecycle-operator): clean up KeptnTask API by removing duplicated attributes (#1965) Signed-off-by: Florian Bacher --- .../scripts/.helm-tests/default/result.yaml | 766 +++++++++-------- .../docs/crd-ref/lifecycle/v1alpha3/_index.md | 4 - helm/chart/templates/keptntask-crd.yaml | 767 +++++++++--------- .../v1alpha3/keptnappversion_test.go | 8 +- .../v1alpha3/keptnappversion_types.go | 8 +- .../v1alpha3/keptntask_conversion.go | 6 + .../apis/lifecycle/v1alpha3/keptntask_test.go | 16 +- .../lifecycle/v1alpha3/keptntask_types.go | 59 +- .../v1alpha3/keptnworkloadinstance_test.go | 10 +- .../v1alpha3/keptnworkloadinstance_types.go | 10 +- .../bases/lifecycle.keptn.sh_keptntasks.yaml | 28 - .../function_execution/task_schedule.yaml | 7 +- .../function_execution/task_slack.yaml | 14 +- .../common/helperfunctions_test.go | 12 +- .../lifecycle/keptntask/job_utils.go | 18 - .../lifecycle/keptntask/job_utils_test.go | 10 +- .../lifecycle/keptntask/runtime_builder.go | 2 +- .../keptntask/runtime_builder_test.go | 3 + .../test/component/task/task_test.go | 8 +- .../integration/api-conversion/01-assert.yaml | 16 + .../api-conversion/01-install.yaml | 20 + .../app-failing-pre-task-retry/00-assert.yaml | 7 +- .../00-assert.yaml | 7 +- .../00-assert.yaml | 7 +- 24 files changed, 894 insertions(+), 919 deletions(-) create mode 100644 lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_conversion.go diff --git a/.github/scripts/.helm-tests/default/result.yaml b/.github/scripts/.helm-tests/default/result.yaml index a46a56153b4..5d84bab4393 100644 --- a/.github/scripts/.helm-tests/default/result.yaml +++ b/.github/scripts/.helm-tests/default/result.yaml @@ -3215,421 +3215,391 @@ spec: singular: keptntask scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .spec.app - name: AppName - type: string - - jsonPath: .spec.appVersion - name: AppVersion - type: string - - jsonPath: .spec.workload - name: WorkloadName - type: string - - jsonPath: .spec.workloadVersion - name: WorkloadVersion - type: string - - jsonPath: .status.jobName - name: Job Name - type: string - - jsonPath: .status.status - name: Status - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: KeptnTask is the Schema for the keptntasks API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation + - additionalPrinterColumns: + - jsonPath: .spec.app + name: AppName + type: string + - jsonPath: .spec.appVersion + name: AppVersion + type: string + - jsonPath: .spec.workload + name: WorkloadName + type: string + - jsonPath: .spec.workloadVersion + name: WorkloadVersion + type: string + - jsonPath: .status.jobName + name: Job Name + type: string + - jsonPath: .status.status + name: Status + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: KeptnTask is the Schema for the keptntasks API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: KeptnTaskSpec defines the desired state of KeptnTask - properties: - app: - type: string - appVersion: - type: string - checkType: - type: string - context: - properties: - appName: - type: string - appVersion: - type: string - objectType: - type: string - taskType: - type: string - workloadName: - type: string - workloadVersion: - type: string - required: - - appName + type: string + metadata: + type: object + spec: + description: KeptnTaskSpec defines the desired state of KeptnTask + properties: + app: + type: string + appVersion: + type: string + checkType: + type: string + context: + properties: + appName: + type: string + appVersion: + type: string + objectType: + type: string + taskType: + type: string + workloadName: + type: string + workloadVersion: + type: string + required: + - appName + - appVersion + - objectType + - taskType + - workloadName + - workloadVersion + type: object + parameters: + properties: + map: + additionalProperties: + type: string + type: object + type: object + secureParameters: + properties: + secret: + type: string + type: object + taskDefinition: + type: string + workload: + type: string + workloadVersion: + type: string + required: + - app - appVersion - - objectType - - taskType - - workloadName + - context + - taskDefinition + - workload - workloadVersion - type: object - parameters: - properties: - map: - additionalProperties: - type: string - type: object - type: object - secureParameters: - properties: - secret: - type: string - type: object - taskDefinition: - type: string - workload: - type: string - workloadVersion: - type: string - required: - - app - - appVersion - - context - - taskDefinition - - workload - - workloadVersion - type: object - status: - description: KeptnTaskStatus defines the observed state of KeptnTask - properties: - endTime: - format: date-time - type: string - jobName: - type: string - message: - type: string - startTime: - format: date-time - type: string - status: - default: Pending - type: string - type: object - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - jsonPath: .spec.app - name: AppName - type: string - - jsonPath: .spec.appVersion - name: AppVersion - type: string - - jsonPath: .spec.workload - name: WorkloadName - type: string - - jsonPath: .spec.workloadVersion - name: WorkloadVersion - type: string - - jsonPath: .status.jobName - name: Job Name - type: string - - jsonPath: .status.status - name: Status - type: string - name: v1alpha2 - schema: - openAPIV3Schema: - description: KeptnTask is the Schema for the keptntasks API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation + type: object + status: + description: KeptnTaskStatus defines the observed state of KeptnTask + properties: + endTime: + format: date-time + type: string + jobName: + type: string + message: + type: string + startTime: + format: date-time + type: string + status: + default: Pending + type: string + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .spec.app + name: AppName + type: string + - jsonPath: .spec.appVersion + name: AppVersion + type: string + - jsonPath: .spec.workload + name: WorkloadName + type: string + - jsonPath: .spec.workloadVersion + name: WorkloadVersion + type: string + - jsonPath: .status.jobName + name: Job Name + type: string + - jsonPath: .status.status + name: Status + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + description: KeptnTask is the Schema for the keptntasks API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: KeptnTaskSpec defines the desired state of KeptnTask - properties: - app: - type: string - appVersion: - type: string - checkType: - type: string - context: - properties: - appName: - type: string - appVersion: - type: string - objectType: - type: string - taskType: - type: string - workloadName: - type: string - workloadVersion: - type: string - required: - - appName + type: string + metadata: + type: object + spec: + description: KeptnTaskSpec defines the desired state of KeptnTask + properties: + app: + type: string + appVersion: + type: string + checkType: + type: string + context: + properties: + appName: + type: string + appVersion: + type: string + objectType: + type: string + taskType: + type: string + workloadName: + type: string + workloadVersion: + type: string + required: + - appName + - appVersion + - objectType + - taskType + - workloadName + - workloadVersion + type: object + parameters: + properties: + map: + additionalProperties: + type: string + type: object + type: object + secureParameters: + properties: + secret: + type: string + type: object + taskDefinition: + type: string + workload: + type: string + workloadVersion: + type: string + required: + - app - appVersion - - objectType - - taskType - - workloadName + - context + - taskDefinition + - workload - workloadVersion - type: object - parameters: - properties: - map: - additionalProperties: - type: string - type: object - type: object - secureParameters: - properties: - secret: - type: string - type: object - taskDefinition: - type: string - workload: - type: string - workloadVersion: - type: string - required: - - app - - appVersion - - context - - taskDefinition - - workload - - workloadVersion - type: object - status: - description: KeptnTaskStatus defines the observed state of KeptnTask - properties: - endTime: - format: date-time - type: string - jobName: - type: string - message: - type: string - startTime: - format: date-time - type: string - status: - default: Pending - type: string - type: object - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - jsonPath: .spec.app - name: AppName - type: string - - jsonPath: .spec.appVersion - name: AppVersion - type: string - - jsonPath: .spec.workload - name: WorkloadName - type: string - - jsonPath: .spec.workloadVersion - name: WorkloadVersion - type: string - - jsonPath: .status.jobName - name: Job Name - type: string - - jsonPath: .status.status - name: Status - type: string - name: v1alpha3 - schema: - openAPIV3Schema: - description: KeptnTask is the Schema for the keptntasks API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation + type: object + status: + description: KeptnTaskStatus defines the observed state of KeptnTask + properties: + endTime: + format: date-time + type: string + jobName: + type: string + message: + type: string + startTime: + format: date-time + type: string + status: + default: Pending + type: string + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .spec.app + name: AppName + type: string + - jsonPath: .spec.appVersion + name: AppVersion + type: string + - jsonPath: .spec.workload + name: WorkloadName + type: string + - jsonPath: .spec.workloadVersion + name: WorkloadVersion + type: string + - jsonPath: .status.jobName + name: Job Name + type: string + - jsonPath: .status.status + name: Status + type: string + name: v1alpha3 + schema: + openAPIV3Schema: + description: KeptnTask is the Schema for the keptntasks API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec describes the desired state of the KeptnTask. - properties: - app: - description: AppName defines the KeptnApp for which the KeptnTask is - executed. - type: string - appVersion: - description: AppVersion defines the version of the KeptnApp for which - the KeptnTask is executed. - type: string - checkType: - description: Type indicates whether the KeptnTask is part of the pre- - or postDeployment phase. - type: string - context: - description: Context contains contextual information about the task - execution. - properties: - appName: - description: AppName the name of the KeptnApp the KeptnTask is being - executed for. - type: string - appVersion: - description: AppVersion the version of the KeptnApp the KeptnTask - is being executed for. - type: string - objectType: - description: ObjectType indicates whether the KeptnTask is being - executed for a KeptnApp or KeptnWorkload. - type: string - taskType: - description: TaskType indicates whether the KeptnTask is part of - the pre- or postDeployment phase. - type: string - workloadName: - description: WorkloadName the name of the KeptnWorkload the KeptnTask - is being executed for. - type: string - workloadVersion: - description: WorkloadVersion the version of the KeptnWorkload the - KeptnTask is being executed for. - type: string - required: - - appName - - appVersion - - objectType - - taskType - - workloadName - - workloadVersion - type: object - parameters: - description: Parameters contains parameters that will be passed to the - job that executes the task. - properties: - map: - additionalProperties: + type: string + metadata: + type: object + spec: + description: Spec describes the desired state of the KeptnTask. + properties: + checkType: + description: Type indicates whether the KeptnTask is part of the pre- + or postDeployment phase. + type: string + context: + description: Context contains contextual information about the task + execution. + properties: + appName: + description: AppName the name of the KeptnApp the KeptnTask is + being executed for. type: string - description: Inline contains the parameters that will be made available - to the job executing the KeptnTask via the 'DATA' environment - variable. The 'DATA' environment variable's content will be a - json encoded string containing all properties of the map provided. - type: object - type: object - retries: - default: 10 - description: Retries indicates how many times the KeptnTask can be attempted - in the case of an error before considering the KeptnTask to be failed. - format: int32 - type: integer - secureParameters: - description: SecureParameters contains secure parameters that will be - passed to the job that executes the task. These will be stored and - accessed as secrets in the cluster. - properties: - secret: - description: Secret contains the parameters that will be made available - to the job executing the KeptnTask via the 'SECRET_DATA' environment - variable. The 'SECRET_DATA' environment variable's content will - the same as value of the 'SECRET_DATA' key of the referenced secret. - type: string - type: object - taskDefinition: - description: TaskDefinition refers to the name of the KeptnTaskDefinition - which includes the specification for the task to be performed. The - KeptnTaskDefinition can be located in the same namespace as the KeptnTask, - or in the KLT namespace. - type: string - timeout: - default: 5m - description: Timeout specifies the maximum time to wait for the task - to be completed successfully. If the task does not complete successfully - within this time frame, it will be considered to be failed. - pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$ - type: string - workload: - description: Workload defines the KeptnWorkload for which the KeptnTask - is executed. - type: string - workloadVersion: - description: WorkloadVersion defines the version of the KeptnWorkload - for which the KeptnTask is executed. - type: string - required: - - app - - appVersion - - context - - taskDefinition - - workload - - workloadVersion - type: object - status: - description: Status describes the current state of the KeptnTask. - properties: - endTime: - description: EndTime represents the time at which the KeptnTask finished. - format: date-time - type: string - jobName: - description: JobName is the name of the Job executing the Task. - type: string - message: - description: Message contains information about unexpected errors encountered - during the execution of the KeptnTask. - type: string - reason: - description: Reason contains more information about the reason for the - last transition of the Job executing the KeptnTask. - type: string - startTime: - description: StartTime represents the time at which the KeptnTask started. - format: date-time - type: string - status: - default: Pending - description: Status represents the overall state of the KeptnTask. - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] + appVersion: + description: AppVersion the version of the KeptnApp the KeptnTask + is being executed for. + type: string + objectType: + description: ObjectType indicates whether the KeptnTask is being + executed for a KeptnApp or KeptnWorkload. + type: string + taskType: + description: TaskType indicates whether the KeptnTask is part + of the pre- or postDeployment phase. + type: string + workloadName: + description: WorkloadName the name of the KeptnWorkload the KeptnTask + is being executed for. + type: string + workloadVersion: + description: WorkloadVersion the version of the KeptnWorkload + the KeptnTask is being executed for. + type: string + type: object + parameters: + description: Parameters contains parameters that will be passed to + the job that executes the task. + properties: + map: + additionalProperties: + type: string + description: Inline contains the parameters that will be made + available to the job executing the KeptnTask via the 'DATA' + environment variable. The 'DATA' environment variable's content + will be a json encoded string containing all properties of the + map provided. + type: object + type: object + retries: + default: 10 + description: Retries indicates how many times the KeptnTask can be + attempted in the case of an error before considering the KeptnTask + to be failed. + format: int32 + type: integer + secureParameters: + description: SecureParameters contains secure parameters that will + be passed to the job that executes the task. These will be stored + and accessed as secrets in the cluster. + properties: + secret: + description: Secret contains the parameters that will be made + available to the job executing the KeptnTask via the 'SECRET_DATA' + environment variable. The 'SECRET_DATA' environment variable's + content will the same as value of the 'SECRET_DATA' key of the + referenced secret. + type: string + type: object + taskDefinition: + description: TaskDefinition refers to the name of the KeptnTaskDefinition + which includes the specification for the task to be performed. The + KeptnTaskDefinition can be located in the same namespace as the + KeptnTask, or in the KLT namespace. + type: string + timeout: + default: 5m + description: Timeout specifies the maximum time to wait for the task + to be completed successfully. If the task does not complete successfully + within this time frame, it will be considered to be failed. + pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$ + type: string + required: + - taskDefinition + type: object + status: + description: Status describes the current state of the KeptnTask. + properties: + endTime: + description: EndTime represents the time at which the KeptnTask finished. + format: date-time + type: string + jobName: + description: JobName is the name of the Job executing the Task. + type: string + message: + description: Message contains information about unexpected errors + encountered during the execution of the KeptnTask. + type: string + reason: + description: Reason contains more information about the reason for + the last transition of the Job executing the KeptnTask. + type: string + startTime: + description: StartTime represents the time at which the KeptnTask + started. + format: date-time + type: string + status: + default: Pending + description: Status represents the overall state of the KeptnTask. + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} --- # Source: klt/templates/keptntaskdefinition-crd.yaml apiVersion: apiextensions.k8s.io/v1 diff --git a/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md b/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md index 905e43fe6e7..7587d7c60c6 100644 --- a/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md +++ b/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md @@ -676,10 +676,6 @@ _Appears in:_ | Field | Description | | --- | --- | -| `workload` _string_ | Workload defines the KeptnWorkload for which the KeptnTask is executed. | -| `workloadVersion` _string_ | WorkloadVersion defines the version of the KeptnWorkload for which the KeptnTask is executed. | -| `app` _string_ | AppName defines the KeptnApp for which the KeptnTask is executed. | -| `appVersion` _string_ | AppVersion defines the version of the KeptnApp for which the KeptnTask is executed. | | `taskDefinition` _string_ | TaskDefinition refers to the name of the KeptnTaskDefinition which includes the specification for the task to be performed. The KeptnTaskDefinition can be located in the same namespace as the KeptnTask, or in the KLT namespace. | | `context` _[TaskContext](#taskcontext)_ | Context contains contextual information about the task execution. | | `parameters` _[TaskParameters](#taskparameters)_ | Parameters contains parameters that will be passed to the job that executes the task. | diff --git a/helm/chart/templates/keptntask-crd.yaml b/helm/chart/templates/keptntask-crd.yaml index 3ecd20679ea..469d519d8d5 100644 --- a/helm/chart/templates/keptntask-crd.yaml +++ b/helm/chart/templates/keptntask-crd.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -19,418 +20,388 @@ spec: singular: keptntask scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .spec.app - name: AppName - type: string - - jsonPath: .spec.appVersion - name: AppVersion - type: string - - jsonPath: .spec.workload - name: WorkloadName - type: string - - jsonPath: .spec.workloadVersion - name: WorkloadVersion - type: string - - jsonPath: .status.jobName - name: Job Name - type: string - - jsonPath: .status.status - name: Status - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: KeptnTask is the Schema for the keptntasks API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation + - additionalPrinterColumns: + - jsonPath: .spec.app + name: AppName + type: string + - jsonPath: .spec.appVersion + name: AppVersion + type: string + - jsonPath: .spec.workload + name: WorkloadName + type: string + - jsonPath: .spec.workloadVersion + name: WorkloadVersion + type: string + - jsonPath: .status.jobName + name: Job Name + type: string + - jsonPath: .status.status + name: Status + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: KeptnTask is the Schema for the keptntasks API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: KeptnTaskSpec defines the desired state of KeptnTask - properties: - app: - type: string - appVersion: - type: string - checkType: - type: string - context: - properties: - appName: - type: string - appVersion: - type: string - objectType: - type: string - taskType: - type: string - workloadName: - type: string - workloadVersion: - type: string - required: - - appName + type: string + metadata: + type: object + spec: + description: KeptnTaskSpec defines the desired state of KeptnTask + properties: + app: + type: string + appVersion: + type: string + checkType: + type: string + context: + properties: + appName: + type: string + appVersion: + type: string + objectType: + type: string + taskType: + type: string + workloadName: + type: string + workloadVersion: + type: string + required: + - appName + - appVersion + - objectType + - taskType + - workloadName + - workloadVersion + type: object + parameters: + properties: + map: + additionalProperties: + type: string + type: object + type: object + secureParameters: + properties: + secret: + type: string + type: object + taskDefinition: + type: string + workload: + type: string + workloadVersion: + type: string + required: + - app - appVersion - - objectType - - taskType - - workloadName + - context + - taskDefinition + - workload - workloadVersion - type: object - parameters: - properties: - map: - additionalProperties: - type: string - type: object - type: object - secureParameters: - properties: - secret: - type: string - type: object - taskDefinition: - type: string - workload: - type: string - workloadVersion: - type: string - required: - - app - - appVersion - - context - - taskDefinition - - workload - - workloadVersion - type: object - status: - description: KeptnTaskStatus defines the observed state of KeptnTask - properties: - endTime: - format: date-time - type: string - jobName: - type: string - message: - type: string - startTime: - format: date-time - type: string - status: - default: Pending - type: string - type: object - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - jsonPath: .spec.app - name: AppName - type: string - - jsonPath: .spec.appVersion - name: AppVersion - type: string - - jsonPath: .spec.workload - name: WorkloadName - type: string - - jsonPath: .spec.workloadVersion - name: WorkloadVersion - type: string - - jsonPath: .status.jobName - name: Job Name - type: string - - jsonPath: .status.status - name: Status - type: string - name: v1alpha2 - schema: - openAPIV3Schema: - description: KeptnTask is the Schema for the keptntasks API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation + type: object + status: + description: KeptnTaskStatus defines the observed state of KeptnTask + properties: + endTime: + format: date-time + type: string + jobName: + type: string + message: + type: string + startTime: + format: date-time + type: string + status: + default: Pending + type: string + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .spec.app + name: AppName + type: string + - jsonPath: .spec.appVersion + name: AppVersion + type: string + - jsonPath: .spec.workload + name: WorkloadName + type: string + - jsonPath: .spec.workloadVersion + name: WorkloadVersion + type: string + - jsonPath: .status.jobName + name: Job Name + type: string + - jsonPath: .status.status + name: Status + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + description: KeptnTask is the Schema for the keptntasks API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: KeptnTaskSpec defines the desired state of KeptnTask - properties: - app: - type: string - appVersion: - type: string - checkType: - type: string - context: - properties: - appName: - type: string - appVersion: - type: string - objectType: - type: string - taskType: - type: string - workloadName: - type: string - workloadVersion: - type: string - required: - - appName + type: string + metadata: + type: object + spec: + description: KeptnTaskSpec defines the desired state of KeptnTask + properties: + app: + type: string + appVersion: + type: string + checkType: + type: string + context: + properties: + appName: + type: string + appVersion: + type: string + objectType: + type: string + taskType: + type: string + workloadName: + type: string + workloadVersion: + type: string + required: + - appName + - appVersion + - objectType + - taskType + - workloadName + - workloadVersion + type: object + parameters: + properties: + map: + additionalProperties: + type: string + type: object + type: object + secureParameters: + properties: + secret: + type: string + type: object + taskDefinition: + type: string + workload: + type: string + workloadVersion: + type: string + required: + - app - appVersion - - objectType - - taskType - - workloadName + - context + - taskDefinition + - workload - workloadVersion - type: object - parameters: - properties: - map: - additionalProperties: - type: string - type: object - type: object - secureParameters: - properties: - secret: - type: string - type: object - taskDefinition: - type: string - workload: - type: string - workloadVersion: - type: string - required: - - app - - appVersion - - context - - taskDefinition - - workload - - workloadVersion - type: object - status: - description: KeptnTaskStatus defines the observed state of KeptnTask - properties: - endTime: - format: date-time - type: string - jobName: - type: string - message: - type: string - startTime: - format: date-time - type: string - status: - default: Pending - type: string - type: object - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - jsonPath: .spec.app - name: AppName - type: string - - jsonPath: .spec.appVersion - name: AppVersion - type: string - - jsonPath: .spec.workload - name: WorkloadName - type: string - - jsonPath: .spec.workloadVersion - name: WorkloadVersion - type: string - - jsonPath: .status.jobName - name: Job Name - type: string - - jsonPath: .status.status - name: Status - type: string - name: v1alpha3 - schema: - openAPIV3Schema: - description: KeptnTask is the Schema for the keptntasks API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation + type: object + status: + description: KeptnTaskStatus defines the observed state of KeptnTask + properties: + endTime: + format: date-time + type: string + jobName: + type: string + message: + type: string + startTime: + format: date-time + type: string + status: + default: Pending + type: string + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .spec.app + name: AppName + type: string + - jsonPath: .spec.appVersion + name: AppVersion + type: string + - jsonPath: .spec.workload + name: WorkloadName + type: string + - jsonPath: .spec.workloadVersion + name: WorkloadVersion + type: string + - jsonPath: .status.jobName + name: Job Name + type: string + - jsonPath: .status.status + name: Status + type: string + name: v1alpha3 + schema: + openAPIV3Schema: + description: KeptnTask is the Schema for the keptntasks API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec describes the desired state of the KeptnTask. - properties: - app: - description: AppName defines the KeptnApp for which the KeptnTask is - executed. - type: string - appVersion: - description: AppVersion defines the version of the KeptnApp for which - the KeptnTask is executed. - type: string - checkType: - description: Type indicates whether the KeptnTask is part of the pre- - or postDeployment phase. - type: string - context: - description: Context contains contextual information about the task - execution. - properties: - appName: - description: AppName the name of the KeptnApp the KeptnTask is being - executed for. - type: string - appVersion: - description: AppVersion the version of the KeptnApp the KeptnTask - is being executed for. - type: string - objectType: - description: ObjectType indicates whether the KeptnTask is being - executed for a KeptnApp or KeptnWorkload. - type: string - taskType: - description: TaskType indicates whether the KeptnTask is part of - the pre- or postDeployment phase. - type: string - workloadName: - description: WorkloadName the name of the KeptnWorkload the KeptnTask - is being executed for. - type: string - workloadVersion: - description: WorkloadVersion the version of the KeptnWorkload the - KeptnTask is being executed for. - type: string - required: - - appName - - appVersion - - objectType - - taskType - - workloadName - - workloadVersion - type: object - parameters: - description: Parameters contains parameters that will be passed to the - job that executes the task. - properties: - map: - additionalProperties: + type: string + metadata: + type: object + spec: + description: Spec describes the desired state of the KeptnTask. + properties: + checkType: + description: Type indicates whether the KeptnTask is part of the pre- + or postDeployment phase. + type: string + context: + description: Context contains contextual information about the task + execution. + properties: + appName: + description: AppName the name of the KeptnApp the KeptnTask is + being executed for. + type: string + appVersion: + description: AppVersion the version of the KeptnApp the KeptnTask + is being executed for. + type: string + objectType: + description: ObjectType indicates whether the KeptnTask is being + executed for a KeptnApp or KeptnWorkload. + type: string + taskType: + description: TaskType indicates whether the KeptnTask is part + of the pre- or postDeployment phase. + type: string + workloadName: + description: WorkloadName the name of the KeptnWorkload the KeptnTask + is being executed for. + type: string + workloadVersion: + description: WorkloadVersion the version of the KeptnWorkload + the KeptnTask is being executed for. + type: string + type: object + parameters: + description: Parameters contains parameters that will be passed to + the job that executes the task. + properties: + map: + additionalProperties: + type: string + description: Inline contains the parameters that will be made + available to the job executing the KeptnTask via the 'DATA' + environment variable. The 'DATA' environment variable's content + will be a json encoded string containing all properties of the + map provided. + type: object + type: object + retries: + default: 10 + description: Retries indicates how many times the KeptnTask can be + attempted in the case of an error before considering the KeptnTask + to be failed. + format: int32 + type: integer + secureParameters: + description: SecureParameters contains secure parameters that will + be passed to the job that executes the task. These will be stored + and accessed as secrets in the cluster. + properties: + secret: + description: Secret contains the parameters that will be made + available to the job executing the KeptnTask via the 'SECRET_DATA' + environment variable. The 'SECRET_DATA' environment variable's + content will the same as value of the 'SECRET_DATA' key of the + referenced secret. type: string - description: Inline contains the parameters that will be made available - to the job executing the KeptnTask via the 'DATA' environment - variable. The 'DATA' environment variable's content will be a - json encoded string containing all properties of the map provided. - type: object - type: object - retries: - default: 10 - description: Retries indicates how many times the KeptnTask can be attempted - in the case of an error before considering the KeptnTask to be failed. - format: int32 - type: integer - secureParameters: - description: SecureParameters contains secure parameters that will be - passed to the job that executes the task. These will be stored and - accessed as secrets in the cluster. - properties: - secret: - description: Secret contains the parameters that will be made available - to the job executing the KeptnTask via the 'SECRET_DATA' environment - variable. The 'SECRET_DATA' environment variable's content will - the same as value of the 'SECRET_DATA' key of the referenced secret. - type: string - type: object - taskDefinition: - description: TaskDefinition refers to the name of the KeptnTaskDefinition - which includes the specification for the task to be performed. The - KeptnTaskDefinition can be located in the same namespace as the KeptnTask, - or in the KLT namespace. - type: string - timeout: - default: 5m - description: Timeout specifies the maximum time to wait for the task - to be completed successfully. If the task does not complete successfully - within this time frame, it will be considered to be failed. - pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$ - type: string - workload: - description: Workload defines the KeptnWorkload for which the KeptnTask - is executed. - type: string - workloadVersion: - description: WorkloadVersion defines the version of the KeptnWorkload - for which the KeptnTask is executed. - type: string - required: - - app - - appVersion - - context - - taskDefinition - - workload - - workloadVersion - type: object - status: - description: Status describes the current state of the KeptnTask. - properties: - endTime: - description: EndTime represents the time at which the KeptnTask finished. - format: date-time - type: string - jobName: - description: JobName is the name of the Job executing the Task. - type: string - message: - description: Message contains information about unexpected errors encountered - during the execution of the KeptnTask. - type: string - reason: - description: Reason contains more information about the reason for the - last transition of the Job executing the KeptnTask. - type: string - startTime: - description: StartTime represents the time at which the KeptnTask started. - format: date-time - type: string - status: - default: Pending - description: Status represents the overall state of the KeptnTask. - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] \ No newline at end of file + type: object + taskDefinition: + description: TaskDefinition refers to the name of the KeptnTaskDefinition + which includes the specification for the task to be performed. The + KeptnTaskDefinition can be located in the same namespace as the + KeptnTask, or in the KLT namespace. + type: string + timeout: + default: 5m + description: Timeout specifies the maximum time to wait for the task + to be completed successfully. If the task does not complete successfully + within this time frame, it will be considered to be failed. + pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$ + type: string + required: + - taskDefinition + type: object + status: + description: Status describes the current state of the KeptnTask. + properties: + endTime: + description: EndTime represents the time at which the KeptnTask finished. + format: date-time + type: string + jobName: + description: JobName is the name of the Job executing the Task. + type: string + message: + description: Message contains information about unexpected errors + encountered during the execution of the KeptnTask. + type: string + reason: + description: Reason contains more information about the reason for + the last transition of the Job executing the KeptnTask. + type: string + startTime: + description: StartTime represents the time at which the KeptnTask + started. + format: date-time + type: string + status: + default: Pending + description: Status represents the overall state of the KeptnTask. + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnappversion_test.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnappversion_test.go index c7a5e40bb3b..1f51ba625f8 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnappversion_test.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnappversion_test.go @@ -197,8 +197,12 @@ func TestKeptnAppVersion(t *testing.T) { }, }, common.PostDeploymentCheckType) require.Equal(t, KeptnTaskSpec{ - AppVersion: app.GetVersion(), - AppName: app.GetParentName(), + Context: TaskContext{ + AppName: app.GetParentName(), + AppVersion: app.GetVersion(), + TaskType: string(common.PostDeploymentCheckType), + ObjectType: "App", + }, TaskDefinition: "task-def", Parameters: TaskParameters{}, SecureParameters: SecureParameters{}, diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnappversion_types.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnappversion_types.go index 1b5c6ffcf12..1bdc3563c4b 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnappversion_types.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnappversion_types.go @@ -340,8 +340,12 @@ func (a KeptnAppVersion) GenerateTask(taskDefinition KeptnTaskDefinition, checkT Annotations: taskDefinition.Annotations, }, Spec: KeptnTaskSpec{ - AppVersion: a.GetVersion(), - AppName: a.GetParentName(), + Context: TaskContext{ + AppName: a.GetParentName(), + AppVersion: a.GetVersion(), + TaskType: string(checkType), + ObjectType: "App", + }, TaskDefinition: taskDefinition.Name, Parameters: TaskParameters{}, SecureParameters: SecureParameters{}, diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_conversion.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_conversion.go new file mode 100644 index 00000000000..9f3ce38f4d5 --- /dev/null +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_conversion.go @@ -0,0 +1,6 @@ +package v1alpha3 + +// Hub is the stub function to make the API conversion pattern with hub and spokes complete +func (kt *KeptnTask) Hub() { + // Hub() needed to implement interface +} diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_test.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_test.go index 55c4bf1c91b..23e17c9d7bf 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_test.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_test.go @@ -22,8 +22,10 @@ func TestKeptnTask(t *testing.T) { }, }, Spec: KeptnTaskSpec{ - AppName: "app", - AppVersion: "appversion", + Context: TaskContext{ + AppName: "app", + AppVersion: "appversion", + }, Type: common.PostDeploymentCheckType, TaskDefinition: "def", Timeout: metav1.Duration{ @@ -47,8 +49,10 @@ func TestKeptnTask(t *testing.T) { }, }, Spec: KeptnTaskSpec{ - AppName: "app", - AppVersion: "appversion", + Context: TaskContext{ + AppName: "app", + AppVersion: "appversion", + }, Type: common.PostDeploymentCheckType, TaskDefinition: "def", Timeout: metav1.Duration{ @@ -98,8 +102,8 @@ func TestKeptnTask(t *testing.T) { "annotation1": "annotation2", }, task.CreateKeptnAnnotations()) - task.Spec.Workload = "workload" - task.Spec.WorkloadVersion = "workloadversion" + task.Spec.Context.WorkloadName = "workload" + task.Spec.Context.WorkloadVersion = "workloadversion" require.Equal(t, map[string]string{ "keptn.sh/app": "app", diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_types.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_types.go index d1929d892d8..ff91d9d1ea7 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_types.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_types.go @@ -32,20 +32,13 @@ import ( // KeptnTaskSpec defines the desired state of KeptnTask type KeptnTaskSpec struct { - // Workload defines the KeptnWorkload for which the KeptnTask is executed. - Workload string `json:"workload"` - // WorkloadVersion defines the version of the KeptnWorkload for which the KeptnTask is executed. - WorkloadVersion string `json:"workloadVersion"` - // AppName defines the KeptnApp for which the KeptnTask is executed. - AppName string `json:"app"` - // AppVersion defines the version of the KeptnApp for which the KeptnTask is executed. - AppVersion string `json:"appVersion"` // TaskDefinition refers to the name of the KeptnTaskDefinition // which includes the specification for the task to be performed. // The KeptnTaskDefinition can be // located in the same namespace as the KeptnTask, or in the KLT namespace. TaskDefinition string `json:"taskDefinition"` // Context contains contextual information about the task execution. + // +optional Context TaskContext `json:"context"` // Parameters contains parameters that will be passed to the job that executes the task. Parameters TaskParameters `json:"parameters,omitempty"` @@ -71,16 +64,22 @@ type KeptnTaskSpec struct { type TaskContext struct { // WorkloadName the name of the KeptnWorkload the KeptnTask is being executed for. + // +optional WorkloadName string `json:"workloadName"` // AppName the name of the KeptnApp the KeptnTask is being executed for. + // +optional AppName string `json:"appName"` // AppVersion the version of the KeptnApp the KeptnTask is being executed for. + // +optional AppVersion string `json:"appVersion"` // WorkloadVersion the version of the KeptnWorkload the KeptnTask is being executed for. + // +optional WorkloadVersion string `json:"workloadVersion"` // TaskType indicates whether the KeptnTask is part of the pre- or postDeployment phase. + // +optional TaskType string `json:"taskType"` // ObjectType indicates whether the KeptnTask is being executed for a KeptnApp or KeptnWorkload. + // +optional ObjectType string `json:"objectType"` } @@ -181,10 +180,10 @@ func (t *KeptnTask) IsEndTimeSet() bool { func (t KeptnTask) GetActiveMetricsAttributes() []attribute.KeyValue { return []attribute.KeyValue{ - common.AppName.String(t.Spec.AppName), - common.AppVersion.String(t.Spec.AppVersion), - common.WorkloadName.String(t.Spec.Workload), - common.WorkloadVersion.String(t.Spec.WorkloadVersion), + common.AppName.String(t.Spec.Context.AppName), + common.AppVersion.String(t.Spec.Context.AppVersion), + common.WorkloadName.String(t.Spec.Context.WorkloadName), + common.WorkloadVersion.String(t.Spec.Context.WorkloadVersion), common.TaskName.String(t.Name), common.TaskType.String(string(t.Spec.Type)), } @@ -192,10 +191,10 @@ func (t KeptnTask) GetActiveMetricsAttributes() []attribute.KeyValue { func (t KeptnTask) GetMetricsAttributes() []attribute.KeyValue { return []attribute.KeyValue{ - common.AppName.String(t.Spec.AppName), - common.AppVersion.String(t.Spec.AppVersion), - common.WorkloadName.String(t.Spec.Workload), - common.WorkloadVersion.String(t.Spec.WorkloadVersion), + common.AppName.String(t.Spec.Context.AppName), + common.AppVersion.String(t.Spec.Context.AppVersion), + common.WorkloadName.String(t.Spec.Context.WorkloadName), + common.WorkloadVersion.String(t.Spec.Context.WorkloadVersion), common.TaskName.String(t.Name), common.TaskType.String(string(t.Spec.Type)), common.TaskStatus.String(string(t.Status.Status)), @@ -207,27 +206,27 @@ func (t KeptnTask) SetSpanAttributes(span trace.Span) { } func (t KeptnTask) CreateKeptnAnnotations() map[string]string { - if t.Spec.Workload != "" { + if t.Spec.Context.WorkloadName != "" { return common.MergeMaps(t.Annotations, map[string]string{ - common.AppAnnotation: t.Spec.AppName, - common.WorkloadAnnotation: t.Spec.Workload, - common.VersionAnnotation: t.Spec.WorkloadVersion, + common.AppAnnotation: t.Spec.Context.AppName, + common.WorkloadAnnotation: t.Spec.Context.WorkloadName, + common.VersionAnnotation: t.Spec.Context.WorkloadVersion, common.TaskNameAnnotation: t.Name, }) } return common.MergeMaps(t.Annotations, map[string]string{ - common.AppAnnotation: t.Spec.AppName, - common.VersionAnnotation: t.Spec.AppVersion, + common.AppAnnotation: t.Spec.Context.AppName, + common.VersionAnnotation: t.Spec.Context.AppVersion, common.TaskNameAnnotation: t.Name, }) } func (t KeptnTask) GetSpanAttributes() []attribute.KeyValue { return []attribute.KeyValue{ - common.AppName.String(t.Spec.AppName), - common.AppVersion.String(t.Spec.AppVersion), - common.WorkloadName.String(t.Spec.Workload), - common.WorkloadVersion.String(t.Spec.WorkloadVersion), + common.AppName.String(t.Spec.Context.AppName), + common.AppVersion.String(t.Spec.Context.AppVersion), + common.WorkloadName.String(t.Spec.Context.WorkloadName), + common.WorkloadVersion.String(t.Spec.Context.WorkloadVersion), common.TaskName.String(t.Name), common.TaskType.String(string(t.Spec.Type)), } @@ -247,10 +246,10 @@ func (t KeptnTask) GetSpanName(phase string) string { func (t KeptnTask) GetEventAnnotations() map[string]string { return map[string]string{ - "appName": t.Spec.AppName, - "appVersion": t.Spec.AppVersion, - "workloadName": t.Spec.Workload, - "workloadVersion": t.Spec.WorkloadVersion, + "appName": t.Spec.Context.AppName, + "appVersion": t.Spec.Context.AppVersion, + "workloadName": t.Spec.Context.WorkloadName, + "workloadVersion": t.Spec.Context.WorkloadVersion, "taskName": t.Name, "taskDefinitionName": t.Spec.TaskDefinition, } diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkloadinstance_test.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkloadinstance_test.go index 0227a510484..8781e7da268 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkloadinstance_test.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkloadinstance_test.go @@ -201,9 +201,13 @@ func TestKeptnWorkloadInstance(t *testing.T) { }, }, common.PostDeploymentCheckType) require.Equal(t, KeptnTaskSpec{ - AppName: workload.GetAppName(), - WorkloadVersion: workload.GetVersion(), - Workload: workload.GetParentName(), + Context: TaskContext{ + AppName: workload.GetAppName(), + WorkloadVersion: workload.GetVersion(), + WorkloadName: workload.GetParentName(), + TaskType: string(common.PostDeploymentCheckType), + ObjectType: "Workload", + }, TaskDefinition: "task-def", Parameters: TaskParameters{}, SecureParameters: SecureParameters{}, diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkloadinstance_types.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkloadinstance_types.go index 0a5b721da3d..dd863463680 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkloadinstance_types.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkloadinstance_types.go @@ -353,9 +353,13 @@ func (w KeptnWorkloadInstance) GenerateTask(taskDefinition KeptnTaskDefinition, Annotations: taskDefinition.Annotations, }, Spec: KeptnTaskSpec{ - AppName: w.GetAppName(), - WorkloadVersion: w.GetVersion(), - Workload: w.GetParentName(), + Context: TaskContext{ + WorkloadName: w.GetParentName(), + AppName: w.GetAppName(), + WorkloadVersion: w.GetVersion(), + TaskType: string(checkType), + ObjectType: "Workload", + }, TaskDefinition: taskDefinition.Name, Parameters: TaskParameters{}, SecureParameters: SecureParameters{}, diff --git a/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptntasks.yaml b/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptntasks.yaml index 622f5ab9b5d..f376487590a 100644 --- a/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptntasks.yaml +++ b/lifecycle-operator/config/crd/bases/lifecycle.keptn.sh_keptntasks.yaml @@ -283,14 +283,6 @@ spec: spec: description: Spec describes the desired state of the KeptnTask. properties: - app: - description: AppName defines the KeptnApp for which the KeptnTask - is executed. - type: string - appVersion: - description: AppVersion defines the version of the KeptnApp for which - the KeptnTask is executed. - type: string checkType: description: Type indicates whether the KeptnTask is part of the pre- or postDeployment phase. @@ -323,13 +315,6 @@ spec: description: WorkloadVersion the version of the KeptnWorkload the KeptnTask is being executed for. type: string - required: - - appName - - appVersion - - objectType - - taskType - - workloadName - - workloadVersion type: object parameters: description: Parameters contains parameters that will be passed to @@ -378,21 +363,8 @@ spec: within this time frame, it will be considered to be failed. pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$ type: string - workload: - description: Workload defines the KeptnWorkload for which the KeptnTask - is executed. - type: string - workloadVersion: - description: WorkloadVersion defines the version of the KeptnWorkload - for which the KeptnTask is executed. - type: string required: - - app - - appVersion - - context - taskDefinition - - workload - - workloadVersion type: object status: description: Status describes the current state of the KeptnTask. diff --git a/lifecycle-operator/config/samples/function_execution/task_schedule.yaml b/lifecycle-operator/config/samples/function_execution/task_schedule.yaml index fb8c92ffcd0..efe401c173a 100644 --- a/lifecycle-operator/config/samples/function_execution/task_schedule.yaml +++ b/lifecycle-operator/config/samples/function_execution/task_schedule.yaml @@ -1,11 +1,12 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 +apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnTask metadata: name: scheduled-deployment spec: taskDefinition: schedule-upstream-deployment - workload: my-workload - version: "1.0" + context: + workloadName: my-workload + workloadVersion: "1.0" app: my-app parameters: map: diff --git a/lifecycle-operator/config/samples/function_execution/task_slack.yaml b/lifecycle-operator/config/samples/function_execution/task_slack.yaml index f255779fc68..514d2e4becf 100644 --- a/lifecycle-operator/config/samples/function_execution/task_slack.yaml +++ b/lifecycle-operator/config/samples/function_execution/task_slack.yaml @@ -4,8 +4,16 @@ metadata: name: slack-deployment-notification spec: taskDefinition: slack-notification-inline - workload: my-workload - version: "1.0" - app: my-app + appVersion: "1.0" + workload: "w" + workloadVersion: "2.0" + app: "app" + context: + workloadName: my-workload + workloadVersion: "1.0" + taskType: "pre" + appName: "my-app" + objectType: "App" + appVersion: "1.0" secureParameters: secret: slack-notification diff --git a/lifecycle-operator/controllers/common/helperfunctions_test.go b/lifecycle-operator/controllers/common/helperfunctions_test.go index 3393c9c49da..0d34aeea82c 100644 --- a/lifecycle-operator/controllers/common/helperfunctions_test.go +++ b/lifecycle-operator/controllers/common/helperfunctions_test.go @@ -297,11 +297,13 @@ func Test_setAnnotations(t *testing.T) { Namespace: "namespace", }, Spec: klcv1alpha3.KeptnTaskSpec{ - AppName: "app", - AppVersion: "1.0.0", - Workload: "workload", - WorkloadVersion: "2.0.0", - TaskDefinition: "def", + TaskDefinition: "def", + Context: klcv1alpha3.TaskContext{ + WorkloadName: "workload", + AppName: "app", + AppVersion: "1.0.0", + WorkloadVersion: "2.0.0", + }, }, }, want: map[string]string{ diff --git a/lifecycle-operator/controllers/lifecycle/keptntask/job_utils.go b/lifecycle-operator/controllers/lifecycle/keptntask/job_utils.go index d336171c911..85d7173df89 100644 --- a/lifecycle-operator/controllers/lifecycle/keptntask/job_utils.go +++ b/lifecycle-operator/controllers/lifecycle/keptntask/job_utils.go @@ -75,24 +75,6 @@ func (r *KeptnTaskReconciler) getJob(ctx context.Context, jobName string, namesp return job, nil } -func setupTaskContext(task *klcv1alpha3.KeptnTask) klcv1alpha3.TaskContext { - taskContext := klcv1alpha3.TaskContext{} - - if task.Spec.Workload != "" { - taskContext.WorkloadName = task.Spec.Workload - taskContext.WorkloadVersion = task.Spec.WorkloadVersion - taskContext.ObjectType = "Workload" - - } else { - taskContext.ObjectType = "Application" - taskContext.AppVersion = task.Spec.AppVersion - } - taskContext.TaskType = string(task.Spec.Type) - taskContext.AppName = task.Spec.AppName - - return taskContext -} - func (r *KeptnTaskReconciler) generateJob(ctx context.Context, task *klcv1alpha3.KeptnTask, definition *klcv1alpha3.KeptnTaskDefinition, request ctrl.Request) (*batchv1.Job, error) { job := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ diff --git a/lifecycle-operator/controllers/lifecycle/keptntask/job_utils_test.go b/lifecycle-operator/controllers/lifecycle/keptntask/job_utils_test.go index b7929137adf..f991e7dfff6 100644 --- a/lifecycle-operator/controllers/lifecycle/keptntask/job_utils_test.go +++ b/lifecycle-operator/controllers/lifecycle/keptntask/job_utils_test.go @@ -238,9 +238,13 @@ func makeTask(name, namespace string, taskDefinitionName string) *klcv1alpha3.Ke }, }, Spec: klcv1alpha3.KeptnTaskSpec{ - Workload: "my-workload", - AppName: "my-app", - AppVersion: "0.1.0", + Context: klcv1alpha3.TaskContext{ + WorkloadName: "my-workload", + AppName: "my-app", + AppVersion: "0.1.0", + ObjectType: "Workload", + TaskType: string(apicommon.PostDeploymentCheckType), + }, TaskDefinition: taskDefinitionName, Type: apicommon.PostDeploymentCheckType, }, diff --git a/lifecycle-operator/controllers/lifecycle/keptntask/runtime_builder.go b/lifecycle-operator/controllers/lifecycle/keptntask/runtime_builder.go index 670b46eca22..30b13eaf842 100644 --- a/lifecycle-operator/controllers/lifecycle/keptntask/runtime_builder.go +++ b/lifecycle-operator/controllers/lifecycle/keptntask/runtime_builder.go @@ -152,7 +152,7 @@ func (fb *RuntimeBuilder) getParams(ctx context.Context) (*RuntimeExecutionParam } } - params.Context = setupTaskContext(fb.options.task) + params.Context = fb.options.task.Spec.Context if len(fb.options.task.Spec.Parameters.Inline) > 0 { err = mergo.Merge(¶ms.Parameters, fb.options.task.Spec.Parameters.Inline) diff --git a/lifecycle-operator/controllers/lifecycle/keptntask/runtime_builder_test.go b/lifecycle-operator/controllers/lifecycle/keptntask/runtime_builder_test.go index 3a07d6834a8..168fd971ab0 100644 --- a/lifecycle-operator/controllers/lifecycle/keptntask/runtime_builder_test.go +++ b/lifecycle-operator/controllers/lifecycle/keptntask/runtime_builder_test.go @@ -226,6 +226,7 @@ func TestJSBuilder_getParams(t *testing.T) { Context: klcv1alpha3.TaskContext{ WorkloadName: "my-workload", AppName: "my-app", + AppVersion: "0.1.0", ObjectType: "Workload", TaskType: string(apicommon.PostDeploymentCheckType), }, @@ -258,6 +259,7 @@ func TestJSBuilder_getParams(t *testing.T) { Context: klcv1alpha3.TaskContext{ WorkloadName: "my-workload", AppName: "my-app", + AppVersion: "0.1.0", ObjectType: "Workload", TaskType: string(apicommon.PostDeploymentCheckType), }, @@ -285,6 +287,7 @@ func TestJSBuilder_getParams(t *testing.T) { Context: klcv1alpha3.TaskContext{ WorkloadName: "my-workload", AppName: "my-app", + AppVersion: "0.1.0", ObjectType: "Workload", TaskType: string(apicommon.PostDeploymentCheckType), }, diff --git a/lifecycle-operator/test/component/task/task_test.go b/lifecycle-operator/test/component/task/task_test.go index 26586a64902..20ced4ae923 100644 --- a/lifecycle-operator/test/component/task/task_test.go +++ b/lifecycle-operator/test/component/task/task_test.go @@ -256,9 +256,11 @@ func makeTask(name string, namespace, taskDefinitionName string) *klcv1alpha3.Ke }, }, Spec: klcv1alpha3.KeptnTaskSpec{ - Workload: "my-workload", - AppName: "my-app", - AppVersion: "0.1.0", + Context: klcv1alpha3.TaskContext{ + WorkloadName: "my-workload", + AppName: "my-app", + AppVersion: "0.1.0", + }, TaskDefinition: taskDefinitionName, }, } diff --git a/test/integration/api-conversion/01-assert.yaml b/test/integration/api-conversion/01-assert.yaml index b6fd57dd376..2adfb32dd31 100644 --- a/test/integration/api-conversion/01-assert.yaml +++ b/test/integration/api-conversion/01-assert.yaml @@ -72,3 +72,19 @@ spec: provider: name: prometheus query: "sum(kube_pod_container_resource_limits{resource='cpu'})" +--- +apiVersion: lifecycle.keptn.sh/v1alpha3 +kind: KeptnTask +metadata: + name: slack-deployment-notification +spec: + taskDefinition: slack-notification-inline + context: + workloadName: my-workload + workloadVersion: "1.0" + taskType: "pre" + appName: "my-app" + objectType: "App" + appVersion: "1.0" + secureParameters: + secret: slack-notification diff --git a/test/integration/api-conversion/01-install.yaml b/test/integration/api-conversion/01-install.yaml index 30030abe6c3..1561c3e10ab 100644 --- a/test/integration/api-conversion/01-install.yaml +++ b/test/integration/api-conversion/01-install.yaml @@ -68,3 +68,23 @@ spec: provider: name: prometheus query: "sum(kube_pod_container_resource_limits{resource='cpu'})" +--- +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnTask +metadata: + name: slack-deployment-notification +spec: + taskDefinition: slack-notification-inline + appVersion: "1.0" + workload: "w" + workloadVersion: "2.0" + app: "app" + context: + workloadName: my-workload + workloadVersion: "1.0" + taskType: "pre" + appName: "my-app" + objectType: "App" + appVersion: "1.0" + secureParameters: + secret: slack-notification diff --git a/test/integration/app-failing-pre-task-retry/00-assert.yaml b/test/integration/app-failing-pre-task-retry/00-assert.yaml index f3801bba361..0e97da75cab 100644 --- a/test/integration/app-failing-pre-task-retry/00-assert.yaml +++ b/test/integration/app-failing-pre-task-retry/00-assert.yaml @@ -14,9 +14,10 @@ status: apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnTask spec: - app: podtato-head - appVersion: '1.3' - checkType: pre + context: + appName: podtato-head + appVersion: '1.3' + taskType: pre retries: 2 taskDefinition: pre-task-retries timeout: 5m0s diff --git a/test/integration/app-failing-pre-task-timeout/00-assert.yaml b/test/integration/app-failing-pre-task-timeout/00-assert.yaml index bd8cb2c1dda..cef4d70d072 100644 --- a/test/integration/app-failing-pre-task-timeout/00-assert.yaml +++ b/test/integration/app-failing-pre-task-timeout/00-assert.yaml @@ -14,9 +14,10 @@ status: apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnTask spec: - app: podtato-head - appVersion: '1.3' - checkType: pre + context: + appName: podtato-head + appVersion: '1.3' + taskType: pre retries: 10 taskDefinition: pre-task-timeout timeout: 30s diff --git a/test/integration/app-one-taskdefinition-not-found/00-assert.yaml b/test/integration/app-one-taskdefinition-not-found/00-assert.yaml index 7b6da25d83d..f9521c017d5 100644 --- a/test/integration/app-one-taskdefinition-not-found/00-assert.yaml +++ b/test/integration/app-one-taskdefinition-not-found/00-assert.yaml @@ -14,9 +14,10 @@ status: apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnTask spec: - app: podtato-head - appVersion: '1.3' - checkType: pre + context: + appName: podtato-head + appVersion: '1.3' + taskType: pre retries: 10 taskDefinition: pre-task-timeout timeout: 30s From fb452c53bf79c1326aa1628bcf2c361e24e4a3c6 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Tue, 5 Sep 2023 10:06:16 +0200 Subject: [PATCH 50/78] ci: add old versions of lifecycle-operator and scheduler (#2022) --- .release-please-manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7a95c567ecd..7075efa2293 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1"} +{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1","lifecycle-operator":"0.8.1","scheduler":"0.8.1"} From db781c737d39b79e8a745e245b327d1d6220d98f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:02:51 +0200 Subject: [PATCH 51/78] deps: update dependency jaegertracing/jaeger-operator to v1.48.0 (#2018) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- examples/Makefile | 2 +- examples/support/observability/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index b40a8c17732..896e8046990 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,5 +1,5 @@ # renovate: datasource=github-tags depName=jaegertracing/jaeger-operator -JAEGER_VERSION ?= v1.47.0 +JAEGER_VERSION ?= v1.48.0 TOOLKIT_NAMESPACE ?= keptn-lifecycle-toolkit-system PODTATO_NAMESPACE ?= podtato-kubectl GRAFANA_PORT_FORWARD ?= 3000 diff --git a/examples/support/observability/Makefile b/examples/support/observability/Makefile index 1372e657934..58e51c9e12d 100644 --- a/examples/support/observability/Makefile +++ b/examples/support/observability/Makefile @@ -1,5 +1,5 @@ # renovate: datasource=github-tags depName=jaegertracing/jaeger-operator -JAEGER_VERSION ?= v1.47.0 +JAEGER_VERSION ?= v1.48.0 TOOLKIT_NAMESPACE ?= keptn-lifecycle-toolkit-system PODTATO_NAMESPACE ?= podtato-kubectl GRAFANA_PORT_FORWARD ?= 3000 From 440c3082e5400f89d791724651984ba2bc0a4724 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 5 Sep 2023 04:04:33 -0700 Subject: [PATCH 52/78] docs: implement KLT -> Keptn name change (#2001) Co-authored-by: Giovanni Liva Co-authored-by: Moritz Wiesinger --- README.md | 49 ++++++----- assets/logo/README.md | 4 +- docs/content/en/contribute/_index.md | 2 +- .../docs/contrib-guidelines-docs/_index.md | 2 +- .../docs/source-file-structure/_index.md | 28 +++--- .../general/contrib-guidelines-gen/_index.md | 8 +- .../general/git/pr-create/_index.md | 2 +- .../contribute/general/technologies/_index.md | 4 +- .../en/docs/concepts/architecture/_index.md | 4 +- .../concepts/architecture/cert-manager.md | 14 +-- .../architecture/components/_index.md | 14 +-- .../components/lifecycle-operator/_index.md | 4 +- .../components/scheduler/_index.md | 4 +- .../concepts/architecture/deployment-flow.md | 10 +-- .../architecture/keptn-apps/_index.md | 10 +-- .../concepts/architecture/working/_index.md | 8 +- .../docs/crd-ref/lifecycle/v1alpha3/_index.md | 36 ++++---- .../content/en/docs/getting-started/_index.md | 22 ++--- docs/content/en/docs/implementing/_index.md | 2 +- .../implementing/add-app-awareness/index.md | 14 +-- .../en/docs/implementing/dora/_index.md | 4 +- .../en/docs/implementing/evaluatemetrics.md | 10 +-- .../en/docs/implementing/integrate/_index.md | 52 +++++------ docs/content/en/docs/implementing/otel.md | 26 +++--- docs/content/en/docs/install/_index.md | 2 +- docs/content/en/docs/install/install.md | 42 ++++----- docs/content/en/docs/install/k8s.md | 28 +++--- docs/content/en/docs/install/reqs.md | 10 +-- docs/content/en/docs/install/upgrade.md | 12 +-- .../en/docs/{intro-klt => intro}/_index.md | 82 +++++++++--------- .../assets/dynatrace_dora_dashboard.png | Bin .../usecase-observability.md | 21 +++-- .../usecase-orchestrate.md | 22 ++--- .../{intro-klt => intro}/usecase_metrics.md | 10 +-- docs/content/en/docs/migrate/_index.md | 15 ++-- docs/content/en/docs/migrate/cicd/_index.md | 4 +- .../en/docs/migrate/metrics-observe/_index.md | 18 ++-- .../en/docs/migrate/strategy/_index.md | 72 +++++++-------- docs/content/en/docs/operate/_index.md | 6 +- docs/content/en/docs/operate/cert-manager.md | 18 ++-- docs/content/en/docs/troubleshooting.md | 24 ++--- docs/content/en/docs/tutorials/_index.md | 4 +- docs/content/en/docs/tutorials/add-tasks.md | 4 +- docs/content/en/docs/yaml-crd-ref/_index.md | 3 +- docs/content/en/docs/yaml-crd-ref/app.md | 6 +- docs/content/en/docs/yaml-crd-ref/config.md | 2 +- .../docs/yaml-crd-ref/evaluationdefinition.md | 4 +- docs/content/en/docs/yaml-crd-ref/metric.md | 4 +- .../en/docs/yaml-crd-ref/taskdefinition.md | 11 ++- examples/sample-app/README.md | 2 +- examples/sample-app/base/app-post-deploy.yaml | 2 +- examples/sample-app/base/python-task.yaml | 2 +- .../sample-app/version-1/app-pre-deploy.yaml | 2 +- .../sample-app/version-2/app-pre-deploy.yaml | 2 +- .../sample-app/version-3/app-pre-deploy.yaml | 2 +- examples/support/argo/README.md | 10 +-- examples/support/observability/README.md | 4 +- .../assets/grafana_dasboard_import_ui.json | 2 +- .../assets/grafana_dashboard.json | 2 +- helm/chart/README.md | 6 +- .../apis/lifecycle/v1alpha3/keptnapp_types.go | 8 +- .../v1alpha3/keptnevaluation_types.go | 2 +- .../lifecycle/v1alpha3/keptntask_types.go | 2 +- .../lifecycle/v1alpha3/keptnworkload_types.go | 8 +- .../pod_mutator/pod_mutating_webhook.go | 8 +- runtimes/deno-runtime/README.md | 8 +- runtimes/python-runtime/README.md | 6 +- scheduler/README.md | 6 +- 68 files changed, 422 insertions(+), 419 deletions(-) rename docs/content/en/docs/{intro-klt => intro}/_index.md (70%) rename docs/content/en/docs/{intro-klt => intro}/assets/dynatrace_dora_dashboard.png (100%) rename docs/content/en/docs/{intro-klt => intro}/usecase-observability.md (87%) rename docs/content/en/docs/{intro-klt => intro}/usecase-orchestrate.md (91%) rename docs/content/en/docs/{intro-klt => intro}/usecase_metrics.md (96%) diff --git a/README.md b/README.md index 3e0c80bdb85..cf2e5cb7bd4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Keptn Lifecycle Toolkit +# Keptn ![build](https://img.shields.io/github/actions/workflow/status/keptn/lifecycle-toolkit/CI.yaml?branch=main) ![Codecov](https://img.shields.io/codecov/c/github/keptn/lifecycle-toolkit?token=KPGfrBb2sA) @@ -7,18 +7,21 @@ [![GitHub Discussions](https://img.shields.io/github/discussions/keptn/lifecycle-toolkit)](https://github.com/keptn/lifecycle-toolkit/discussions) This is the primary repository for -the Keptn Lifecycle Toolkit (KLT) software and documentation. -KLT provides a “cloud-native” approach +the Keptn software and documentation. +Keptn provides a “cloud-native” approach for managing the application release lifecycle metrics, observability, health checks, with pre- and post-deployment evaluations and tasks. It is an incubating project, under the umbrella of the [Keptn Application Lifecycle working group](https://github.com/keptn/wg-app-lifecycle). +> **Note** Keptn was developed under the code name of + "Keptn Lifecycle Toolkit" or "KLT" for short. + The source code contains many vestiges of these names. + ## Goals -The Keptn Lifecycle Toolkit provides Cloud Native teams with -the following capabilities: +Keptn provides Cloud Native teams with the following capabilities: - Pre-requisite evaluation before deploying workloads and applications - Finding out when an application (not just a workload) is ready and working @@ -28,10 +31,10 @@ the following capabilities: ![Operator Maturity Model with third level circled in](./assets/operator-maturity.jpg) -The Keptn Lifecycle Toolkit can be seen as a general purpose and declarative +Keptn can be seen as a general purpose and declarative [Level 3 operator](https://operatorframework.io/operator-capabilities/) for your Application. -For this reason, the Keptn Lifecycle Toolkit is agnostic to deployment tools +For this reason, Keptn is agnostic to deployment tools that are used and works with any GitOps solution. ## Status @@ -61,13 +64,13 @@ The status follows the ## Installation -The Keptn Lifecycle Toolkit can be installed on any Kubernetes cluster +Keptn can be installed on any Kubernetes cluster running Kubernetes >=1.24. -Note that the Lifecycle Toolkit is not currently compatible with +Note that Keptn is not currently compatible with [vcluster](https://github.com/loft-sh/vcluster). Use the following command sequence -to install the latest release of the Keptn Lifecycle Toolkit: +to install the latest release of Keptn: ```shell helm repo add klt https://charts.lifecycle.keptn.sh @@ -80,32 +83,34 @@ helm upgrade --install keptn klt/klt -n keptn-lifecycle-toolkit-system --create- For more info about Keptn, please see our [documentation](https://lifecycle.keptn.sh/docs/), specifically: -- [Introduction to Keptn Lifecycle Toolkit](https://lifecycle.keptn.sh/docs/intro-klt/) - gives an overview of the KLT facilities. +- [Introduction to Keptn](https://lifecycle.keptn.sh/docs/intro/) + gives an overview of the Keptn facilities. - [Getting started](https://lifecycle.keptn.sh/docs/getting-started/) - includes some short exercises to introduce you to KLT. + includes some short exercises to introduce you to Keptn. - [Installation and upgrade](https://lifecycle.keptn.sh/docs/install/) provides information about preparing your Kubernetes cluster - then installing and enabling KLT. -- [Implementing KLT applications](https://lifecycle.keptn.sh/docs/implementing/) - documents how to integrate KLT to work with your existing deployment engine + then installing and enabling Keptn. +- [Implementing Keptn applications](https://lifecycle.keptn.sh/docs/implementing/) + documents how to integrate Keptn to work with your existing deployment engine and implement its variouos features. - [Architecture](https://lifecycle.keptn.sh/docs/concepts/architecture/) provides detailed technical information - about how KLT works. + about how Keptn works. - [CRD Reference](https://lifecycle.keptn.sh/docs/yaml-crd-ref/) and [API Reference](https://lifecycle.keptn.sh/docs/crd-ref/) provide detailed reference material for the custom resources - used to configure KLT. + used to configure Keptn. - [Contributing to Keptn](https://lifecycle.keptn.sh/contribute/) provides information about how to contribute to the Keptn project. You can also find a number of video presentations and demos -about the Keptn Lifecycle Toolkit on the +about Keptn on the [YouTube Keptn channel](https://www.youtube.com/@keptn). +Videos that refer to the "Keptn Lifecycle Controller" +are relevant for the Keptn project. ## Architecture -The Keptn Lifecycle Toolkit is composed of the following components: +Keptn is composed of the following components: - Keptn Lifecycle Operator - Keptn Scheduler @@ -132,11 +137,11 @@ After the Post-Deployment checks, SLOs can be validated using an interface for retrieving SLI data from a provider e.g, [Prometheus](https://prometheus.io/). -Finally, the Keptn Lifecycle Toolkit exposes Metrics and Traces +Finally, Keptn exposes Metrics and Traces of the entire Deployment cycle with [OpenTelemetry](https://opentelemetry.io/). -![KLT Architecture](./assets/architecture.png) +![Keptn Architecture](./assets/architecture.png) ### Webhook diff --git a/assets/logo/README.md b/assets/logo/README.md index 8f7da127c44..1da7992c6f8 100644 --- a/assets/logo/README.md +++ b/assets/logo/README.md @@ -1,6 +1,6 @@ -# Keptn Lifecycle Controller Logos +# Keptn Logos -This directory contains the Keptn Lifecycle Controller logos in different formats and colors. +This directory contains the Keptn logos in different formats and colors. ## Logos diff --git a/docs/content/en/contribute/_index.md b/docs/content/en/contribute/_index.md index 2819bd6ff6d..cc77f6dff9f 100644 --- a/docs/content/en/contribute/_index.md +++ b/docs/content/en/contribute/_index.md @@ -1,6 +1,6 @@ --- title: Contributing to Keptn -description: How to contribute to the Keptn projects +description: How to contribute to the Keptn project linktitle: Contributing weight: 400 menu: diff --git a/docs/content/en/contribute/docs/contrib-guidelines-docs/_index.md b/docs/content/en/contribute/docs/contrib-guidelines-docs/_index.md index 73659cacbc7..2ff534451b5 100644 --- a/docs/content/en/contribute/docs/contrib-guidelines-docs/_index.md +++ b/docs/content/en/contribute/docs/contrib-guidelines-docs/_index.md @@ -44,7 +44,7 @@ that are relevant only to documentation For usability considerations, we make the following exceptions: - * The main `README.md` file for the lifecycle-controller repository + * The main `README.md` file for the lifecycle-toolkit repository includes this basic information as well as a link to the full installation documentation which has more details. * The Getting Started Guide also includes this information diff --git a/docs/content/en/contribute/docs/source-file-structure/_index.md b/docs/content/en/contribute/docs/source-file-structure/_index.md index 4b26ff357c3..36a9a2cf8dc 100644 --- a/docs/content/en/contribute/docs/source-file-structure/_index.md +++ b/docs/content/en/contribute/docs/source-file-structure/_index.md @@ -4,7 +4,7 @@ description: Structure source files with Metadata weight: 400 --- -The source files for the KLT documentation +The source files for the Keptn documentation are stored in the same github repository as the source code. This page explains how the documentation source files are organized. @@ -23,26 +23,26 @@ the *docs/content/en/docs* directory in the repository. The subdirectories correspond to the contents listed in the right frame. In the order they appear in the rendered docs, the subdirectories are: -* **intro-klt** (Introduction to the Keptn Lifecycle Toolkit): - A brief overview of KLT, its features and use cases, and its history +* **intro** (Introduction to the Keptn Lifecycle Toolkit): + A brief overview of Keptn, its features and use cases, and its history * **getting-started** (Getting started): - A hands-on exercise that demonstrates the capabilities of KLT + A hands-on exercise that demonstrates the capabilities of Keptn * **tutorials** (Tutorials): - Additional hands-on exercises to introduce new users to KLT + Additional hands-on exercises to introduce new users to Keptn * **install** (Installation and Upgrade): - Requirements and instructions for installing and enabling KLT -* **operate** (Operate KLT): - Guides about running and managing the KLT cluster + Requirements and instructions for installing and enabling Keptn +* **operate** (Operate Keptn): + Guides about running and managing the Keptn cluster * **implementing** (Implementing Keptn applications): This is currently a catch-all section for guides and how-to material about implementing Keptn features. It needs to be restructured and subdivided * **troubleshooting.md** (Troubleshooting Guide): - How to diagnose and solve common problems with KLT + How to diagnose and solve common problems with Keptn * **architecture** (Architecture): - Information about how KLT actually works + Information about how Keptn actually works * **crd-ref** (API Reference): - Comprehensive information about all the APIs that define the KLT CRDs. + Comprehensive information about all the APIs that define the Keptn CRDs. This section is auto-generated from source code and should never be modified in the *docs* directory. The source for the authored text can be modified @@ -51,8 +51,8 @@ In the order they appear in the rendered docs, the subdirectories are: Reference pages for the CRs that users must populate. This is a subset of the CRDs documented in the *API Reference* section * **migrate** (Migrating to the Keptn Lifecycle Toolkit): - Information to help users who are migrating to KLT - from Keptn V1 + Information to help users who are migrating to Keptn + from Keptn v1 ## Contributing guide @@ -131,7 +131,7 @@ The system for assigning weights for the docs landing page allows for maximum flexibility as we create new sections: * General introductory material uses weight values under 100. -* Guide material about using specific KLT features +* Guide material about using specific Keptn features use weight value of 2**. * Reference material uses weight values of 5**. * Other documents use weight values of 7**. diff --git a/docs/content/en/contribute/general/contrib-guidelines-gen/_index.md b/docs/content/en/contribute/general/contrib-guidelines-gen/_index.md index ca4aa2dec9b..27b611a44ad 100644 --- a/docs/content/en/contribute/general/contrib-guidelines-gen/_index.md +++ b/docs/content/en/contribute/general/contrib-guidelines-gen/_index.md @@ -1,11 +1,11 @@ --- title: Contribution Guidelines -description: Guidelines for contributing to Keptn Lifecycle Toolkit -weight: 50 +description: Guidelines for contributing towards Keptn +weight: 300 --- -Before using the **Keptn Lifecycle Toolkit** -as a contributor to the Keptn Lifecycle Toolkit repository, +Before using Keptn +as a contributor to the Keptn `lifecycle-toolkit` repository, it is expected that you comply with the guidelines while making contributions towards the repository. diff --git a/docs/content/en/contribute/general/git/pr-create/_index.md b/docs/content/en/contribute/general/git/pr-create/_index.md index 75e6a9dee7f..2817b740ca4 100644 --- a/docs/content/en/contribute/general/git/pr-create/_index.md +++ b/docs/content/en/contribute/general/git/pr-create/_index.md @@ -25,7 +25,7 @@ to the repository are: 1. Switch back to the `main` branch in your repository, and ensure that it is up to date - with the `main` branch of the Keptn Lifecycle Toolkit: + with the `main` Keptn branch: ```bash git remote add upstream https://github.com/keptn/lifecycle-toolkit.git diff --git a/docs/content/en/contribute/general/technologies/_index.md b/docs/content/en/contribute/general/technologies/_index.md index b9cafb4b65f..2b3f2dca0f8 100644 --- a/docs/content/en/contribute/general/technologies/_index.md +++ b/docs/content/en/contribute/general/technologies/_index.md @@ -1,13 +1,13 @@ --- title: Technologies to get familiar -description: Technologies to get familiar before working with Keptn lifecycle toolkit +description: Technologies to get familiar before working with Keptn weight: 100 --- ### Related Technologies You should understand some related technologies -to effectively use and contribute to the Keptn lifecycle-toolkit. +to effectively use and contribute to Keptn. This section provides links to some materials that can help your learning. The information has been gathered from the community and is subject to alteration. If you have suggestions about additional content that should be included in this list, diff --git a/docs/content/en/docs/concepts/architecture/_index.md b/docs/content/en/docs/concepts/architecture/_index.md index eb2b6a46484..6a3f768dce7 100644 --- a/docs/content/en/docs/concepts/architecture/_index.md +++ b/docs/content/en/docs/concepts/architecture/_index.md @@ -1,9 +1,9 @@ --- title: Architecture linktitle: Architecture -description: Understand the details of how Keptn Lifecycle Toolkit works +description: Understand the details of how Keptn works weight: 80 cascade: --- -### Keptn Lifecycle Toolkit Components +### Keptn Components diff --git a/docs/content/en/docs/concepts/architecture/cert-manager.md b/docs/content/en/docs/concepts/architecture/cert-manager.md index 22772f339d9..db7f653bd54 100644 --- a/docs/content/en/docs/concepts/architecture/cert-manager.md +++ b/docs/content/en/docs/concepts/architecture/cert-manager.md @@ -14,7 +14,7 @@ You can instead [configure your own certificate manager](https://lifecycle.keptn.sh/docs/install/cert-manager/) for this purpose. -The Lifecycle Toolkit includes a Mutating Webhook +Keptn includes a Mutating Webhook that requires TLS certificates to be mounted as a volume in its pod. In version 0.6.0 and later, the certificate creation is handled automatically by @@ -28,15 +28,15 @@ with a renewal threshold of 12 hours. * If the certificate expires, the [klt-cert-manager](https://github.com/keptn/lifecycle-toolkit/blob/main/klt-cert-manager/README.md) renews it. -* The Lifecycle Toolkit operator waits for a valid certificate to be ready. +* The Keptn `lifecycle-operator` waits for a valid certificate to be ready. * When the certificate is ready, it is mounted on an empty dir volume in the operator. `klt-cert-manager` is a customized certificate manager -that is installed with the Lifecycle Toolkit by default. +that is installed with Keptn by default. It is included to simplify installation for new users and because it is much smaller than most standard certificate managers. -However, KLT is compatible with most certificate managers +However, Keptn is compatible with most certificate managers and can be configured to use another certificate manager if you prefer. See [Use Keptn with cert-manager.io](../../operate/cert-manager.md) for instructions. @@ -48,7 +48,7 @@ the webhook or the operator may generate errors because of an invalid certificate. To solve this, delete the certificate and restart the operator. -The KLT cert-manager certificate is stored as a secret in the `klt` namespace. +The Keptn cert-manager certificate is stored as a secret in the `klt` namespace. To retrieve it: ```shell @@ -62,8 +62,8 @@ NAME TYPE DATA AGE klt-certs Opaque 5 4d23h ``` -Specify the `NAME` of the KLT certificate (`klt-certs` in this case) -to delete the KLT certificate: +Specify the `NAME` of the Keptn certificate (`klt-certs` in this case) +to delete the Keptn certificate: ```shell kubectl delete secret klt-certs -n keptn-lifecycle-toolkit-system diff --git a/docs/content/en/docs/concepts/architecture/components/_index.md b/docs/content/en/docs/concepts/architecture/components/_index.md index 89afb27d3a8..16f7161b7c9 100644 --- a/docs/content/en/docs/concepts/architecture/components/_index.md +++ b/docs/content/en/docs/concepts/architecture/components/_index.md @@ -1,14 +1,14 @@ --- -title: Lifecycle Toolkit Components +title: Keptn Components linktitle: Components -description: Basic understanding of Keptn Lifecycle Toolkit Components +description: Basic understanding of Keptn Components weight: 20 cascade: --- -### Keptn Lifecycle Toolkit Components +### Keptn Components -The Keptn Lifecycle Toolkit consists of two main components: +Keptn consists of two main components: * Keptn Lifecycle Operator, which splits into two separate operators in Release 0.7.0 and later: @@ -18,11 +18,11 @@ in Release 0.7.0 and later: ```mermaid graph TD; - KLTComponents-->Operators; - KLTComponents-->Scheduler + KeptnComponents-->Operators; + KeptnComponents-->Scheduler Operators-->Lifecycle-Operator Operators-->Metrics-Operator -style KLTComponents fill:#006bb8,stroke:#fff,stroke-width:px,color:#fff +style KeptnComponents fill:#006bb8,stroke:#fff,stroke-width:px,color:#fff style Operators fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8 style Scheduler fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8 style Lifecycle-Operator fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8 diff --git a/docs/content/en/docs/concepts/architecture/components/lifecycle-operator/_index.md b/docs/content/en/docs/concepts/architecture/components/lifecycle-operator/_index.md index e064671db57..07c26f10d47 100644 --- a/docs/content/en/docs/concepts/architecture/components/lifecycle-operator/_index.md +++ b/docs/content/en/docs/concepts/architecture/components/lifecycle-operator/_index.md @@ -1,7 +1,7 @@ --- title: Keptn Lifecycle Operator linktitle: Lifecycle Operator -description: Basic understanding of Keptn's Lifecycle Operator +description: Basic understanding of the Keptn Lifecycle Operator weight: 80 cascade: --- @@ -10,7 +10,7 @@ cascade: **Keptn's Lifecycle Operator** is a Kubernetes [operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) that automates the deployment and management -of the Keptn Lifecycle Controller components in a Kubernetes cluster. +of the Keptn components in a Kubernetes cluster. The Keptn Lifecycle Operator contains several controllers for **Keptn CRDs** and a **Mutating Webhook**. diff --git a/docs/content/en/docs/concepts/architecture/components/scheduler/_index.md b/docs/content/en/docs/concepts/architecture/components/scheduler/_index.md index 6fb6d7bf9a0..c7928b9f4f1 100644 --- a/docs/content/en/docs/concepts/architecture/components/scheduler/_index.md +++ b/docs/content/en/docs/concepts/architecture/components/scheduler/_index.md @@ -1,12 +1,12 @@ --- title: Keptn Lifecycle Scheduler linktitle: Scheduler -description: Basic understanding of Keptn's Lifecycle Scheduler +description: Basic understanding of the Keptn Scheduler weight: 80 cascade: --- -The **Keptn Scheduler** is an integral component of the Keptn Lifecycle Toolkit that orchestrates +The **Keptn Scheduler** is an integral component of Keptn that orchestrates the deployment process. The **Keptn Scheduler** works by registering itself as a Permit plugin within the Kubernetes scheduling cycle that ensures that Pods are scheduled to a node until and unless the diff --git a/docs/content/en/docs/concepts/architecture/deployment-flow.md b/docs/content/en/docs/concepts/architecture/deployment-flow.md index 4fbe7753f93..841df8331a7 100644 --- a/docs/content/en/docs/concepts/architecture/deployment-flow.md +++ b/docs/content/en/docs/concepts/architecture/deployment-flow.md @@ -5,7 +5,7 @@ description: Understand the execution flow of a deployment weight: 35 --- -The Keptn Lifecycle Toolkit (KLT) deploys a +Keptn deploys a [Kubernetes Workload](https://kubernetes.io/docs/concepts/workloads/) by passing through a well-defined execution flow. @@ -34,7 +34,7 @@ and [CloudEvents](https://cloudevents.io/) are emitted at each phase to provide additional Observability of the execution flow. -The Keptn Lifecycle Toolkit implements a +Keptn implements a [Permit Scheduler Plugin](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/#permit) that blocks the binding of the pods to a node until all the pre-conditions are fulfilled. @@ -48,9 +48,9 @@ or can be started by the following command: kubectl apply -f deployment.yaml ``` -KLT does not care how a deployment manifest is applied to the cluster. +Keptn does not care how a deployment manifest is applied to the cluster. Both `kubectl` and Flux/Argo send the manifest to the Kubernetes API -so KLT does not differentiate the actual deployment options. +so Keptn does not differentiate the actual deployment options. This also means that one Keptn Application can include services that are deployed with different methods. @@ -171,7 +171,7 @@ such as those that describe what happens when something fails. Whenever something in the system happens (we create a new resource, etc.) a Kubernetes event is generated. -The following events are defined as part of the Keptn Lifecycle Toolkit +The following events are defined as part of Keptn but they are not part of the deployment flow. These include: diff --git a/docs/content/en/docs/concepts/architecture/keptn-apps/_index.md b/docs/content/en/docs/concepts/architecture/keptn-apps/_index.md index 69741216fef..1c15e3045f6 100644 --- a/docs/content/en/docs/concepts/architecture/keptn-apps/_index.md +++ b/docs/content/en/docs/concepts/architecture/keptn-apps/_index.md @@ -68,14 +68,14 @@ for the `KeptnApp` resource itself: [Basic annotations](../../../implementing/integrate/#basic-annotations) are used to automatically generate `KeptnApp` resources that contain the identifications required - to run the KLT observability features. + to run the Keptn observability features. * You must manually add the annotations described in [Pre- and post-deployment checks](../../../implementing/integrate/#pre--and-post-deployment-checks) to the basic `KeptnApp` manifest to define the evaluations and tasks you want to run pre- and post-deployment. The `KeptnApp` resources that are generated automatically -contain the identifications required to run the KLT observability features. +contain the identifications required to run the Keptn observability features. The `spec.workloads.name` and a `spec.workloads.version` fields that define evaluations and tasks to be run pre- and post-deployment are not generated automatically @@ -94,7 +94,7 @@ resource. The [Basic annotations](../../../implementing/integrate/#basic-annotations) page gives instructions for applying the annotations or labels -that identify the pods that KLT should manage. +that identify the pods that Keptn should manage. Three `keptn.sh` and three `app.kubernetes.io` keys are recognized. They are equivalent; you can use either of them @@ -108,7 +108,7 @@ In other words: * If neither is the case, it looks for the `app.kubernetes.io/` equivalent, again first in the annotations, then in the labels. -KLT automatically generates appropriate +Keptn automatically generates appropriate [KeptnApp](../../../yaml-crd-ref/app.md) resources that are used for observability, based on whether the `keptn.sh/app` or `app.kubernetes.io/part-of` @@ -117,7 +117,7 @@ resource for each defined group. that together constitute a single deployable Keptn Application. * If either of these labels/annotations are populated, - KLT automatically generates a `KeptnApp` resource + Keptn automatically generates a `KeptnApp` resource that includes all workloads that have the same annotation/label, thus creating a `KeptnApp` resource for each defined grouping diff --git a/docs/content/en/docs/concepts/architecture/working/_index.md b/docs/content/en/docs/concepts/architecture/working/_index.md index f7411eba1e1..d1df06f13e2 100644 --- a/docs/content/en/docs/concepts/architecture/working/_index.md +++ b/docs/content/en/docs/concepts/architecture/working/_index.md @@ -1,9 +1,9 @@ --- -title: Lifecycle Toolkit Working -linktitle: How it works -description: Understand How Keptn Lifecycle Toolkit Works +title: How Keptn works +linktitle: How Keptn works +description: Understand How Keptn Works weight: 30 cascade: --- -### How Keptn Lifecycle Toolkit Works? +### How does Keptn Work? diff --git a/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md b/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md index 7587d7c60c6..d7b00afdb5b 100644 --- a/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md +++ b/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md @@ -273,10 +273,10 @@ _Appears in:_ | `version` _string_ | Version defines the version of the application. For automatically created KeptnApps, the version is a function of all KeptnWorkloads that are part of the KeptnApp. | | `revision` _integer_ | Revision can be modified to trigger another deployment of a KeptnApp of the same version. This can be used for restarting a KeptnApp which failed to deploy, e.g. due to a failed preDeploymentEvaluation/preDeploymentTask. | | `workloads` _[KeptnWorkloadRef](#keptnworkloadref) array_ | Workloads is a list of all KeptnWorkloads that are part of the KeptnApp. | -| `preDeploymentTasks` _string array_ | PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | -| `postDeploymentTasks` _string array_ | PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | -| `preDeploymentEvaluations` _string array_ | PreDeploymentEvaluations is a list of all evaluations to be performed during the pre-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | -| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | +| `preDeploymentTasks` _string array_ | PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | +| `postDeploymentTasks` _string array_ | PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | +| `preDeploymentEvaluations` _string array_ | PreDeploymentEvaluations is a list of all evaluations to be performed during the pre-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | +| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | #### KeptnAppStatus @@ -341,10 +341,10 @@ _Appears in:_ | `version` _string_ | Version defines the version of the application. For automatically created KeptnApps, the version is a function of all KeptnWorkloads that are part of the KeptnApp. | | `revision` _integer_ | Revision can be modified to trigger another deployment of a KeptnApp of the same version. This can be used for restarting a KeptnApp which failed to deploy, e.g. due to a failed preDeploymentEvaluation/preDeploymentTask. | | `workloads` _[KeptnWorkloadRef](#keptnworkloadref) array_ | Workloads is a list of all KeptnWorkloads that are part of the KeptnApp. | -| `preDeploymentTasks` _string array_ | PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | -| `postDeploymentTasks` _string array_ | PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | -| `preDeploymentEvaluations` _string array_ | PreDeploymentEvaluations is a list of all evaluations to be performed during the pre-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | -| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | +| `preDeploymentTasks` _string array_ | PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | +| `postDeploymentTasks` _string array_ | PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | +| `preDeploymentEvaluations` _string array_ | PreDeploymentEvaluations is a list of all evaluations to be performed during the pre-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | +| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnApp. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | | `appName` _string_ | AppName is the name of the KeptnApp. | | `previousVersion` _string_ | PreviousVersion is the version of the KeptnApp that has been deployed prior to this version. | | `traceId` _object (keys:string, values:string)_ | TraceId contains the OpenTelemetry trace ID. | @@ -524,7 +524,7 @@ _Appears in:_ | `workloadVersion` _string_ | WorkloadVersion defines the version of the KeptnWorkload for which the KeptnEvaluation is done. | | `appName` _string_ | AppName defines the KeptnApp for which the KeptnEvaluation is done. | | `appVersion` _string_ | AppVersion defines the version of the KeptnApp for which the KeptnEvaluation is done. | -| `evaluationDefinition` _string_ | EvaluationDefinition refers to the name of the KeptnEvaluationDefinition which includes the objectives for the KeptnEvaluation. The KeptnEvaluationDefinition can be located in the same namespace as the KeptnEvaluation, or in the KLT namespace. | +| `evaluationDefinition` _string_ | EvaluationDefinition refers to the name of the KeptnEvaluationDefinition which includes the objectives for the KeptnEvaluation. The KeptnEvaluationDefinition can be located in the same namespace as the KeptnEvaluation, or in the Keptn namespace. | | `retries` _integer_ | Retries indicates how many times the KeptnEvaluation can be attempted in the case of an error or missed evaluation objective, before considering the KeptnEvaluation to be failed. | | `retryInterval` _[Duration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#duration-v1-meta)_ | RetryInterval specifies the interval at which the KeptnEvaluation is retried in the case of an error or a missed objective. | | `failAction` _string_ | | @@ -676,7 +676,7 @@ _Appears in:_ | Field | Description | | --- | --- | -| `taskDefinition` _string_ | TaskDefinition refers to the name of the KeptnTaskDefinition which includes the specification for the task to be performed. The KeptnTaskDefinition can be located in the same namespace as the KeptnTask, or in the KLT namespace. | +| `taskDefinition` _string_ | TaskDefinition refers to the name of the KeptnTaskDefinition which includes the specification for the task to be performed. The KeptnTaskDefinition can be located in the same namespace as the KeptnTask, or in the Keptn namespace. | | `context` _[TaskContext](#taskcontext)_ | Context contains contextual information about the task execution. | | `parameters` _[TaskParameters](#taskparameters)_ | Parameters contains parameters that will be passed to the job that executes the task. | | `secureParameters` _[SecureParameters](#secureparameters)_ | SecureParameters contains secure parameters that will be passed to the job that executes the task. These will be stored and accessed as secrets in the cluster. | @@ -769,10 +769,10 @@ _Appears in:_ | --- | --- | | `app` _string_ | AppName is the name of the KeptnApp containing the KeptnWorkload. | | `version` _string_ | Version defines the version of the KeptnWorkload. | -| `preDeploymentTasks` _string array_ | PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | -| `postDeploymentTasks` _string array_ | PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnWorkload, or in the KLT namespace. | -| `preDeploymentEvaluations` _string array_ | PreDeploymentEvaluations is a list of all evaluations to be performed during the pre-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the KLT namespace. | -| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the KLT namespace. | +| `preDeploymentTasks` _string array_ | PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | +| `postDeploymentTasks` _string array_ | PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnWorkload, or in the Keptn namespace. | +| `preDeploymentEvaluations` _string array_ | PreDeploymentEvaluations is a list of all evaluations to be performed during the pre-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the Keptn namespace. | +| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the Keptn namespace. | | `resourceReference` _[ResourceReference](#resourcereference)_ | ResourceReference is a reference to the Kubernetes resource (Deployment, DaemonSet, StatefulSet or ReplicaSet) the KeptnWorkload is representing. | | `workloadName` _string_ | WorkloadName is the name of the KeptnWorkload. | | `previousVersion` _string_ | PreviousVersion is the version of the KeptnWorkload that has been deployed prior to this version. | @@ -853,10 +853,10 @@ _Appears in:_ | --- | --- | | `app` _string_ | AppName is the name of the KeptnApp containing the KeptnWorkload. | | `version` _string_ | Version defines the version of the KeptnWorkload. | -| `preDeploymentTasks` _string array_ | PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the KLT namespace. | -| `postDeploymentTasks` _string array_ | PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnWorkload, or in the KLT namespace. | -| `preDeploymentEvaluations` _string array_ | PreDeploymentEvaluations is a list of all evaluations to be performed during the pre-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the KLT namespace. | -| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the KLT namespace. | +| `preDeploymentTasks` _string array_ | PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnApp, or in the Keptn namespace. | +| `postDeploymentTasks` _string array_ | PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnTaskDefinitions located in the same namespace as the KeptnWorkload, or in the Keptn namespace. | +| `preDeploymentEvaluations` _string array_ | PreDeploymentEvaluations is a list of all evaluations to be performed during the pre-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the Keptn namespace. | +| `postDeploymentEvaluations` _string array_ | PostDeploymentEvaluations is a list of all evaluations to be performed during the post-deployment phase of the KeptnWorkload. The items of this list refer to the names of KeptnEvaluationDefinitions located in the same namespace as the KeptnWorkload, or in the Keptn namespace. | | `resourceReference` _[ResourceReference](#resourcereference)_ | ResourceReference is a reference to the Kubernetes resource (Deployment, DaemonSet, StatefulSet or ReplicaSet) the KeptnWorkload is representing. | diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md index f982b8dcf27..968d815f1c4 100644 --- a/docs/content/en/docs/getting-started/_index.md +++ b/docs/content/en/docs/getting-started/_index.md @@ -1,11 +1,11 @@ --- -title: Getting started with KLT -description: Get started with the Keptn Lifecycle Toolkit +title: Getting started with Keptn +description: Get started with Keptn weight: 10 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -Keptn Lifecycle Toolkit works whether or not you use a GitOps strategy. +Keptn works whether or not you use a GitOps strategy. The following is an imperative walkthrough. ## Prerequisites @@ -18,8 +18,8 @@ The following is an imperative walkthrough. ## Objectives -- Install Keptn Lifecycle Toolkit on your cluster -- Annotate a namespace and deployment to enable Keptn Lifecycle Toolkit +- Install Keptn on your cluster +- Annotate a namespace and deployment to enable Keptn - Install Grafana and Observability tooling to view DORA metrics and OpenTelemetry traces ## System Overview @@ -45,9 +45,9 @@ Keptn will monitor the deployment and generate: Notice though that the metrics and traces have nowhere to go. That will be fixed in a subsequent step. -## Step 1: Install Keptn Lifecycle Toolkit +## Step 1: Install Keptn -Install the Keptn Lifecycle Toolkit using Helm: +Install Keptn using Helm: ```shell helm repo add klt https://charts.lifecycle.keptn.sh @@ -74,7 +74,7 @@ spec: keptnAppCreationRequestTimeoutSeconds: 30 ``` -Apply the file and restart KLT to pick up the new config: +Apply the file and restart Keptn to pick up the new config: ```shell kubectl apply -f collectorconfig.yaml @@ -87,7 +87,7 @@ kubectl rollout status deployment -n keptn-lifecycle-toolkit-system -l component ## Step 2: Create Namespace for Demo Application Save this file as `namespace.yaml`. -The annotation means that Keptn Lifecycle Toolkit is active for workloads in this namespace. +The annotation means that Keptn is active for workloads in this namespace. ```yaml apiVersion: v1 @@ -165,7 +165,7 @@ Keptn looks for these 3 labels: - `app.kubernetes.io/version` These are [Kubernetes recommended labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels) -but if you want to use different labels, you can swap them for these KLT specific labels: +but if you want to use different labels, you can swap them for these Keptn specific labels: - `keptn.sh/app` instead of `app.kubernetes.io/part-of` - `keptn.sh/workload` instead of `app.kubernetes.io/name` @@ -474,7 +474,7 @@ View the Keptn Applications Dashboard and you should see the DORA metrics and an ## Step 14: More control over KeptnApp -You may have noticed that the `KeptnApp` Custom Resources are created automatically by KLT. +You may have noticed that the `KeptnApp` Custom Resources are created automatically by Keptn. The lifecycle toolkit automatically groups workloads into `KeptnApp`s by looking for matching `app.kubernetes.io/part-of` annotations. diff --git a/docs/content/en/docs/implementing/_index.md b/docs/content/en/docs/implementing/_index.md index 5a3cb3c28c4..19f62e8354c 100644 --- a/docs/content/en/docs/implementing/_index.md +++ b/docs/content/en/docs/implementing/_index.md @@ -1,6 +1,6 @@ --- title: Implementing Keptn applications -description: Learn how to implement your KLT application +description: Learn how to implement your Keptn application layout: quickstart weight: 40 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html diff --git a/docs/content/en/docs/implementing/add-app-awareness/index.md b/docs/content/en/docs/implementing/add-app-awareness/index.md index 63c16377b15..e6c88048ffc 100644 --- a/docs/content/en/docs/implementing/add-app-awareness/index.md +++ b/docs/content/en/docs/implementing/add-app-awareness/index.md @@ -1,11 +1,13 @@ # Add Application Awareness -In the previous step, we installed the demo application without any application awareness. -This means that the Lifecycle -Toolkit assumed that every workload is a single-service application at the moment and created the Application resources -for you. - -To get the overall state of an application, we need a grouping of workloads, called KeptnApp in the Lifecycle Toolkit. +In the previous step, we installed the demo application +without any application awareness. +This means that Keptn assumed +that every workload is a single-service application at the moment +and created the Application resources for you. + +To get the overall state of an application, +we need a grouping of workloads, called KeptnApp. To get this working, we need to modify our application manifest with two things: * Add an "app.kubernetes.io/part-of" or "keptn.sh/app" label to the deployment diff --git a/docs/content/en/docs/implementing/dora/_index.md b/docs/content/en/docs/implementing/dora/_index.md index db4c831ac41..285a9d2063d 100644 --- a/docs/content/en/docs/implementing/dora/_index.md +++ b/docs/content/en/docs/implementing/dora/_index.md @@ -5,7 +5,7 @@ weight: 65 --- DORA metrics are an industry-standard set of measurements -that are included in the Keptn Lifecycle Toolkit. +that are included in Keptn; see the following for a description: - [What are DORA Metrics and Why Do They Matter?](https://codeclimate.com/blog/dora-metrics) @@ -19,7 +19,7 @@ DORA metrics provide information such as: - Deployment time between versions - Average time between versions. -The Keptn Lifecycle Toolkit starts collecting these metrics +Keptn starts collecting these metrics as soon as you apply [basic annotations](../integrate/#basic-annotations) to the diff --git a/docs/content/en/docs/implementing/evaluatemetrics.md b/docs/content/en/docs/implementing/evaluatemetrics.md index 2e39f7cafb3..5d5723cc192 100644 --- a/docs/content/en/docs/implementing/evaluatemetrics.md +++ b/docs/content/en/docs/implementing/evaluatemetrics.md @@ -16,7 +16,7 @@ or another standard dashboard application that you configure or can be retrieved using standard Kubernetes commands. For an introduction to Keptn metrics, see -[Getting started with Keptn metrics](../intro-klt/usecase_metrics.md). +[Getting started with Keptn metrics](../intro/usecase_metrics.md). ## Keptn metric basics @@ -46,18 +46,18 @@ Note the following: in a centralized namespace such as `keptn-lifecycle-toolkit-system`. -To configure a data provider into your KLT cluster: +To configure a data provider into your Keptn cluster: 1. Create a secret if your data provider uses one. See [Create secret text](../implementing/tasks/#create-secret-text). 1. Install and configure each instance of each data provider - into your KLT cluster, + into your Keptn cluster, following the instructions provided by the data source provider. See - [Prepare your cluster for KLT](../install/k8s.md/#prepare-your-cluster-for-klt) + [Prepare your cluster for Keptn](../install/k8s.md/#prepare-your-cluster-for-keptn) for links. - KLT supports using multiple instances of multiple data providers. + Keptn supports using multiple instances of multiple data providers. 1. Define a [KeptnMetricsProvider](../yaml-crd-ref/metricsprovider.md) resource for each data source. diff --git a/docs/content/en/docs/implementing/integrate/_index.md b/docs/content/en/docs/implementing/integrate/_index.md index a78dd06579d..9068cb3bd2e 100644 --- a/docs/content/en/docs/implementing/integrate/_index.md +++ b/docs/content/en/docs/implementing/integrate/_index.md @@ -1,40 +1,40 @@ --- -title: Integrate KLT with your applications -description: How to integrate the Keptn Lifecycle Toolkit into your Kubernetes cluster +title: Integrate Keptn with your applications +description: How to integrate Keptn into your Kubernetes cluster layout: quickstart weight: 45 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -The Keptn Lifecycle Toolkit works +Keptn works on top of the default scheduler for the cluster, so it can trace all activities of all deployment workloads on the cluster, no matter what tool is used for the deployment. -This same mechanism allows KLT to inject pre- and post-deployment checks +This same mechanism allows Keptn to inject pre- and post-deployment checks into all deployment workloads. -KLT monitors resources +Keptn monitors resources that have been applied into the Kubernetes cluster and reacts if it finds a workload with special annotations/labels. -The Keptn Lifecycle Toolkit uses metadata +Keptn uses metadata that is added to the Kubernetes workloads to identify the workloads of interest. -To integrate KLT with your applications: +To integrate Keptn with your applications: * You must first [install](../../install/install.md) and -[enable](../../install/install.md//#enable-klt-for-your-cluster) -KLT. +[enable](../../install/install.md//#enable-keptn-for-your-cluster) +Keptn. * Annotate or label your workloads with either Keptn or Kubernetes keys. * [Basic annotations](#basic-annotations) or labels - are required for all KLT features except Keptn metrics. + are required for all Keptn features except Keptn metrics. * [Pre- and post-deployment checks](#basic-annotations) are required only for the Release lifecycle management feature. -KLT uses these annotations to the Kubernetes workloads to create the +Keptn uses these annotations to the Kubernetes workloads to create the [KeptnWorkload](../../crd-ref/lifecycle/v1alpha3/#keptnworkload) and [KeptnApp](../../yaml-crd-ref/app.md) @@ -42,26 +42,26 @@ resources that it uses to provide observability and release lifecycle management. > Note: Annotations are not required if you are only using the - `metrics-operator` component of KLT + `metrics-operator` component of Keptn to observe Keptn metrics. ## Basic annotations -The Keptn Lifecycle Toolkit automatically discovers `KeptnApp` resources, +Keptn automatically discovers `KeptnApp` resources, based on the annotations or labels. -This enables the KLT observability features +This enables the Keptn observability features (based on OpenTelemetry) for existing applications, without additional Keptn configuration. -KLT monitors your +Keptn monitors your [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/), [StatefulSets](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/), and [ReplicaSets](https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/), and [DaemonSets](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/) -resources in the namespaces where KLT is enabled. -If KLT finds any of these resources and the resource has either +resources in the namespaces where Keptn is enabled. +If Keptn finds any of these resources and the resource has either the `keptn.sh` or the `kubernetes` annotations/labels, it creates appropriate [KeptnWorkload](../../crd-ref/lifecycle/v1alpha3/#keptnworkload) @@ -98,28 +98,28 @@ These keys are defined as: that represents the Workload. If the Workload has no `version` annotation/labels and the pod has only one container, - the Lifecycle Toolkit takes the image tag as version + Keptn takes the image tag as version (unless it is "latest"). * `keptn.sh/app` or `app.kubernetes.io/part-of`: Determines the name of the generated `KeptnApp` representing your Application. All Workloads that share the same value for this label are consolidated into the same `KeptnApp` resource. -KLT automatically generates appropriate +Keptn automatically generates appropriate [KeptnApp](../../yaml-crd-ref/app.md) resources that are used for observability, based on whether the `keptn.sh/app` or `app.kubernetes.io/part-of` annotation/label is populated: * If either of these annotations/labels are populated, - KLT automatically generates a `KeptnApp` resource + Keptn automatically generates a `KeptnApp` resource that includes all workloads that have the same annotation/label, thus creating a `KeptnApp` resource for each defined grouping * If only the `workload` and `version` annotations/labels are available (in other words, neither the `keptn.sh/app` or `app.kubernetes.io/part-of` annotation/label is populated), - KLT creates a `KeptnApp` resource for each `KeptnWorkload` + Keptn creates a `KeptnApp` resource for each `KeptnWorkload` and your observability output traces the individual `Keptnworkload` resources but not the combined workloads that constitute your deployed application. @@ -162,7 +162,7 @@ In other words: again first in the annotations, then in the labels. In general, annotations are more appropriate than labels -for integrating KLT with your applications +for integrating Keptn with your applications because they store references, names, and version information so the 63 char limitation is quite restrictive. However, labels can be used if you specifically need them @@ -248,7 +248,7 @@ a Slack notification is sent with the result of the deployment The automatically generated `KeptnApp` file aggregates the workloads to include in the application, based on annotations made to the workloads themselves. -This enables you to run KLT observability features on your cluster. +This enables you to run Keptn observability features on your cluster. Afterward, you can monitor the status of the deployment using a command like the following: @@ -275,10 +275,10 @@ but this is not required for observability. As an example, consider the following application, consisting of multiple deployments, -which is going to be deployed into a KLT-enabled namespace. +which is going to be deployed into a Keptn-enabled namespace. Note that: -1. KLT is enabled for the namespace where your application runs. +1. Keptn is enabled for the namespace where your application runs. 1. The `Deployment` workloads are annotated appropriately. This example does not use other workloads. @@ -350,7 +350,7 @@ spec: With the `KeptnApp` resource created, you get observability of your application's deployments by using the OpenTelemetry tracing features -that are provided by the Keptn Lifecycle Toolkit: +that are provided by Keptn: ![Application deployment trace](assets/trace.png) diff --git a/docs/content/en/docs/implementing/otel.md b/docs/content/en/docs/implementing/otel.md index be2808f167a..b1e0675ad15 100644 --- a/docs/content/en/docs/implementing/otel.md +++ b/docs/content/en/docs/implementing/otel.md @@ -5,7 +5,7 @@ weight: 140 --- -The Keptn Lifecycle Toolkit (KLT) makes any Kubernetes deployment observable. +Keptn makes any Kubernetes deployment observable. In other words, it creates a distributed, end-to-end trace of what Kubernetes does in the context of a Deployment. To do this, @@ -18,12 +18,12 @@ This means that: - You can readily see why a deployment takes so long or why it fails, even when using multiple deployment strategies. -- KLT can capture DORA metrics and expose them as OpenTelemetry metrics +- Keptn can capture DORA metrics and expose them as OpenTelemetry metrics The observability data is an amalgamation of the following: - DORA metrics are collected out of the box - when the Lifecycle Toolkit is enabled + when Keptn is enabled - OpenTelemetry runs traces that show everything that happens in the Kubernetes cluster - Custom Keptn metrics that you can use to monitor @@ -33,7 +33,7 @@ All this information can be displayed with dashboard tools such as Grafana. For an introduction to using OpenTelemetry with Keptn metrics, see the -[Standardize observability](../intro-klt/usecase-observability.md) +[Standardize observability](../intro/usecase-observability.md) getting started guide. ## DORA metrics @@ -52,7 +52,7 @@ DORA metrics provide information such as: - Deployment time between versions - Average time between versions. -The Keptn Lifecycle Toolkit starts collecting these metrics +Keptn starts collecting these metrics as soon as you apply [basic annotations](integrate/#basic-annotations) to the Workload resource. @@ -86,7 +86,7 @@ or whatever dashboard application you choose. ### Requirements for OpenTelemetry -To access OpenTelemetry metrics with the Keptn Lifecycle Toolkit, +To access OpenTelemetry metrics with Keptn, you must have the following on your cluster: - An OpenTelemetry collector. @@ -113,7 +113,7 @@ you need: [Jaeger Setup](https://github.com/jaegertracing/jaeger-operator#getting-started). To install Prometheus into the `monitoring` namespace, -using the default configuration included with KLT, +using the default configuration included with Keptn, use the following commands. Use similar commands if you define a different configuration:: @@ -123,14 +123,14 @@ kubectl apply --server-side -f config/prometheus/setup kubectl apply -f config/prometheus/ ``` -### Integrate OpenTelemetry into the Keptn Lifecycle Toolkit +### Integrate OpenTelemetry into Keptn -To integrate OpenTelemetry into the Keptn Lifecycle Toolkit: +To integrate OpenTelemetry into Keptn: - Apply [basic annotations](../implementing/integrate/#basic-annotations) for your `Deployment` resource - to integrate the Lifecycle Toolkit into your Kubernetes cluster. + to integrate Keptn into your Kubernetes cluster. - To expose OpenTelemetry metrics, define a [KeptnConfig](../yaml-crd-ref/config.md) resource that has the `spec.OTelCollectorUrl` field populated @@ -177,14 +177,14 @@ kubectl rollout restart deployment \ -n keptn-lifecycle-toolkit-system keptn-scheduler lifecycle-operator ``` -KLT begins to collect OpenTelemetry metrics +Keptn begins to collect OpenTelemetry metrics as soon as the `Deployment` resource -has the basic annotations to integrate KLT in the cluster. +has the basic annotations to integrate Keptn in the cluster. ## Access Keptn metrics as OpenTelemetry metrics Keptn metrics can be exposed as OpenTelemetry (OTel) metrics -via port `9999` of the KLT metrics-operator. +via port `9999` of the Keptn metrics-operator. To access the metrics, use the following command: diff --git a/docs/content/en/docs/install/_index.md b/docs/content/en/docs/install/_index.md index d0b740dadc4..6a2fc2c5223 100644 --- a/docs/content/en/docs/install/_index.md +++ b/docs/content/en/docs/install/_index.md @@ -1,6 +1,6 @@ --- title: Installation and Upgrade -description: Learn how to install and upgrade the Keptn Lifecycle Toolkit +description: Learn how to install and upgrade Keptn weight: 30 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- diff --git a/docs/content/en/docs/install/install.md b/docs/content/en/docs/install/install.md index 35e435f600f..2a1037c373a 100644 --- a/docs/content/en/docs/install/install.md +++ b/docs/content/en/docs/install/install.md @@ -1,19 +1,19 @@ --- -title: Install and enable KLT -description: Install the Keptn Lifecycle Toolkit +title: Install and enable Keptn +description: Install Keptn weight: 35 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -The Keptn Lifecycle Toolkit must be installed, enabled, and integrated +Keptn must be installed, enabled, and integrated into each cluster you want to monitor. -This is because KLT communicates with the Kubernetes scheduler +This is because Keptn communicates with the Kubernetes scheduler for tasks such as enforcing checks natively, stopping a deployment from proceeding when criteria are not met, doing post-deployment evaluations and tracing all activities of all deployment workloads on the cluster. -Two methods are supported for installing the Keptn Lifecycle Toolkit (KLT): +Two methods are supported for installing Keptn: * Releases v0.7.0 and later can be installed using the [Helm Chart](#use-helm-chart). @@ -22,16 +22,16 @@ Two methods are supported for installing the Keptn Lifecycle Toolkit (KLT): * See the [use manifests](#use-manifests) section for more information on installing via manifest. This is the less-preferred way because it does not support customization. -After KLT is installed, you must -[Enable KLT for your cluster](#enable-klt-for-your-cluster) -in order to run some KLT functionality. +After Keptn is installed, you must +[Enable Keptn for your cluster](#enable-keptn-for-your-cluster) +in order to run some Keptn functionality. You are then ready to -[Integrate KLT with your applications](../implementing/integrate). +[Integrate Keptn with your applications](../implementing/integrate). ## Use Helm Chart -Version v0.7.0 and later of the Lifecycle Toolkit +Version v0.7.0 and later of Keptn should be installed using Helm Charts. The command sequence to fetch and install the latest release is: @@ -48,7 +48,7 @@ as well as for upgrades. Some helpful hints: * Use the `--version ` flag on the - `helm upgrade --install` command line to specify a different KLT version. + `helm upgrade --install` command line to specify a different Keptn version. * Use the following command sequence to see a list of available versions: @@ -57,7 +57,7 @@ Some helpful hints: helm search repo klt ``` -* To verify that the KLT components are installed in your cluster, +* To verify that the Keptn components are installed in your cluster, run the following command: ```shell @@ -75,7 +75,7 @@ or if you need to change the size of the installation. To modify configuration options, download a copy of the [helm/chart/values.yaml](https://github.com/keptn/lifecycle-toolkit/blob/main/helm/chart/values.yaml) -file, modify some values, and use the modified file to install KLT: +file, modify some values, and use the modified file to install Keptn: 1. Download the `values.yaml` file: @@ -85,7 +85,7 @@ file, modify some values, and use the modified file to install KLT: 1. Edit your local copy to modify some values -1. Install KLT by adding the following string to your `helm upgrade` command line: +1. Install Keptn by adding the following string to your `helm upgrade` command line: ```shell --values=values.yaml @@ -108,7 +108,7 @@ For more information,see ## Use manifests -Versions v0.10.0 and earlier of the Lifecycle Toolkit can be installed using manifests, +Versions v0.10.0 and earlier of Keptn can be installed using manifests, although we recommend that you use Helm Charts because they allow you to easily customize your configuration. @@ -125,7 +125,7 @@ kubectl wait \ ``` Use a command sequence like the following -to install the Lifecycle Toolkit from the manifest, +to install Keptn from the manifest, specifying the version you want to install. ```shell @@ -135,11 +135,11 @@ kubectl wait --for=condition=Available deployment/lifecycle-operator \ -n keptn-lifecycle-toolkit-system --timeout=120s ``` -The Lifecycle Toolkit and its dependencies are now installed and ready to use. +Keptn and its dependencies are now installed and ready to use. -## Enable KLT for your cluster +## Enable Keptn for your cluster -To enable the Keptn Lifecycle Controller in your cluster, +To enable the Keptn in your cluster, annotate the Kubernetes [Namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) resource for each namespace in the cluster. @@ -159,6 +159,6 @@ metadata: You see the annotation line `keptn.sh/lifecycle-toolkit: "enabled"`. This annotation tells the webhook to handle the namespace. -After enabling KLT for your namespace(s), +After enabling Keptn for your namespace(s), you are ready to -[Integrate KLT with your applications](../implementing/integrate). +[Integrate Keptn with your applications](../implementing/integrate). diff --git a/docs/content/en/docs/install/k8s.md b/docs/content/en/docs/install/k8s.md index c965eeff97d..dfc28c22635 100644 --- a/docs/content/en/docs/install/k8s.md +++ b/docs/content/en/docs/install/k8s.md @@ -6,7 +6,7 @@ weight: 25 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -The Keptn Lifecycle Toolkit is meant to be installed +Keptn is meant to be installed into an existing Kubernetes cluster that runs your deployment software. See [Requirements](reqs.md) for information about supported releases @@ -20,7 +20,7 @@ You can also create a local cluster using packages such as [k3s](https://k3s.io/), and [Minikube](https://minikube.sigs.k8s.io/docs/) to set up a local, lightweight Kubernetes cluster -where you can install the Keptn Lifecycle Toolkit +where you can install Keptn for personal study, demonstrations, and testing. For more information, see the Kubernetes [Install Tools](https://kubernetes.io/docs/tasks/tools/) @@ -28,7 +28,7 @@ documentation. The [Keptn Lifecycle Toolkit: Installation and KeptnTask Creation in Minutes](https://www.youtube.com/watch?v=Hh01bBwZ_qM) video demonstrates how to create a KinD cluster. -on which you can install the Lifecycle Toolkit. +on which you can install Keptn. The basic steps are: 1. Download, install, and run [Docker](https://docs.docker.com/get-docker/) @@ -52,11 +52,11 @@ The basic steps are: kubectl version --short ``` -## Prepare your cluster for KLT +## Prepare your cluster for Keptn -The Keptn Lifecycle Toolkit installs into an existing Kubernetes cluster. +Keptn installs into an existing Kubernetes cluster. When setting up a local Kubernetes cluster -to study or demonstrate the Lifecycle Toolkit, +to study or demonstrate Keptn, you need to provide these components. Your cluster should include the following: @@ -78,7 +78,7 @@ Your cluster should include the following: such as [Argo CD](https://argo-cd.readthedocs.io/en/stable/) or [Flux](https://fluxcd.io/). - Alternatively, KLT also works with just `kubctl apply` for deployment. + Alternatively, Keptn also works with just `kubctl apply` for deployment. * If you want to use the standardized observability feature, you must have an OpenTelemetry collector @@ -92,11 +92,11 @@ Your cluster should include the following: For more information, see [Requirements for Open Telemetry](../implementing/otel.md/#requirements-for-opentelemetry). -Also note that the Keptn Lifecycle Toolkit includes +Also note that Keptn includes a light-weight cert-manager that, by default, is installed -as part of the KLT software. +as part of the Keptn software. If you are using another cert-manager in the cluster, -you can configure KLT to instead use your cert-manager. +you can configure Keptn to instead use your cert-manager. See [Use Keptn with cert-manager.io](../operate/cert-manager.md) for detailed instructions. @@ -110,9 +110,9 @@ documentation for some basic information. You can also search and find lots of "Best Practices for Namespaces" documents published on the web. -Some considerations for KLT: +Some considerations for Keptn: -* KLT primarily operates on Kubernetes +* Keptn primarily operates on Kubernetes [Workload](https://kubernetes.io/docs/concepts/workloads/) resources and [KeptnApp](../yaml-crd-ref/app.md) @@ -142,6 +142,6 @@ Some considerations for KLT: So, possible namespace designs run the gamut: -* Run all your KLT work in a single namespace -* Create a separate namespace for each logical grouping of your KLT work +* Run all your Keptn work in a single namespace +* Create a separate namespace for each logical grouping of your Keptn work * Create a separate namespace for each workload diff --git a/docs/content/en/docs/install/reqs.md b/docs/content/en/docs/install/reqs.md index b86b215cfef..db4f436b0eb 100644 --- a/docs/content/en/docs/install/reqs.md +++ b/docs/content/en/docs/install/reqs.md @@ -7,12 +7,12 @@ hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.htm ## Supported Kubernetes versions -The Keptn Lifecycle Controller requires Kubernetes v1.24.0 or later. +Keptn requires Kubernetes v1.24.0 or later. Run the following to ensure that both client and server versions are running Kubernetes versions greater than or equal to v1.24. In this example, both client and server are at v1.24.0 -so the Keptn Lifecycle Toolkit will work. +so Keptn will work. ```shell kubectl version --short @@ -24,16 +24,16 @@ Kustomize Version: v4.5.4 Server Version: v1.24.0 ``` -KLT is not currently compatible with +Keptn is not currently compatible with [vcluster](). ## Resource requirements ## cert-manager -KLT includes a lightweight cert-manager +Keptn includes a lightweight cert-manager that is used for installation and Webhooks. You can configure a different cert-manager -before you install KLT. +before you install Keptn. See [Implement your own cert-manager](../operate/cert-manager.md) for instructions. diff --git a/docs/content/en/docs/install/upgrade.md b/docs/content/en/docs/install/upgrade.md index b0da60da9b7..947a715c01b 100644 --- a/docs/content/en/docs/install/upgrade.md +++ b/docs/content/en/docs/install/upgrade.md @@ -1,14 +1,14 @@ --- title: Upgrade -description: How to upgrade to the latest version of the Lifecycle Toolkit +description: How to upgrade to the latest version of Keptn layout: quickstart weight: 45 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -If you installed the previous version of the Lifecycle Toolkit using `helm`, +If you installed the previous version of Keptn using `helm`, you can upgrade to the latest version -by running the same command sequence used to install KLT: +by running the same command sequence used to install Keptn: ```shell helm repo add klt https://charts.lifecycle.keptn.sh @@ -19,16 +19,16 @@ helm upgrade --install keptn klt/klt \ Use the `--set` flag or download and edit the `values.yaml` file to modify the configuration as discussed on the -[Install the Lifecycle Toolkit](../install/) page. +[Install Keptn](../install/) page. > **Warning** -If you installed your Lifecycle Toolkit instance from the Manifest, +If you installed your Keptn instance from the Manifest, additional steps are required to use the Helm Chart to upgrade. Contact us on Slack for assistance. ## Migrate from v0.6.0 to v0.7.0 -Keptn Lifecycle Toolkit Version v0.7.0 +Keptn Version v0.7.0 introduces the `metrics-operator`, which is now separate from the `lifecycle-operator`. Some functionality and behavior has been moved, changed, or renamed. diff --git a/docs/content/en/docs/intro-klt/_index.md b/docs/content/en/docs/intro/_index.md similarity index 70% rename from docs/content/en/docs/intro-klt/_index.md rename to docs/content/en/docs/intro/_index.md index 1181036412b..e9a49fb4862 100644 --- a/docs/content/en/docs/intro-klt/_index.md +++ b/docs/content/en/docs/intro/_index.md @@ -1,17 +1,17 @@ --- -title: Introduction to Keptn Lifecycle Toolkit -description: An introduction to KLT and the usecases. +title: Introduction to Keptn +description: An introduction to Keptn and the usecases. weight: 20 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -This section contains tutorials on how to use the Keptn Lifecycle Toolkit. +This section contains tutorials on how to use Keptn. When you understand the toolkit, begin with the [getting started guide](../getting-started/). ---- -The Keptn Lifecycle Toolkit (KLT) implements observability +Keptn implements observability for deployments and seamlessly integrates with GitOps tools such as ArgoCD, Flux, and Gitlab and brings application awareness to your Kubernetes cluster. @@ -20,11 +20,11 @@ These standard GitOps deployment tools do an excellent job at deploying applications but do not handle all issues that are required to ensure that your deployment is usable. -The Keptn Lifecycle Toolkit "wraps" a standard Kubernetes GitOps deployment +Keptn "wraps" a standard Kubernetes GitOps deployment with the capability to automatically handle issues before and after the actual deployment. -Pre-deployment issues that Keptn Lifecycle Toolkit can handle: +Pre-deployment issues that Keptn can handle: * Send appropriate notifications that this deployment is about to happen * Check that downstream services meet their SLOs @@ -32,7 +32,7 @@ Pre-deployment issues that Keptn Lifecycle Toolkit can handle: * Ensure that your infrastructure has the resources necessary for a successful deployment -Post-deployment issues that Keptn Lifecycle Toolkit can handle: +Post-deployment issues that Keptn can handle: * Integrate with tooling beyond the standard Kubernetes probes * Automatically test the deployment @@ -41,14 +41,14 @@ Post-deployment issues that Keptn Lifecycle Toolkit can handle: * Send appropriate notifications about whether the deployment was successful or unsuccessful -KLT can evaluate both workload (single service) tests +Keptn can evaluate both workload (single service) tests and SLO evaluations before and after the actual deployment. Multiple workloads can also be logically grouped and evaluated as a single cohesive unit called a `KeptnApp`. In other words, a `KeptnApp` is a collection of multiple workloads. -KLT is tool- and vendor neutral and does not depend on particular GitOps tooling. -KLT emits signals at every stage +Keptn is tool- and vendor neutral and does not depend on particular GitOps tooling. +Keptn emits signals at every stage (Kubernetes events, OpenTelemetry metrics and traces) to ensure that your deployments are observable. It supports the following steps: @@ -66,8 +66,8 @@ All of these things can be executed for a workload or for a [KeptnApp](https://l ## Main features of : Metrics, Observability and Release lifecycle -* **Custom Metrics:** The Custom Keptn Metrics feature in the -Keptn Lifecycle Toolkit allows you to define metrics from +* **Custom Metrics:** The Custom Keptn Metrics feature in +Keptn allows you to define metrics from multiple data sources in your Kubernetes cluster. It supports deployment tools like Argo, Flux, KEDA, HPA, or Keptn for automated decision-making based on observability data. @@ -78,96 +78,96 @@ The Keptn Metrics Server unifies and standardizes access to data from various sources, simplifying configuration and integration into a single set of metrics. -* **Observability:** The Keptn Lifecycle Toolkit (KLT) ensures observability +* **Observability:** Keptn ensures observability for Kubernetes deployments by creating a comprehensive trace of all Kubernetes activities within a deployment. It introduces the concept of applications, which connect logically related workloads using different deployment strategies. -With KLT, you can easily understand deployment durations and failures across +With Keptn, you can easily understand deployment durations and failures across multiple strategies. It captures DORA metrics and exposes them as OpenTelemetry metrics. The observability data includes out-of-the-box DORA metrics, traces from OpenTelemetry, and custom Keptn metrics from configured data providers. Visualizing this information is possible using dashboard tools like Grafana. -* **Release Lifecycle:** The Lifecycle Toolkit offers versatile functionalities +* **Release Lifecycle:** Keptn offers versatile functionalities for deployment scenarios, including pre-deployment validation, image scanning, and post-deployment tasks like test execution and stakeholder notification. It automatically validates against Service Level Objectives (SLOs) and provides end-to-end deployment traceability. -The toolkit extends deployments with application-aware tasks and evaluations, +Keptn extends deployments with application-aware tasks and evaluations, allowing checks before or after deployment initiation. It validates Keptn metrics using the Keptn Metrics Server, ensuring a healthy environment and confirming software health against SLOs like performance and user experience. Additionally, it enables monitoring of new logs from log monitoring solutions. -To get started with Keptn Lifecycle Toolkit, refer to the +To get started with Keptn, refer to the [Getting Started Exercises](https://lifecycle.keptn.sh/docs/getting-started/) for detailed instructions and examples. This guide will walk you through the installation process and help you set up -your environment for using KLT effectively. +your environment for using Keptn effectively. -## Compare Keptn Lifecycle Toolkit and Keptn LTS +## Differences between Keptn and Keptn v1 -The Keptn Lifecycle Controller (KLT) is a Keptn subproject -whose design reflects lessons we learned while developing Keptn LTS. -KLT recognizes that tools such as Argo and Flux +Keptn is a subproject +whose design reflects lessons we learned while developing Keptn v1. +Keptn recognizes that tools such as Argo and Flux are very good at deploying applications. However, these deployment tools do not provide pre-deployment and post-deployment evaluations and actions; -this is what KLT adds. +this is what Keptn adds. -Keptn LTS is a long-term support release +Keptn v1 is a long-term support release that can deploy applications on platforms other than Kubernetes, can accommodate complex scoring algorithms for SLO evaluations, and can implement remediations (self-healing) for problems discovered on the production site. -Keptn Lifecycle Toolkit includes multiple features +Keptn includes multiple features that can be implemented independently or together. Different features are at different levels of stability. -See the [Keptn Lifecycle Toolkit README file](https://github.com/keptn/lifecycle-toolkit/blob/main/README.md) +See the [Keptn README file](https://github.com/keptn/lifecycle-toolkit/blob/main/README.md) for a list of the features that have been implemented to date and their level of stability. In a December 2022 Keptn Community meeting, we discussed the differences and similarities -between Keptn and the Keptn Lifecycle Toolkit +between Keptn v1 and Keptn to help you decide which best fits your needs. View the recording: -[Compare Keptn V1 and the Keptn Lifecycle Toolkit](https://www.youtube.com/watch?v=-cKyUKFjtwE&t=170s) +[Compare Keptn v1 and the Keptn Lifecycle Toolkit](https://www.youtube.com/watch?v=-cKyUKFjtwE&t=170s) -## Overviews of Keptn Lifecycle Toolkit +## Overviews of Keptn -A number of presentations are available to help you understand -the Keptn Lifecycle Toolkit: +A number of presentations are available to help you understand Keptn. +Note that many of these refer to the "Keptn Lifecycle Controller" +or "Keptn Lifecycle Toolkit", which was the development code name for Keptn. * [Orchestrating and Observing GitOps Deployments with Keptn](https://www.youtube.com/watch?v=-cKyUKFjtwE&t=11s) - discusses the evolution of Keptn - and the concepts that drive the Keptn Lifecycle Toolkit, - then gives a simple demonstration of a Keptn Lifecycle Controller implementation. + discusses the evolution of Keptn and the concepts that drive it, + then gives a simple demonstration of a Keptn implementation. * [Introducing Keptn Lifecycle Toolkit](https://youtu.be/449HAFYkUlY) - gives an overview of what KLT does and how to implement it. + gives an overview of what Keptn does and how to implement it. * [Keptn Lifecycle Toolkit Demo Tutorial on k3s, with ArgoCD for GitOps, OTel, Prometheus and Grafana](https://www.youtube.com/watch?v=6J_RzpmXoCc) - is a short video demonstration of how the Keptn Lifecycle Toolkit works. + is a short video demonstration of how Keptn works. You can download the exercise and run it for yourself; notes below the video give a link to the github repo. The README file in that repo gives instructions for installing the software either automatically or manually. * [What is the Keptn Lifecycle Toolkit?](https://isitobservable.io/observability/kubernetes/what-is-the-keptn-lifecycle-toolkit) - blog discusses KLT as part of the "Is It Observable?" series. + blog discusses Keptn as part of the "Is It Observable?" series. This links to: - * [What is Keptn Lifecycle Toolkit?](https://www.youtube.com/watch?v=Uvg4uG8AbFg) - is a video that steps through the process of integrating KLT - with your existing cloud native cluster. +* [What is Keptn Lifecycle Toolkit?](https://www.youtube.com/watch?v=Uvg4uG8AbFg) + is a video that steps through the process of integrating Keptn + with your existing cloud native cluster. * [Keptn Lifecycle Toolkit: Installation and KeptnTask Creation in Minutes](https://www.youtube.com/watch?v=Hh01bBwZ_qM) - demonstrates how to install KLT and create your first KeptnTask in less than ten minutes. + demonstrates how to install Keptn and create your first KeptnTask in less than ten minutes. * You can explore the [GitHub repository](https://github.com/isItObservable/keptn-lifecycle-Toolkit) for more information. diff --git a/docs/content/en/docs/intro-klt/assets/dynatrace_dora_dashboard.png b/docs/content/en/docs/intro/assets/dynatrace_dora_dashboard.png similarity index 100% rename from docs/content/en/docs/intro-klt/assets/dynatrace_dora_dashboard.png rename to docs/content/en/docs/intro/assets/dynatrace_dora_dashboard.png diff --git a/docs/content/en/docs/intro-klt/usecase-observability.md b/docs/content/en/docs/intro/usecase-observability.md similarity index 87% rename from docs/content/en/docs/intro-klt/usecase-observability.md rename to docs/content/en/docs/intro/usecase-observability.md index a174c23d8ae..fac1f15e9e7 100644 --- a/docs/content/en/docs/intro-klt/usecase-observability.md +++ b/docs/content/en/docs/intro/usecase-observability.md @@ -1,10 +1,10 @@ --- title: Standardize observability -description: How the KLT standardizes access to observability data for Kubernetes deployments +description: How Keptn standardizes access to observability data for Kubernetes deployments weight: 10 --- -The Keptn Lifecycle Toolkit (KLT) makes any Kubernetes deployment observable. +Keptn makes any Kubernetes deployment observable. In other words, it creates a distributed, end-to-end trace of everything Kubernetes does in the context of a Deployment. It provides this information @@ -21,12 +21,11 @@ This means that: - You can readily see why a deployment takes so long or why it fails, even when using multiple deployment strategies. -- KLT can capture DORA metrics and expose them as OpenTelemetry metrics +- Keptn can capture DORA metrics and expose them as OpenTelemetry metrics The observability data is an amalgamation of the following: -- DORA metrics are collected out of the box - when the Lifecycle Toolkit is enabled +- DORA metrics are collected out of the box when Keptn is enabled - OpenTelemetry runs traces that show everything that happens in the Kubernetes cluster - Custom Keptn metrics that you can use to monitor @@ -44,7 +43,7 @@ It is based on the example. This is the second of three exercises in the -[Introducing the Keptn Lifecycle Toolkit](_index.md) +[Introducing Keptn](_index.md) series: - In the @@ -62,16 +61,16 @@ series: This exercise shows how to standardize access to the observability data for your cluster. -If you are installing the Keptn Lifecycle Toolkit on an existing cluster +If you are installing Keptn on an existing cluster or on a local cluster you are creating for this exercise, you need to do the following: 1. Follow the instructions in [Install and update](../install) - to install and enable KLT on your cluster. + to install and enable Keptn on your cluster. 1. Follow the instructions in [Basic annotations](../implementing/integrate/#basic-annotations) - to integrate the Lifecycle Toolkit into your Kubernetes cluster + to integrate Keptn into your Kubernetes cluster by applying basic annotations to your workload and pod resources. and to create appropriate @@ -84,7 +83,7 @@ you need to do the following: DORA metrics are an industry-standard set of measurements about your deployments. -The Keptn Lifecycle Toolkit starts collecting these metrics +Keptn starts collecting these metrics as soon as you annotate the `Deployment` resource. See [DORA metrics](../implementing/dora) @@ -92,7 +91,7 @@ for more details. ## Using OpenTelemetry -The Keptn Lifecycle Toolkit extends the Kubernetes +Keptn extends the Kubernetes primitives to create OpenTelemetry data that connects all your deployment and observability tools without worrying about where it is stored and where it is managed. diff --git a/docs/content/en/docs/intro-klt/usecase-orchestrate.md b/docs/content/en/docs/intro/usecase-orchestrate.md similarity index 91% rename from docs/content/en/docs/intro-klt/usecase-orchestrate.md rename to docs/content/en/docs/intro/usecase-orchestrate.md index eb2917db47a..7c1e95193b5 100644 --- a/docs/content/en/docs/intro-klt/usecase-orchestrate.md +++ b/docs/content/en/docs/intro/usecase-orchestrate.md @@ -1,14 +1,14 @@ --- title: Manage release lifecycle -description: How KLT orchestrates pre- and post-deployment evaluations and tasks +description: How Keptn orchestrates pre- and post-deployment evaluations and tasks weight: 20 --- -In this exercise, we will configure the Keptn Lifecycle Toolkit +In this exercise, we will configure Keptn to run deployment checks as part of your deployment. Whether you are deploying your software with Argo, Flux, another deployment engine, or even `kubectl apply`, -the Lifecycle Toolkit can do the following: +Keptn can do the following: * Pre-deploy: Validate external dependencies, confirm that images are scanned, and so forth @@ -18,11 +18,11 @@ the Lifecycle Toolkit can do the following: * Automatically validate against your SLO (Service Level Objectives) -KLT sits on top of the Kubernetes scheduler +Keptn sits on top of the Kubernetes scheduler and can do the following: * Trace the deployment from start to end -* KLT is application aware, +* Keptn is application aware, so can extend the deployment with tasks and evaluations that are run either before or after your whole application starts the deployment or at the individual workload level. @@ -56,7 +56,7 @@ The steps to implement pre- and post-deployment orchestration are: * [Integrate evaluations and tasks into the cluster](#integrate-evaluations-and-tasks-into-the-cluster) This is the third of three exercises in the -[Introducing the Keptn Lifecycle Toolkit](_index.md) +[Introducing Keptn](_index.md) series. You may want to complete the other exercises before doing this exercise although that is not required: @@ -68,7 +68,7 @@ although that is not required: you learn how to standardize access to the observability data for your cluster. -If you are installing the Keptn Lifecycle Toolkit on an existing cluster +If you are installing Keptn on an existing cluster or in a local cluster you are creating for this exercise and did not previously set up your cluster for the [Standardize observability](usecase-observability.md) exercise, @@ -76,10 +76,10 @@ you need to do the following: 1. Follow the instructions in [Install and update](../install/_index.md) - to install and enable KLT on your cluster. + to install and enable Keptn on your cluster. 1. Follow the instructions in [Annotate workload](../implementing/integrate/#basic-annotations) - to integrate the Lifecycle Toolkit into your Kubernetes cluster + to integrate Keptn into your Kubernetes cluster by applying basic annotations to your `Deployment` resource. This also creates appropriate [KeptnApp](../yaml-crd-ref/app.md) resources @@ -146,7 +146,7 @@ spec: secret: slack-notification ``` -For more information about sending Slack notifications with KLT, see +For more information about sending Slack notifications with Keptn, see [Implement Slack notifications](../implementing/slack.md). The code to be executed is expressed as a [Deno](https://deno.com) @@ -157,7 +157,7 @@ For this example, the code to be executed is embedded in this file although, in practice, this script would probably be located on a remote webserver. -Note that, beginning with KLT 0.8.0, +Note that, beginning with Keptn 0.8.0, you can also use Python 3 to define your task, or you can define a standard Kubernetes container that uses the image, runner, and runtime dependencies that you choose. diff --git a/docs/content/en/docs/intro-klt/usecase_metrics.md b/docs/content/en/docs/intro/usecase_metrics.md similarity index 96% rename from docs/content/en/docs/intro-klt/usecase_metrics.md rename to docs/content/en/docs/intro/usecase_metrics.md index 4338a878cb7..2bed2f146f1 100644 --- a/docs/content/en/docs/intro-klt/usecase_metrics.md +++ b/docs/content/en/docs/intro/usecase_metrics.md @@ -4,7 +4,7 @@ description: Enhance your deployment with custom Keptn metrics weight: 30 --- -The Custom Keptn metrics component of the Keptn Lifecycle Toolkit +The Custom Keptn metrics component allows you to define any type of metric from multiple instances of any type of data source in your Kubernetes cluster. @@ -19,7 +19,7 @@ or may be data that comes directly from your cloud provider such as AWS, Google, or Azure. The Keptn Metrics Server unifies and standardizes access to all this data. Minimal configuration is required -because the Keptn Lifecycle Toolkit hooks directly into Kubernetes primitives. +because Keptn hooks directly into Kubernetes primitives. The [Kubernetes metric server](https://github.com/kubernetes-sigs/metrics-server) @@ -43,7 +43,7 @@ as you implement the functionality "from scratch" on your local Kubernetes deployment cluster. This is the first of three exercises in the -[Introducing the Keptn Lifecycle Toolkit](_index.md) +[Introducing Keptn](_index.md) series. After completing this exercise, you may want to do the other exercises: @@ -60,7 +60,7 @@ you may want to do the other exercises: The steps to implement metrics in an existing cluster are: -1. [Install the Keptn Lifecycle Toolkit](../install/install.md) +1. [Install Keptn](../install/install.md) 1. Configure the metrics you want to use: - [Define metrics providers](#define-metrics-providers) - [Define KeptnMetric information](#define-keptnmetric-information) @@ -213,7 +213,7 @@ simplenode-dev available-cpus dev-prometheus sum(kube_node_status_capacity{r ## Run the metrics As soon as you define your `KeptnMetricsProvider` and `KeptnMetric` resources, -the Lifecycle Toolkit begins collecting the metrics you defined. +Keptn begins collecting the metrics you defined. You do not need to do anything else. ## Observing the metrics diff --git a/docs/content/en/docs/migrate/_index.md b/docs/content/en/docs/migrate/_index.md index 501837400d1..1a67dfd5c1a 100644 --- a/docs/content/en/docs/migrate/_index.md +++ b/docs/content/en/docs/migrate/_index.md @@ -1,12 +1,11 @@ --- -title: Migrating to the Keptn Lifecycle Toolkit -description: Notes to help you migrate from Keptn v1 to KLT +title: Migrating to Keptn +description: Notes to help you migrate from Keptn v1 to Keptn weight: 900 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -The Keptn Lifecycle Toolkit uses a different paradigm -than that used for Keptn v1 +Keptn uses a different paradigm than that used for Keptn v1 and so migration from Keptn v1 will not be a straight-forward process. In this section, we will assemble information to help people who want to move from Keptn v1 as it becomes available. @@ -19,10 +18,10 @@ We hope you will contribute your experiences and questions that you have. These instructions mostly assume that you want to utilize -the full Keptn Lifecycle Toolkit. +all Keptn features. Note, however, that you can install and use some functionality such as Keptn Metrics and Observability -without implementing all KLT features. +without implementing all Keptn features. This section currently includes the following topics: @@ -31,8 +30,8 @@ This section currently includes the following topics: * [Set up metrics and observability](metrics-observe) -- When you identify the data-sources being used - and provide KLT with information about your OpenTelemetry collector, - KLT begins to accumulate information that you can view + and provide Keptn with information about your OpenTelemetry collector, + Keptn begins to accumulate information that you can view for your deployment. * [Migrate Quality Gates to Keptn Evaluations](evaluations) diff --git a/docs/content/en/docs/migrate/cicd/_index.md b/docs/content/en/docs/migrate/cicd/_index.md index eb02b323d31..8302b61e028 100644 --- a/docs/content/en/docs/migrate/cicd/_index.md +++ b/docs/content/en/docs/migrate/cicd/_index.md @@ -1,6 +1,6 @@ --- -title: Migrate CI/CD functionality to KLT -description: Translate Keptn v1 CI/CD funtionality to KLT resources +title: Migrate CI/CD functionality to Keptn +description: Translate Keptn v1 CI/CD funtionality to Keptn resources weight: 60 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- diff --git a/docs/content/en/docs/migrate/metrics-observe/_index.md b/docs/content/en/docs/migrate/metrics-observe/_index.md index 77ee19fa646..4d76e590d6f 100644 --- a/docs/content/en/docs/migrate/metrics-observe/_index.md +++ b/docs/content/en/docs/migrate/metrics-observe/_index.md @@ -1,5 +1,5 @@ --- -title: Migrate Quality Gates to KLT metrics and evaluations +title: Migrate Quality Gates to Keptn metrics and evaluations description: How to translate Quality Gates into Keptn Metrics and evaluations weight: 40 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html @@ -13,25 +13,25 @@ We hope you will contribute your experiences and questions that you have. The SLIs and SLOs used for Keptn v1 quality gates can be ported to -KLT KeptnMetrics and KeptnEvaluationDefintions. +Keptn KeptnMetrics and KeptnEvaluationDefintions. -By default, KLT includes additional observability features +By default, Keptn includes additional observability features that are not included in Keptn v1: * [DORA metrics](../../implementing/dora) * [OpenTelemetry observability](../../implementing/otel.md) -Keptn v1 Quality Gates can be migrated into KLT metrics -and KLT evaluations. +Keptn v1 Quality Gates can be migrated into Keptn metrics +and Keptn evaluations. > **Note** The full SLO capabilities provided by Keptn v1 such as weighting and scoring -are currently under development for KLT. +are currently under development for Keptn. You can follow and participate in the design and implementation process at [GitHub Epic 1646](https://github.com/keptn/lifecycle-toolkit/issues/1646). -Notice the paradigm differences when implementing KLT evaluations: +Notice the paradigm differences when implementing Keptn evaluations: * Data providers are installed and configured into your Kubernetes cluster using Helm charts and standard practices. @@ -40,13 +40,13 @@ Notice the paradigm differences when implementing KLT evaluations: for each instance of each data provider. This resource specifies the URL and namespace for the data provider and gives it a unique `name` that can be referenced by other resources. - This is the only KLT specific configuration that is required. + This is the only Keptn specific configuration that is required. * Each query that is specified in your Keptn v1 [slo.yaml](https://keptn.sh/docs/1.0.x/reference/files/sli/) file should be converted into its own [KeptnMetric](../../yaml-crd-ref/metric.md) resource if you are using it for an evaluation. - Note that KLT supports using multiple instances of multiple data providers. + Note that Keptn supports using multiple instances of multiple data providers. * Simple Keptn v1 comparisons that are defined in [slo.yaml](https://keptn.sh/docs/1.0.x/reference/files/slo/) files can be converted to diff --git a/docs/content/en/docs/migrate/strategy/_index.md b/docs/content/en/docs/migrate/strategy/_index.md index 6b54796a484..6b00374de8f 100644 --- a/docs/content/en/docs/migrate/strategy/_index.md +++ b/docs/content/en/docs/migrate/strategy/_index.md @@ -15,52 +15,52 @@ and questions that you have. Before you begin the migration project, we suggest that you run through the exercises in [Getting started](../../getting-started/) -to familiarize yourself with how the Keptn Lifecycle Toolkit works. +to familiarize yourself with how Keptn works. When you are ready to begin the migration, follow the instructions in [Installation and upgrade](../../install) to set up your Kubernetes cluster -and install KLT on it. +and install Keptn on it. On this page, we discuss some of the major paradigm shifts -in KLT relative to Keptn v1 +in Keptn relative to Keptn v1 and then discuss how elements of your Keptn v1 can be implemented -for the Keptn Lifecycle Toolkit. +for Keptn. -## The Keptn Lifecycle Toolkit paradigm +## The Keptn cloud native paradigm -The Keptn Lifecycle Toolkit uses a different paradigm +Keptn uses a different paradigm than Keptn v1 and so migration requires technical adjustments. Much of the logic and functionality of your Keptn v1 projects -can be migrated to KLT -but must be rewritten to utilize KLT components. +can be migrated to Keptn +but must be rewritten to utilize Keptn components. Some key points: -* KLT uses native Kubernetes CRDs +* Keptn uses native Kubernetes CRDs to configure SLIs/SLOs, tasks, and other elements that are part of the environment where the application deployment lives rather than using its own Git repo and its [shipyard.yaml](https://keptn.sh/docs/1.0.x/reference/files/shipyard/) - file as Keptn V1 does. + file as Keptn v1 does. * See the [CRD Reference](../../yaml-crd-ref) section for pages that describe the Keptn manifests - that you populate manually for KLT. + that you populate manually for Keptn. * See the [API Reference](../../crd-ref) for a comprehensive reference to all resources defined for Keptn. -* KLT is not a delivery tool +* Keptn is not a delivery tool because it does not provide promotion. Instead, it works with standard deployment tools such as ArgoCD, Flux, even `kubectl -- apply`. - KLT then prevents the scheduling and deployment + Keptn then prevents the scheduling and deployment of workflows if the environment does not meet the user-defined requirements. -* KLT operates on a +* Keptn operates on a [KeptnApp](../../yaml-crd-ref/app.md) resource that is an amalgamation of multiple Kubernetes workloads, @@ -68,13 +68,13 @@ Some key points: Each workload deploys a separate microservice, which can be deployed at different times using different tools. -* KLT integrates with continuous delivery tools +* Keptn integrates with continuous delivery tools to insures that a `KeptnApp` is not deployed if it does not meet the user-defined requirements for all the associated workloads. It also exposes metrics to evaluate the success/status of a deployment. -* KLT provides an operator +* Keptn provides an operator that can observe and orchestrate application-aware workload life cycles. This operator leverages Kubernetes webhooks and extends the Kubernetes scheduler @@ -85,22 +85,22 @@ Some key points: it can execute pre- and post-deployment evaluations and tasks using Kubernetes capabilities. -* KLT provides extensive observability data +* Keptn provides extensive observability data using OpenTelemetry and Prometheus rather than storing the data in a special Keptn database. This data can be displayed using Grafana and Jaeger or the dashboard of your choice. -For in-depth information about KLT components +For in-depth information about Keptn components and how they work, see the [Architecture](../../concepts/architecture) section. -## Disposition of Keptn v1 components in KLT +## Disposition of Keptn v1 components in Keptn To help you wrap your mind around the migration process, this lists Keptn v1 components -and identifies their possible disposition when you migrate to KLT. +and identifies their possible disposition when you migrate to Keptn. ### project @@ -109,7 +109,7 @@ A project is defined by a [shipyard.yaml](https://keptn.sh/docs/1.0.x/reference/files/shipyard/) file. -KLT does not recognize projects. +Keptn does not recognize projects. Many Keptn v1 projects may translate into `KeptnApp` resources but others will not. For example, if your Keptn v1 project has a large number of services, @@ -119,8 +119,8 @@ but, since few applications are stored in a mono-repo, it is difficult to implement a project-as-application paradigm. In general, the Keptn v1 project is a useful as a reference list -when migrating to KLT -but may not directly translate to a KLT resource. +when migrating to Keptn. +but may not directly translate to a Keptn resource. ### service @@ -131,8 +131,8 @@ a service may represent a micro-service but it could instead be a wrapper for something else, like "the entire public website" -KLT does not have the concept of a service. -When migrating to KLT, +Keptn does not have the concept of a service. +When migrating to Keptn, you need to analyze what each service is doing and translate that into an appropriate resource. The closest analogy is a Kubernetes @@ -161,7 +161,7 @@ For example: ### stage A stage is a subsection of a project. -Because KLT is not a delivery tool, +Because Keptn is not a delivery tool, it has no concept of a `stage` but rather depends on a deployment engine. However, the logic of the stages can be useful @@ -177,7 +177,7 @@ when architecting the migration: Stage functionality could be implemented in many different ways. Some functionality might be implemented in different namespaces -or even in different KLT-enabled clusters, +or even in different Keptn-enabled clusters, allowing a tool such as ArgoCD to handle promotion. ### sequence @@ -214,16 +214,16 @@ to trigger a data encryption and backup operation, or a file movement over a network, or other arbitrary activities that may or may not have anything to do with an application's lifecycle. -When migrating to KLT, +When migrating to Keptn, sequences that are not part of the lifecycle workflow -should not be handled by KLT +should not be handled by Keptn but should instead be handled by the pipeline engine tools being used such as Jenkins, Argo Workflows, Flux, and Tekton. ### task Keptn v1 defines some specific types of tasks, -each of which is translated to a KLT resource +each of which is translated to a Keptn resource that is appropriate for the activity: * A Keptn v1 **deployment task** becomes a @@ -258,7 +258,7 @@ whereas Keptn v1 sequences and tasks can not execute in parallel. * If you have actions that need to execute sequentially, create a single `KeptnTaskDefinition` that calls each action in order. * If you have tasks that can execute in parallel, - migrating to KLT may improve the performance of the deployment. + migrating to Keptn may improve the performance of the deployment. ### SLIs @@ -269,10 +269,10 @@ represent queries from the data provider such as Prometheus, Dynatrace, or Datadog, which is configured as a Keptn integration. -When migrating to KLT, you need to define a +When migrating to Keptn, you need to define a [KeptnMetricsProvider](../../yaml-crd-ref/metricsprovider.md) resource for the data provider(s) you are using. -Note that KLT allows you to support multiple data providers +Note that Keptn allows you to support multiple data providers and multiple instances of each data provider for your SLIs whereas Keptn v1 only allows you to use one SLI per project. @@ -283,7 +283,7 @@ resources. ### SLOs -KLT at this time does not support the full range +Keptn at this time does not support the full range of Quality Gates evaluations that are represented by [SLOs](https://keptn.sh/docs/1.0.x/reference/files/slo/). Facilities such as weighting of SLIs and scoring of the evaluation @@ -297,7 +297,7 @@ resources. ### Remediation -KLT does not currently support the same level of +Keptn does not currently support the same level of [remediations](https://keptn.sh/docs/1.0.x/reference/files/remediation/) as Keptn v1 does, but it does provide limited "Day 2" facilities: @@ -329,5 +329,5 @@ you may be able to use the `deno-runtime` runner. If the JES container code is written in Python 3, you may be able to use the `python-runtime` runner. -Note that there is no need for integrations for data providers in KLT; +Note that there is no need for integrations for data providers in Keptn; these are configured as `KeptnMetricsProvider` resources. diff --git a/docs/content/en/docs/operate/_index.md b/docs/content/en/docs/operate/_index.md index a17fd4a0bf3..8be4e6bd4b1 100644 --- a/docs/content/en/docs/operate/_index.md +++ b/docs/content/en/docs/operate/_index.md @@ -1,6 +1,6 @@ --- -title: Operate KLT -description: This section contains various content on operating KLT day-to-day +title: Operate Keptn +description: This section contains various content on operating Keptn day-to-day weight: 30 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html ---- \ No newline at end of file +--- diff --git a/docs/content/en/docs/operate/cert-manager.md b/docs/content/en/docs/operate/cert-manager.md index c58c833692c..9d455e87992 100644 --- a/docs/content/en/docs/operate/cert-manager.md +++ b/docs/content/en/docs/operate/cert-manager.md @@ -1,28 +1,28 @@ --- title: Use Keptn with cert-manager.io (optional) -description: Replace the default KLT cert-manager +description: Replace the default Keptn cert-manager weight: 30 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -The Keptn Lifecycle Toolkit includes +Keptn includes a light-weight, customized cert-manager that is used to register Webhooks to the [KubeAPI](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/). Bundling the cert-manager simplifies the installation for new users -and provides the functionality KLT needs +and provides the functionality Keptn needs without the overhead of other cert-managers. For a description of the architecture, see [Keptn Certificate Manager](../concepts/architecture/cert-manager.md). -KLT also works well with `cert-manager.io`. +Keptn also works well with `cert-manager.io`. If you are already using `cert-manager.io`, you can continue to use it for other components -and use the KLT cert-manager just for KLT activities -or you can disable the KLT cert-manager -and configure KLT to use `cert-manager.io`. +and use the Keptn cert-manager just for Keptn activities +or you can disable the Keptn cert-manager +and configure Keptn to use `cert-manager.io`. -If you want KLT to use `cert-manager.io`, -you must configure it *before* you install KLT. +If you want Keptn to use `cert-manager.io`, +you must configure it *before* you install Keptn. The steps are: * Install `cert-manager.io` if it is not already installed. diff --git a/docs/content/en/docs/troubleshooting.md b/docs/content/en/docs/troubleshooting.md index 334ef7da030..b689521e93a 100644 --- a/docs/content/en/docs/troubleshooting.md +++ b/docs/content/en/docs/troubleshooting.md @@ -1,26 +1,26 @@ --- title: Troubleshooting Guide linktitle: Troubleshooting Guide -description: Troubleshoot common problems with KLT +description: Troubleshoot common problems with Keptn weight: 100 --- -Welcome to the troubleshooting guide for KLT (Keptn Lifecycle Toolkit). +Welcome to the Keptn troubleshooting guide. -This guide will help you address common issues that you might encounter while using KLT +This guide will help you address common issues that you might encounter while using Keptn for managing your workloads. Below are some common problems and their solutions: -## KLT is installed but it is not aware of my workloads +## Keptn is installed but it is not aware of my workloads -If you are facing an issue where KLT is installed but does not seem to be aware of your workloads, follow these steps: +If you are facing an issue where Keptn is installed but does not seem to be aware of your workloads, follow these steps: 1. Ensure that the namespace you wish to target is [annotated correctly](https://lifecycle.keptn.sh/docs/install/install/#enable-klt-for-your-cluster). 2. Make sure your workloads (e.g., Deployment manifests) have the [three required annotations](https://lifecycle.keptn.sh/docs/implementing/integrate/#annotate-workloads). -## KLT is causing my pods to be pending +## Keptn is causing my pods to be pending -If your pods are stuck in a pending state and KLT seems to be the cause, it might be due +If your pods are stuck in a pending state and Keptn seems to be the cause, it might be due to a pre-deployment task or evaluation. Follow these steps: @@ -38,18 +38,18 @@ kubectl -n prod get pods kubectl -n prod logs job/... ``` -## I have pending Pods after KLT is uninstalled +## I have pending Pods after Keptn is uninstalled > **Note**_ This section particularly affects clusters managed by ArgoCD. -If you have uninstalled Keptn Lifecycle Toolkit and are now facing issues scheduling or deleting pods, follow these steps: +If you have uninstalled Keptn and are now facing issues scheduling or deleting pods, follow these steps: ArgoCD does not delete various CRDs and webhooks, when uninstalling applications, causing lingering resources. ### For cleanup instructions -1. Install KLT & CRDs w/ Argo -2. Uninstall KLT via Argo +1. Install Keptn & CRDs w/ Argo +2. Uninstall Keptn via Argo 3. Cluster is frozen, Pods cannot be deleted or scheduled Trying to schedule a new pod results an `mpod.keptn.sh` error. @@ -61,7 +61,7 @@ to get further information refer to this [issue](https://github.com/keptn/lifecy ## I cannot see DORA metrics or OpenTelemetry traces -KLT will automatically generate DORA metrics and OTel traces for every deployment, but +Keptn will automatically generate DORA metrics and OTel traces for every deployment, but by default it does not know where to send them. You need an OpenTelemetry collector diff --git a/docs/content/en/docs/tutorials/_index.md b/docs/content/en/docs/tutorials/_index.md index 1f095f066cb..0739d7b0a64 100644 --- a/docs/content/en/docs/tutorials/_index.md +++ b/docs/content/en/docs/tutorials/_index.md @@ -1,10 +1,10 @@ --- title: Tutorials -description: Learn how to use the Keptn Lifecycle Toolkit +description: Learn how to use Keptn weight: 40 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -This section contains tutorials on how to use the Keptn Lifecycle Toolkit. +This section contains tutorials on how to use Keptn. Begin with the [getting started guide](../getting-started/) first, then come back here to complete these tutorials. diff --git a/docs/content/en/docs/tutorials/add-tasks.md b/docs/content/en/docs/tutorials/add-tasks.md index 1e2f82774f3..95561b3b18e 100644 --- a/docs/content/en/docs/tutorials/add-tasks.md +++ b/docs/content/en/docs/tutorials/add-tasks.md @@ -8,9 +8,9 @@ hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.htm > This tutorial assumes you have already completed the [getting started guide](../getting-started/). > Please ensure you've finished that before attempting this guide. -## KLT Pre and Post Deployment Tasks +## Keptn Pre and Post Deployment Tasks -When KLT is successfully monitoring your deployments, it can also run arbitrary tasks and SLO evaluations: +When Keptn is successfully monitoring your deployments, it can also run arbitrary tasks and SLO evaluations: - pre-deployment (before the pod is scheduled) and - post-deployment (after the post is scheduled) diff --git a/docs/content/en/docs/yaml-crd-ref/_index.md b/docs/content/en/docs/yaml-crd-ref/_index.md index 589530b8ebe..0c97fcb83aa 100644 --- a/docs/content/en/docs/yaml-crd-ref/_index.md +++ b/docs/content/en/docs/yaml-crd-ref/_index.md @@ -6,8 +6,7 @@ hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.htm --- This section provides comprehensive reference information about the -manifest files that must be populated -for the Keptn Lifecycle Toolkit +manifest files that must be populated for Keptn [Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/). Each CRD is an object of an API library. diff --git a/docs/content/en/docs/yaml-crd-ref/app.md b/docs/content/en/docs/yaml-crd-ref/app.md index 780bbb42ff9..baab7680971 100644 --- a/docs/content/en/docs/yaml-crd-ref/app.md +++ b/docs/content/en/docs/yaml-crd-ref/app.md @@ -113,7 +113,7 @@ If used, these fields must be populated manually: Kubernetes defines [workloads](https://kubernetes.io/docs/concepts/workloads/) but does not define applications. -The Keptn Lifecycle Toolkit adds the concept of applications +Keptn adds the concept of applications defined as a set of workloads that can be executed. A `KeptnApp` resource is added into the repository of the deployment engine @@ -126,7 +126,7 @@ feature to generate a `KeptnApp` resource based on the [basic annotations](../implementing/integrate/#basic-annotations) that are applied to any of the workload resources. -This allows you to use the KLT observability features for existing resources +This allows you to use the Keptn observability features for existing resources without manually populating any Keptn related resources. The release lifecycle management feature @@ -173,6 +173,6 @@ spec: - [Working with tasks](../implementing/tasks) - [Architecture of KeptnWorkloads and KeptnTasks](../concepts/architecture/keptn-apps/) - [Pre- and post-deployment tasks](../implementing/integrate/#pre--and-post-deployment-checks) -- [Orchestrate deployment checks](../intro-klt/usecase-orchestrate.md) +- [Orchestrate deployment checks](../intro/usecase-orchestrate.md) - [Use Keptn automatic app discovery](../implementing/integrate/#use-keptn-automatic-app-discovery) - [Restart an Application Deployment](../implementing/restart-application-deployment/) diff --git a/docs/content/en/docs/yaml-crd-ref/config.md b/docs/content/en/docs/yaml-crd-ref/config.md index 0e308a39681..64e7433351a 100644 --- a/docs/content/en/docs/yaml-crd-ref/config.md +++ b/docs/content/en/docs/yaml-crd-ref/config.md @@ -4,7 +4,7 @@ description: Define configuration values weight: 20 --- -`KeptnConfig` defines configuration values for the Keptn Lifecycle Toolkit. +`KeptnConfig` defines Keptn configuration values. ## Yaml Synopsis diff --git a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md index 6d34fa9f5ba..650ab998db4 100644 --- a/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/evaluationdefinition.md @@ -8,7 +8,7 @@ weight: 20 A `KeptnEvaluationDefinition` assigns target values to [KeptnMetric](metric.md) queries. These are used as part of evaluation tasks -that can be run by the Keptn Lifecycle Toolkit +that Keptn runs as part of pre- and post-analysis phases of a workload or application. ## Yaml Synopsis @@ -61,7 +61,7 @@ spec: A `KeptnEvaluationDefinition` references one or more [KeptnMetric](metric.md) resources. When multiple `KeptnMetric`s are used, -the Keptn Lifecycle Toolkit considers the evaluation successful +Keptn considers the evaluation successful if **all** metrics meet their `evaluationTarget`. The `KeptnMetric` resource and associated diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index 848a7e08f66..77dfb8d12b3 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -72,7 +72,7 @@ spec: Defaults to 5m. * **status** - * KLT fills in this information when the metric is evaluated. + * Keptn fills in this information when the metric is evaluated. It always records the time the metric was last evaluated. If the evaluation is successful, this stores the result in both human-readable and raw format. @@ -156,5 +156,5 @@ spec: * [KeptnEvaluationDefinition](evaluationdefinition.md) * [KeptnMetricsProvider](metricsprovider.md) * Implementing [Keptn Metrics](../implementing/evaluatemetrics.md) -* [Getting started with Keptn metrics](../intro-klt/usecase_metrics.md) +* [Getting started with Keptn metrics](../intro/usecase_metrics.md) * Architecture of the [Keptn Metrics Operator](../concepts/architecture/components/metrics-operator/_index.md) diff --git a/docs/content/en/docs/yaml-crd-ref/taskdefinition.md b/docs/content/en/docs/yaml-crd-ref/taskdefinition.md index 3d011bd8a31..e1a5b32f558 100644 --- a/docs/content/en/docs/yaml-crd-ref/taskdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/taskdefinition.md @@ -5,8 +5,7 @@ weight: 89 --- A `KeptnTaskDefinition` defines tasks -that are run by the Keptn Lifecycle Toolkit -as part of the pre- and post-deployment phases of a +that Keptn runs as part of the pre- and post-deployment phases of a [KeptnApp](./app.md) or [KeptnWorkload](../crd-ref/lifecycle/v1alpha3/#keptnworkload). @@ -205,7 +204,7 @@ spec: resource that contains the function to be executed. * **parameters** - An optional field to supply input parameters to a function. - The Lifecycle Toolkit passes the values defined inside the `map` field + Keptn passes the values defined inside the `map` field as a JSON object. For example: @@ -280,7 +279,7 @@ The `python-runtime` runner provides a way to easily define a task using Python 3. You do not need to specify the image, volumes, and so forth. Instead, just provide a Python script -and KLT sets up the container and runs the script as part of the task. +and Keptn sets up the container and runs the script as part of the task. ```yaml apiVersion: lifecycle.keptn.sh/v?alpha? @@ -355,7 +354,7 @@ The `python-runtime` runner is used to define tasks using Python 3 code. resource that contains the function to be executed. * **parameters** - An optional field to supply input parameters to a function. - The Lifecycle Toolkit passes the values defined inside the `map` field + Keptn passes the values defined inside the `map` field as a JSON object. For example: @@ -664,4 +663,4 @@ is allowed per `KeptnTaskDefinition`. * [Working with tasks](../implementing/tasks) * [Pre- and post-deployment tasks](../implementing/integrate/#pre--and-post-deployment-checks) * [KeptnApp and KeptnWorkload resources](../concepts/architecture/keptn-apps/). -* [Orchestrate deployment checks](../intro-klt/usecase-orchestrate.md) +* [Orchestrate deployment checks](../intro/usecase-orchestrate.md) diff --git a/examples/sample-app/README.md b/examples/sample-app/README.md index e814855f02a..7a3b3b84f15 100644 --- a/examples/sample-app/README.md +++ b/examples/sample-app/README.md @@ -1,6 +1,6 @@ # Sample Application -This example should demonstrate the capabilities of the lifecycle toolkit as illustrated here: +This example demonstrates Keptn's capabilities as illustrated here: ![img.png](assets/big-picture.png) diff --git a/examples/sample-app/base/app-post-deploy.yaml b/examples/sample-app/base/app-post-deploy.yaml index f939eba9206..4de8979baf9 100644 --- a/examples/sample-app/base/app-post-deploy.yaml +++ b/examples/sample-app/base/app-post-deploy.yaml @@ -6,6 +6,6 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-controller/main/runtimes/deno-runtime/samples/ts/slack.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/slack.ts secureParameters: secret: slack-secret diff --git a/examples/sample-app/base/python-task.yaml b/examples/sample-app/base/python-task.yaml index 334f2ec3931..a611df4db34 100644 --- a/examples/sample-app/base/python-task.yaml +++ b/examples/sample-app/base/python-task.yaml @@ -6,7 +6,7 @@ metadata: spec: python: httpRef: - url: https://raw.githubusercontent.com/keptn/lifecycle-controller/main/runtimes/python-runtime/samples/secrets.py + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/python-runtime/samples/secrets.py parameters: map: user: "myuser" diff --git a/examples/sample-app/version-1/app-pre-deploy.yaml b/examples/sample-app/version-1/app-pre-deploy.yaml index 36a243ec2ef..a2dfd4c6cac 100644 --- a/examples/sample-app/version-1/app-pre-deploy.yaml +++ b/examples/sample-app/version-1/app-pre-deploy.yaml @@ -6,7 +6,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/runtimes/deno-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-frontend.podtato-kubectl.svc.cluster.local:8080 diff --git a/examples/sample-app/version-2/app-pre-deploy.yaml b/examples/sample-app/version-2/app-pre-deploy.yaml index 36a243ec2ef..a2dfd4c6cac 100644 --- a/examples/sample-app/version-2/app-pre-deploy.yaml +++ b/examples/sample-app/version-2/app-pre-deploy.yaml @@ -6,7 +6,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/runtimes/deno-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-frontend.podtato-kubectl.svc.cluster.local:8080 diff --git a/examples/sample-app/version-3/app-pre-deploy.yaml b/examples/sample-app/version-3/app-pre-deploy.yaml index 36a243ec2ef..a2dfd4c6cac 100644 --- a/examples/sample-app/version-3/app-pre-deploy.yaml +++ b/examples/sample-app/version-3/app-pre-deploy.yaml @@ -6,7 +6,7 @@ metadata: spec: function: httpRef: - url: https://raw.githubusercontent.com/keptn-sandbox/lifecycle-controller/main/runtimes/deno-runtime/samples/ts/http.ts + url: https://raw.githubusercontent.com/keptn/lifecycle-toolkit/main/runtimes/deno-runtime/samples/ts/http.ts parameters: map: url: http://podtato-head-frontend.podtato-kubectl.svc.cluster.local:8080 diff --git a/examples/support/argo/README.md b/examples/support/argo/README.md index 5560b18cd78..6e2d84f50e2 100644 --- a/examples/support/argo/README.md +++ b/examples/support/argo/README.md @@ -1,7 +1,7 @@ -# Deploying an application using the Keptn Lifecycle Controller and ArgoCD +# Deploying an application using Keptn and ArgoCD -In this example, we will show you how to install our sample application *podtatohead* using the Keptn Lifecycle -Controller and [ArgoCD](https://argo-cd.readthedocs.io/en/stable/). +In this example, we will show you how to install our sample application *podtatohead* +using Keptn and [ArgoCD](https://argo-cd.readthedocs.io/en/stable/). ## TL;DR @@ -17,8 +17,8 @@ Controller and [ArgoCD](https://argo-cd.readthedocs.io/en/stable/). ## Prerequisites -This tutorial assumes, that you already installed the Keptn Lifecycle Controller ( -see ). +This tutorial assumes, that you already installed Keptn +(see ). The installation instructions can be found [here](https://github.com/keptn/lifecycle-toolkit#deploy-the-latest-release). Furthermore, you have to install diff --git a/examples/support/observability/README.md b/examples/support/observability/README.md index 7dc9a1646d3..947a3e7f5d8 100644 --- a/examples/support/observability/README.md +++ b/examples/support/observability/README.md @@ -47,7 +47,7 @@ kubectl port-forward -n keptn-lifecycle-toolkit-system svc/jaeger-query 16686 Afterwards, you can view the Jaeger UI in the browser at [localhost:16686](http://localhost:16686). -There you should see the traces generated by the lifecycle controller, +There you should see the traces generated by the lifecycle operator, which should look like this: ### Traces overview @@ -78,7 +78,7 @@ you should see an entry for the otel-collector: Also, in the [Graph](http://localhost:9090/graph?g0.expr=&g0.tab=1&g0.stacked=0&g0.show_exemplars=0&g0.range_input=1h) -section, you can retrieve metrics reported by the Keptn Lifecycle Controller +section, you can retrieve metrics reported by Keptn (all of the available metrics start with the `keptn` prefix): ![Screenshot of the auto-complete menu in a Prometheus query](./assets/metrics.png) diff --git a/examples/support/observability/assets/grafana_dasboard_import_ui.json b/examples/support/observability/assets/grafana_dasboard_import_ui.json index 5bdb13b3a6d..8e62923b935 100644 --- a/examples/support/observability/assets/grafana_dasboard_import_ui.json +++ b/examples/support/observability/assets/grafana_dasboard_import_ui.json @@ -879,7 +879,7 @@ }, "timepicker": {}, "timezone": "", - "title": "Keptn Lifecycle Controller Metrics", + "title": "Keptn Metrics", "uid": "wlo2MpIVk", "version": 13, "weekStart": "" diff --git a/examples/support/observability/assets/grafana_dashboard.json b/examples/support/observability/assets/grafana_dashboard.json index 817eef75b4a..1f5222a16ab 100644 --- a/examples/support/observability/assets/grafana_dashboard.json +++ b/examples/support/observability/assets/grafana_dashboard.json @@ -880,7 +880,7 @@ }, "timepicker": {}, "timezone": "", - "title": "Keptn Lifecycle Controller Metrics", + "title": "Keptn Metrics", "uid": "wlo2MpIVk", "version": 13, "weekStart": "" diff --git a/helm/chart/README.md b/helm/chart/README.md index 192403a86c5..e55e85d37b0 100644 --- a/helm/chart/README.md +++ b/helm/chart/README.md @@ -1,7 +1,7 @@ -# Keptn Lifecycle Toolkit +# Keptn -KLT introduces a more cloud-native approach for pre- and post-deployment, as well as the concept of application health -checks +Keptn introduces a more cloud-native approach for pre- and post-deployment, +as well as the concept of application health checks ## Parameters diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnapp_types.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnapp_types.go index 7904465006c..8e407c8ae11 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnapp_types.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnapp_types.go @@ -41,21 +41,21 @@ type KeptnAppSpec struct { Workloads []KeptnWorkloadRef `json:"workloads,omitempty"` // PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnApp. // The items of this list refer to the names of KeptnTaskDefinitions - // located in the same namespace as the KeptnApp, or in the KLT namespace. + // located in the same namespace as the KeptnApp, or in the Keptn namespace. PreDeploymentTasks []string `json:"preDeploymentTasks,omitempty"` // PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnApp. // The items of this list refer to the names of KeptnTaskDefinitions - // located in the same namespace as the KeptnApp, or in the KLT namespace. + // located in the same namespace as the KeptnApp, or in the Keptn namespace. PostDeploymentTasks []string `json:"postDeploymentTasks,omitempty"` // PreDeploymentEvaluations is a list of all evaluations to be performed // during the pre-deployment phase of the KeptnApp. // The items of this list refer to the names of KeptnEvaluationDefinitions - // located in the same namespace as the KeptnApp, or in the KLT namespace. + // located in the same namespace as the KeptnApp, or in the Keptn namespace. PreDeploymentEvaluations []string `json:"preDeploymentEvaluations,omitempty"` // PostDeploymentEvaluations is a list of all evaluations to be performed // during the post-deployment phase of the KeptnApp. // The items of this list refer to the names of KeptnEvaluationDefinitions - // located in the same namespace as the KeptnApp, or in the KLT namespace. + // located in the same namespace as the KeptnApp, or in the Keptn namespace. PostDeploymentEvaluations []string `json:"postDeploymentEvaluations,omitempty"` } diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnevaluation_types.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnevaluation_types.go index 132461510ea..b9866962baf 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnevaluation_types.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnevaluation_types.go @@ -43,7 +43,7 @@ type KeptnEvaluationSpec struct { // EvaluationDefinition refers to the name of the KeptnEvaluationDefinition // which includes the objectives for the KeptnEvaluation. // The KeptnEvaluationDefinition can be - // located in the same namespace as the KeptnEvaluation, or in the KLT namespace. + // located in the same namespace as the KeptnEvaluation, or in the Keptn namespace. EvaluationDefinition string `json:"evaluationDefinition"` // Retries indicates how many times the KeptnEvaluation can be attempted in the case of an error or // missed evaluation objective, before considering the KeptnEvaluation to be failed. diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_types.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_types.go index ff91d9d1ea7..207d11fa8d5 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_types.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptntask_types.go @@ -35,7 +35,7 @@ type KeptnTaskSpec struct { // TaskDefinition refers to the name of the KeptnTaskDefinition // which includes the specification for the task to be performed. // The KeptnTaskDefinition can be - // located in the same namespace as the KeptnTask, or in the KLT namespace. + // located in the same namespace as the KeptnTask, or in the Keptn namespace. TaskDefinition string `json:"taskDefinition"` // Context contains contextual information about the task execution. // +optional diff --git a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkload_types.go b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkload_types.go index 1bc1d4ddd4c..38e031457ec 100644 --- a/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkload_types.go +++ b/lifecycle-operator/apis/lifecycle/v1alpha3/keptnworkload_types.go @@ -39,21 +39,21 @@ type KeptnWorkloadSpec struct { Version string `json:"version"` // PreDeploymentTasks is a list of all tasks to be performed during the pre-deployment phase of the KeptnWorkload. // The items of this list refer to the names of KeptnTaskDefinitions - // located in the same namespace as the KeptnApp, or in the KLT namespace. + // located in the same namespace as the KeptnApp, or in the Keptn namespace. PreDeploymentTasks []string `json:"preDeploymentTasks,omitempty"` // PostDeploymentTasks is a list of all tasks to be performed during the post-deployment phase of the KeptnWorkload. // The items of this list refer to the names of KeptnTaskDefinitions - // located in the same namespace as the KeptnWorkload, or in the KLT namespace. + // located in the same namespace as the KeptnWorkload, or in the Keptn namespace. PostDeploymentTasks []string `json:"postDeploymentTasks,omitempty"` // PreDeploymentEvaluations is a list of all evaluations to be performed // during the pre-deployment phase of the KeptnWorkload. // The items of this list refer to the names of KeptnEvaluationDefinitions - // located in the same namespace as the KeptnWorkload, or in the KLT namespace. + // located in the same namespace as the KeptnWorkload, or in the Keptn namespace. PreDeploymentEvaluations []string `json:"preDeploymentEvaluations,omitempty"` // PostDeploymentEvaluations is a list of all evaluations to be performed // during the post-deployment phase of the KeptnWorkload. // The items of this list refer to the names of KeptnEvaluationDefinitions - // located in the same namespace as the KeptnWorkload, or in the KLT namespace. + // located in the same namespace as the KeptnWorkload, or in the Keptn namespace. PostDeploymentEvaluations []string `json:"postDeploymentEvaluations,omitempty"` // ResourceReference is a reference to the Kubernetes resource // (Deployment, DaemonSet, StatefulSet or ReplicaSet) the KeptnWorkload is representing. diff --git a/lifecycle-operator/webhooks/pod_mutator/pod_mutating_webhook.go b/lifecycle-operator/webhooks/pod_mutator/pod_mutating_webhook.go index c291fe56168..b43a3deae41 100644 --- a/lifecycle-operator/webhooks/pod_mutator/pod_mutating_webhook.go +++ b/lifecycle-operator/webhooks/pod_mutator/pod_mutating_webhook.go @@ -69,7 +69,7 @@ func (a *PodMutatingWebhook) Handle(ctx context.Context, req admission.Request) return admission.Errored(http.StatusBadRequest, err) } - // check if Lifecycle Controller is enabled for this namespace + // check if Lifecycle Operator is enabled for this namespace namespace := &corev1.Namespace{} if err = a.Client.Get(ctx, types.NamespacedName{Name: req.Namespace}, namespace); err != nil { logger.Error(err, "could not get namespace", "namespace", req.Namespace) @@ -77,15 +77,15 @@ func (a *PodMutatingWebhook) Handle(ctx context.Context, req admission.Request) } if namespace.GetAnnotations()[apicommon.NamespaceEnabledAnnotation] != "enabled" { - logger.Info("namespace is not enabled for lifecycle controller", "namespace", req.Namespace) - return admission.Allowed("namespace is not enabled for lifecycle controller") + logger.Info("namespace is not enabled for lifecycle operator", "namespace", req.Namespace) + return admission.Allowed("namespace is not enabled for lifecycle operator") } // check the OwnerReference of the pod to see if it is supported and intended to be managed by KLT ownerRef := a.getOwnerReference(pod.ObjectMeta) if ownerRef.Kind == "" { - msg := "owner of pod is not supported by lifecycle controller" + msg := "owner of pod is not supported by lifecycle operator" logger.Info(msg, "namespace", req.Namespace, "pod", req.Name) return admission.Allowed(msg) } diff --git a/runtimes/deno-runtime/README.md b/runtimes/deno-runtime/README.md index 51792db2436..3dec2525e4f 100644 --- a/runtimes/deno-runtime/README.md +++ b/runtimes/deno-runtime/README.md @@ -1,4 +1,4 @@ -# Keptn Lifecycle Controller - Deno Runtime +# Keptn - Deno Runtime ## Build @@ -10,9 +10,9 @@ docker build -t keptnsandbox/klc-runtime:${VERSION} . The Keptn deno runtime uses [Deno](https://deno.com/) to execute Javascript/Typescript code. -The Keptn Lifecycle Toolkit uses this runtime to run [KeptnTask](https://lifecycle.keptn.sh/docs/tasks/write-tasks/) +Keptn uses this runtime to run [KeptnTask](https://lifecycle.keptn.sh/docs/tasks/write-tasks/) for pre- and post-checks. -The Keptn Lifecycle Toolkit passes parameters of `KeptnTask`s and +Keptn passes parameters of `KeptnTask`s and [Context](https://lifecycle.keptn.sh/docs/concepts/tasks/#context) information to the runtime via the special environmental variable `DATA`. It also supports mounting Kubernetes secrets making them accessible via the `SECURE_DATA` env var. @@ -26,7 +26,7 @@ console.log(secret); ``` `KeptnTask`s can be tested locally with the runtime using the following command. -Replace `${VERSION}` with the KLT version of your choice. +Replace `${VERSION}` with the Keptn version of your choice. ```sh docker run -v $(pwd)/test.ts:/test.ts -e SCRIPT=/test.ts -e DATA='{ "url":"http://localhost:9090" }' -e SECURE_DATA='{ "token": "myToken"}' -it ghcr.io/keptn/deno-runtime:${VERSION} diff --git a/runtimes/python-runtime/README.md b/runtimes/python-runtime/README.md index 7e9548e5ea0..ca64db829a3 100644 --- a/runtimes/python-runtime/README.md +++ b/runtimes/python-runtime/README.md @@ -1,4 +1,4 @@ -# Keptn Lifecycle Controller - Python Runtime +# Keptn Python Runtime ## Build @@ -11,13 +11,13 @@ docker build -t lifecycle-toolkit/runtimes/python-runtime:${VERSION} . The Keptn `python-runtime` runner uses python3 and enables the following packages: requests, json, git, yaml -The Keptn Lifecycle Toolkit uses this runner to execute tasks defined as +Keptn uses this runner to execute tasks defined as [KeptnTaskDefinition](https://lifecycle.keptn.sh/docs/yaml-crd-ref/taskdefinition/) resources. for pre- and post-checks. `KeptnTask`s can be tested locally with the runtime using the following commands. -Replace `${VERSION}` with the KLT version of your choice. +Replace `${VERSION}` with the Keptn version of your choice. `SCRIPT` should refer to either a python file mounted locally in the container or to a url containing the file. ### mounting a python file diff --git a/scheduler/README.md b/scheduler/README.md index c46a0ceb7eb..2d2324171fe 100644 --- a/scheduler/README.md +++ b/scheduler/README.md @@ -1,9 +1,9 @@ # Scheduler -The **scheduler** is a pivotal component within the -[Keptn Lifecycle Toolkit](https://main.lifecycle.keptn.sh/) that plays a crucial role in orchestrating the deployment process. +The **scheduler** is a pivotal component within +[Keptn](https://lifecycle.keptn.sh/) that plays a crucial role in orchestrating the deployment process. By ensuring that Pods are scheduled onto nodes only after successful pre-deployment checks, the scheduler minimizes errors and downtimes. For detailed information about scheduler's functionality and how it works, please refer to -the [Keptn Lifecycle Toolkit Scheduler Documentation](https://main.lifecycle.keptn.sh/docs/concepts/architecture/components/scheduler/). +the [Keptn Scheduler Architecture](https://lifecycle.keptn.sh/docs/concepts/architecture/components/scheduler/) section. From c365734fa7e3e40b2ae4c97c61628892d040dacc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:16:26 +0200 Subject: [PATCH 53/78] deps: update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 440c308 (#2017) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- lifecycle-operator/go.mod | 2 +- lifecycle-operator/go.sum | 4 ++-- metrics-operator/go.mod | 2 +- metrics-operator/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lifecycle-operator/go.mod b/lifecycle-operator/go.mod index dea3d8cf55e..d684cdff819 100644 --- a/lifecycle-operator/go.mod +++ b/lifecycle-operator/go.mod @@ -9,7 +9,7 @@ require ( github.com/cloudevents/sdk-go/v2 v2.14.0 github.com/go-logr/logr v1.2.4 github.com/kelseyhightower/envconfig v1.4.0 - github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f + github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230905110433-440c3082e540 github.com/magiconair/properties v1.8.7 github.com/onsi/ginkgo/v2 v2.12.0 github.com/onsi/gomega v1.27.10 diff --git a/lifecycle-operator/go.sum b/lifecycle-operator/go.sum index e7eefba878d..8e439e0c0ba 100644 --- a/lifecycle-operator/go.sum +++ b/lifecycle-operator/go.sum @@ -202,8 +202,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f h1:aKMtACmfrS++heUT5WNpV5hzMTVCwZDt+Lh1sBiSRmM= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f/go.mod h1:d+4PMPRSDRLXgyFXdpJZut/j/xRRES6RV+mc4dYNAoA= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230905110433-440c3082e540 h1:+7QEt5AAXj2Sls+uzQadWsXBig8xmRpBn3YMTYaf5AA= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230905110433-440c3082e540/go.mod h1:d+4PMPRSDRLXgyFXdpJZut/j/xRRES6RV+mc4dYNAoA= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index f199dc83356..670dc0f1c55 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-logr/logr v1.2.4 github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f + github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230905110433-440c3082e540 github.com/open-feature/go-sdk v1.7.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 diff --git a/metrics-operator/go.sum b/metrics-operator/go.sum index 85450f2a118..386e57cd671 100644 --- a/metrics-operator/go.sum +++ b/metrics-operator/go.sum @@ -266,8 +266,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f h1:aKMtACmfrS++heUT5WNpV5hzMTVCwZDt+Lh1sBiSRmM= -github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230904065758-8dbec2d6116f/go.mod h1:d+4PMPRSDRLXgyFXdpJZut/j/xRRES6RV+mc4dYNAoA= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230905110433-440c3082e540 h1:+7QEt5AAXj2Sls+uzQadWsXBig8xmRpBn3YMTYaf5AA= +github.com/keptn/lifecycle-toolkit/klt-cert-manager v0.0.0-20230905110433-440c3082e540/go.mod h1:d+4PMPRSDRLXgyFXdpJZut/j/xRRES6RV+mc4dYNAoA= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= From 12d0f40725e466825c4a0d483fa344e5888b03ae Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:39:43 +0200 Subject: [PATCH 54/78] chore(main): release lifecycle-operator-and-scheduler libraries (#1979) --- .release-please-manifest.json | 2 +- lifecycle-operator/CHANGELOG.md | 50 +++++++++++++++++++++++++++++++++ lifecycle-operator/Makefile | 2 +- scheduler/CHANGELOG.md | 28 ++++++++++++++++++ scheduler/Makefile | 2 +- 5 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 lifecycle-operator/CHANGELOG.md create mode 100644 scheduler/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7075efa2293..53f6ee1a514 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1","lifecycle-operator":"0.8.1","scheduler":"0.8.1"} +{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1","lifecycle-operator":"0.8.2","scheduler":"0.8.2"} diff --git a/lifecycle-operator/CHANGELOG.md b/lifecycle-operator/CHANGELOG.md new file mode 100644 index 00000000000..26fdaeb0ac3 --- /dev/null +++ b/lifecycle-operator/CHANGELOG.md @@ -0,0 +1,50 @@ +# Changelog + +## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/lifecycle-operator-v0.8.1...lifecycle-operator-v0.8.2) (2023-09-05) + + +### Features + +* add cloud events support ([#1843](https://github.com/keptn/lifecycle-toolkit/issues/1843)) ([5b47120](https://github.com/keptn/lifecycle-toolkit/commit/5b471203e412a919903876212ac45c04f180e482)) +* **lifecycle-operator:** clean up KeptnTask API by removing duplicated attributes ([#1965](https://github.com/keptn/lifecycle-toolkit/issues/1965)) ([257b220](https://github.com/keptn/lifecycle-toolkit/commit/257b220a6171ccc82d1b471002b6cf773ec9bd09)) +* **metrics-operator:** add analysis controller ([#1875](https://github.com/keptn/lifecycle-toolkit/issues/1875)) ([017e08b](https://github.com/keptn/lifecycle-toolkit/commit/017e08b0a65679ca417e363f2223b7f4fef3bc55)) +* **metrics-operator:** add Analysis CRD ([#1839](https://github.com/keptn/lifecycle-toolkit/issues/1839)) ([9521a16](https://github.com/keptn/lifecycle-toolkit/commit/9521a16ce4946d3169993780f2d2a4f3a75d0445)) +* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) + + +### Bug Fixes + +* **lifecycle-operator:** avoid setting the overall state of an App or WorkloadInstance between state transitions ([#1871](https://github.com/keptn/lifecycle-toolkit/issues/1871)) ([ee0b085](https://github.com/keptn/lifecycle-toolkit/commit/ee0b085b05b2b9781457eba34d5d1050b3c7a604)) + + +### Other + +* rename operator folder to lifecycle-operator ([#1819](https://github.com/keptn/lifecycle-toolkit/issues/1819)) ([97a2d25](https://github.com/keptn/lifecycle-toolkit/commit/97a2d25919c0a02165dd0dc6c7c82d57ad200139)) + + +### Docs + +* fix typos and grammar issues ([#1925](https://github.com/keptn/lifecycle-toolkit/issues/1925)) ([5570d55](https://github.com/keptn/lifecycle-toolkit/commit/5570d555bfc4bbdcbfc66b2725d5352090e5b937)) +* implement KLT -> Keptn name change ([#2001](https://github.com/keptn/lifecycle-toolkit/issues/2001)) ([440c308](https://github.com/keptn/lifecycle-toolkit/commit/440c3082e5400f89d791724651984ba2bc0a4724)) + + +### Dependency Updates + +* update dependency kubernetes-sigs/controller-tools to v0.13.0 ([#1930](https://github.com/keptn/lifecycle-toolkit/issues/1930)) ([8b34b63](https://github.com/keptn/lifecycle-toolkit/commit/8b34b63404d0339633ef41ff1cf2005deae8d2b7)) +* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 440c308 ([#2017](https://github.com/keptn/lifecycle-toolkit/issues/2017)) ([c365734](https://github.com/keptn/lifecycle-toolkit/commit/c365734fa7e3e40b2ae4c97c61628892d040dacc)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 88a54f9 ([#1794](https://github.com/keptn/lifecycle-toolkit/issues/1794)) ([fc976eb](https://github.com/keptn/lifecycle-toolkit/commit/fc976eb07ed9a5e49ed7d4ab1dbf187cee583e64)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 8dbec2d ([#1995](https://github.com/keptn/lifecycle-toolkit/issues/1995)) ([2f51445](https://github.com/keptn/lifecycle-toolkit/commit/2f5144540c4b3876e800bff29c30bfded334be40)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to bb133cf ([#1963](https://github.com/keptn/lifecycle-toolkit/issues/1963)) ([c7697bf](https://github.com/keptn/lifecycle-toolkit/commit/c7697bf54d5fe18b7c62c5b11801c6c83079b0a3)) +* update kubernetes packages to v0.26.8 (patch) ([#1945](https://github.com/keptn/lifecycle-toolkit/issues/1945)) ([6ce03d6](https://github.com/keptn/lifecycle-toolkit/commit/6ce03d600cbb3d3d3988573c616ec7f3830ba324)) +* update module github.com/onsi/ginkgo/v2 to v2.12.0 ([#2019](https://github.com/keptn/lifecycle-toolkit/issues/2019)) ([41e878f](https://github.com/keptn/lifecycle-toolkit/commit/41e878ff8bbb438efa4b221470a571687dd392e9)) +* update module github.com/onsi/gomega to v1.27.10 ([#1796](https://github.com/keptn/lifecycle-toolkit/issues/1796)) ([8f14bff](https://github.com/keptn/lifecycle-toolkit/commit/8f14bffe27485a36e0b05b770a01e357402d92f7)) +* update module golang.org/x/net to v0.14.0 ([#1855](https://github.com/keptn/lifecycle-toolkit/issues/1855)) ([3186188](https://github.com/keptn/lifecycle-toolkit/commit/31861889bf7b227f489b941ac4a52db86551fcc2)) +* update module google.golang.org/grpc to v1.57.0 ([#1861](https://github.com/keptn/lifecycle-toolkit/issues/1861)) ([fdcbdf5](https://github.com/keptn/lifecycle-toolkit/commit/fdcbdf50365dfd69d16c679c6814e89570a8a0e2)) +* update opentelemetry-go monorepo (minor) ([#1931](https://github.com/keptn/lifecycle-toolkit/issues/1931)) ([a0a1a7e](https://github.com/keptn/lifecycle-toolkit/commit/a0a1a7e97906ab56ed85da7ab9b6d1e13c902397)) + + +### Refactoring + +* **lifecycle-operator:** eventing and telemetry ([#1844](https://github.com/keptn/lifecycle-toolkit/issues/1844)) ([0130576](https://github.com/keptn/lifecycle-toolkit/commit/0130576a17a78453019c150af849c06553d799a6)) +* **lifecycle-operator:** refactor event emitter unit tests ([#1867](https://github.com/keptn/lifecycle-toolkit/issues/1867)) ([2558f74](https://github.com/keptn/lifecycle-toolkit/commit/2558f742031e4d38a8006ce9894f41bddac7cd3f)) diff --git a/lifecycle-operator/Makefile b/lifecycle-operator/Makefile index 70826b91061..8325fc123e3 100644 --- a/lifecycle-operator/Makefile +++ b/lifecycle-operator/Makefile @@ -7,7 +7,7 @@ RELEASE_REGISTRY?=ghcr.io/keptn RELEASE_TIME=$(shell date +%Y%m%d%s) BUILD_TIME=$(shell date -u "+%F_%T") RELEASE_VERSION?=$(RELEASE_TIME)-v0.24.3#$(shell git describe --tags --match "v*") -TAG?="v0.8.1" # x-release-please-version +TAG?="v0.8.2" # x-release-please-version RELEASE_IMAGE:=lifecycle-operator:$(TAG) CHART_APPVERSION?="" diff --git a/scheduler/CHANGELOG.md b/scheduler/CHANGELOG.md new file mode 100644 index 00000000000..b64ebf58b15 --- /dev/null +++ b/scheduler/CHANGELOG.md @@ -0,0 +1,28 @@ +# Changelog + +## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/scheduler-v0.8.1...scheduler-v0.8.2) (2023-09-05) + + +### Other + +* fix minor security issues ([#1728](https://github.com/keptn/lifecycle-toolkit/issues/1728)) ([ea73cd9](https://github.com/keptn/lifecycle-toolkit/commit/ea73cd983102632fb162e1b4c8ae56687b288b25)) + + +### Docs + +* implement KLT -> Keptn name change ([#2001](https://github.com/keptn/lifecycle-toolkit/issues/2001)) ([440c308](https://github.com/keptn/lifecycle-toolkit/commit/440c3082e5400f89d791724651984ba2bc0a4724)) +* keptn Scheduler architecture documentation ([#1777](https://github.com/keptn/lifecycle-toolkit/issues/1777)) ([ce96200](https://github.com/keptn/lifecycle-toolkit/commit/ce96200b9bfed62062b199845104c4493b3a2627)) + + +### Dependency Updates + +* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) +* update kubernetes packages (patch) ([#1786](https://github.com/keptn/lifecycle-toolkit/issues/1786)) ([cba2de5](https://github.com/keptn/lifecycle-toolkit/commit/cba2de5a5cd04c094131552aaf92c2b85ac23d21)) +* update module github.com/onsi/ginkgo/v2 to v2.12.0 ([#2019](https://github.com/keptn/lifecycle-toolkit/issues/2019)) ([41e878f](https://github.com/keptn/lifecycle-toolkit/commit/41e878ff8bbb438efa4b221470a571687dd392e9)) +* update module github.com/onsi/gomega to v1.27.10 ([#1796](https://github.com/keptn/lifecycle-toolkit/issues/1796)) ([8f14bff](https://github.com/keptn/lifecycle-toolkit/commit/8f14bffe27485a36e0b05b770a01e357402d92f7)) +* update module github.com/onsi/gomega to v1.27.9 ([#1787](https://github.com/keptn/lifecycle-toolkit/issues/1787)) ([90b6ce9](https://github.com/keptn/lifecycle-toolkit/commit/90b6ce92253f52a43f3c13dddaa918ca73b515d0)) +* update module golang.org/x/net to v0.12.0 ([#1662](https://github.com/keptn/lifecycle-toolkit/issues/1662)) ([49318bf](https://github.com/keptn/lifecycle-toolkit/commit/49318bfc40497a120304de9d831dfe033259220f)) +* update module golang.org/x/net to v0.14.0 ([#1855](https://github.com/keptn/lifecycle-toolkit/issues/1855)) ([3186188](https://github.com/keptn/lifecycle-toolkit/commit/31861889bf7b227f489b941ac4a52db86551fcc2)) +* update module google.golang.org/grpc to v1.56.2 ([#1663](https://github.com/keptn/lifecycle-toolkit/issues/1663)) ([0b618c4](https://github.com/keptn/lifecycle-toolkit/commit/0b618c4bf15209fbb81ec7c05f1d05543bdfd1cf)) +* update module google.golang.org/grpc to v1.57.0 ([#1861](https://github.com/keptn/lifecycle-toolkit/issues/1861)) ([fdcbdf5](https://github.com/keptn/lifecycle-toolkit/commit/fdcbdf50365dfd69d16c679c6814e89570a8a0e2)) +* update module k8s.io/kubernetes to v1.25.13 ([#1958](https://github.com/keptn/lifecycle-toolkit/issues/1958)) ([fb23f09](https://github.com/keptn/lifecycle-toolkit/commit/fb23f0948aa0395636b1290f3c7b3b28cbf54976)) diff --git a/scheduler/Makefile b/scheduler/Makefile index 069f0c761eb..3e4ed62b577 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -15,7 +15,7 @@ ARCHS = amd64 arm64 COMMONENVVAR=GOOS=$(shell uname -s | tr A-Z a-z) BUILDENVVAR=CGO_ENABLED=0 -TAG?="v0.8.1" # x-release-please-version +TAG?="v0.8.2" # x-release-please-version CHART_APPVERSION?="" LOCAL_REGISTRY=localhost:5000/scheduler-plugins From f3228865da9693df44ddf40896aa9398a78d0a86 Mon Sep 17 00:00:00 2001 From: Giovanni Liva Date: Tue, 5 Sep 2023 14:21:58 +0200 Subject: [PATCH 55/78] revert: chore(main): release lifecycle-operator-and-scheduler libraries (#2027) --- .release-please-manifest.json | 2 +- lifecycle-operator/CHANGELOG.md | 50 --------------------------------- lifecycle-operator/Makefile | 2 +- scheduler/CHANGELOG.md | 28 ------------------ scheduler/Makefile | 2 +- 5 files changed, 3 insertions(+), 81 deletions(-) delete mode 100644 lifecycle-operator/CHANGELOG.md delete mode 100644 scheduler/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 53f6ee1a514..7075efa2293 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1","lifecycle-operator":"0.8.2","scheduler":"0.8.2"} +{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1","lifecycle-operator":"0.8.1","scheduler":"0.8.1"} diff --git a/lifecycle-operator/CHANGELOG.md b/lifecycle-operator/CHANGELOG.md deleted file mode 100644 index 26fdaeb0ac3..00000000000 --- a/lifecycle-operator/CHANGELOG.md +++ /dev/null @@ -1,50 +0,0 @@ -# Changelog - -## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/lifecycle-operator-v0.8.1...lifecycle-operator-v0.8.2) (2023-09-05) - - -### Features - -* add cloud events support ([#1843](https://github.com/keptn/lifecycle-toolkit/issues/1843)) ([5b47120](https://github.com/keptn/lifecycle-toolkit/commit/5b471203e412a919903876212ac45c04f180e482)) -* **lifecycle-operator:** clean up KeptnTask API by removing duplicated attributes ([#1965](https://github.com/keptn/lifecycle-toolkit/issues/1965)) ([257b220](https://github.com/keptn/lifecycle-toolkit/commit/257b220a6171ccc82d1b471002b6cf773ec9bd09)) -* **metrics-operator:** add analysis controller ([#1875](https://github.com/keptn/lifecycle-toolkit/issues/1875)) ([017e08b](https://github.com/keptn/lifecycle-toolkit/commit/017e08b0a65679ca417e363f2223b7f4fef3bc55)) -* **metrics-operator:** add Analysis CRD ([#1839](https://github.com/keptn/lifecycle-toolkit/issues/1839)) ([9521a16](https://github.com/keptn/lifecycle-toolkit/commit/9521a16ce4946d3169993780f2d2a4f3a75d0445)) -* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) - - -### Bug Fixes - -* **lifecycle-operator:** avoid setting the overall state of an App or WorkloadInstance between state transitions ([#1871](https://github.com/keptn/lifecycle-toolkit/issues/1871)) ([ee0b085](https://github.com/keptn/lifecycle-toolkit/commit/ee0b085b05b2b9781457eba34d5d1050b3c7a604)) - - -### Other - -* rename operator folder to lifecycle-operator ([#1819](https://github.com/keptn/lifecycle-toolkit/issues/1819)) ([97a2d25](https://github.com/keptn/lifecycle-toolkit/commit/97a2d25919c0a02165dd0dc6c7c82d57ad200139)) - - -### Docs - -* fix typos and grammar issues ([#1925](https://github.com/keptn/lifecycle-toolkit/issues/1925)) ([5570d55](https://github.com/keptn/lifecycle-toolkit/commit/5570d555bfc4bbdcbfc66b2725d5352090e5b937)) -* implement KLT -> Keptn name change ([#2001](https://github.com/keptn/lifecycle-toolkit/issues/2001)) ([440c308](https://github.com/keptn/lifecycle-toolkit/commit/440c3082e5400f89d791724651984ba2bc0a4724)) - - -### Dependency Updates - -* update dependency kubernetes-sigs/controller-tools to v0.13.0 ([#1930](https://github.com/keptn/lifecycle-toolkit/issues/1930)) ([8b34b63](https://github.com/keptn/lifecycle-toolkit/commit/8b34b63404d0339633ef41ff1cf2005deae8d2b7)) -* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) -* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 440c308 ([#2017](https://github.com/keptn/lifecycle-toolkit/issues/2017)) ([c365734](https://github.com/keptn/lifecycle-toolkit/commit/c365734fa7e3e40b2ae4c97c61628892d040dacc)) -* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 88a54f9 ([#1794](https://github.com/keptn/lifecycle-toolkit/issues/1794)) ([fc976eb](https://github.com/keptn/lifecycle-toolkit/commit/fc976eb07ed9a5e49ed7d4ab1dbf187cee583e64)) -* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 8dbec2d ([#1995](https://github.com/keptn/lifecycle-toolkit/issues/1995)) ([2f51445](https://github.com/keptn/lifecycle-toolkit/commit/2f5144540c4b3876e800bff29c30bfded334be40)) -* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to bb133cf ([#1963](https://github.com/keptn/lifecycle-toolkit/issues/1963)) ([c7697bf](https://github.com/keptn/lifecycle-toolkit/commit/c7697bf54d5fe18b7c62c5b11801c6c83079b0a3)) -* update kubernetes packages to v0.26.8 (patch) ([#1945](https://github.com/keptn/lifecycle-toolkit/issues/1945)) ([6ce03d6](https://github.com/keptn/lifecycle-toolkit/commit/6ce03d600cbb3d3d3988573c616ec7f3830ba324)) -* update module github.com/onsi/ginkgo/v2 to v2.12.0 ([#2019](https://github.com/keptn/lifecycle-toolkit/issues/2019)) ([41e878f](https://github.com/keptn/lifecycle-toolkit/commit/41e878ff8bbb438efa4b221470a571687dd392e9)) -* update module github.com/onsi/gomega to v1.27.10 ([#1796](https://github.com/keptn/lifecycle-toolkit/issues/1796)) ([8f14bff](https://github.com/keptn/lifecycle-toolkit/commit/8f14bffe27485a36e0b05b770a01e357402d92f7)) -* update module golang.org/x/net to v0.14.0 ([#1855](https://github.com/keptn/lifecycle-toolkit/issues/1855)) ([3186188](https://github.com/keptn/lifecycle-toolkit/commit/31861889bf7b227f489b941ac4a52db86551fcc2)) -* update module google.golang.org/grpc to v1.57.0 ([#1861](https://github.com/keptn/lifecycle-toolkit/issues/1861)) ([fdcbdf5](https://github.com/keptn/lifecycle-toolkit/commit/fdcbdf50365dfd69d16c679c6814e89570a8a0e2)) -* update opentelemetry-go monorepo (minor) ([#1931](https://github.com/keptn/lifecycle-toolkit/issues/1931)) ([a0a1a7e](https://github.com/keptn/lifecycle-toolkit/commit/a0a1a7e97906ab56ed85da7ab9b6d1e13c902397)) - - -### Refactoring - -* **lifecycle-operator:** eventing and telemetry ([#1844](https://github.com/keptn/lifecycle-toolkit/issues/1844)) ([0130576](https://github.com/keptn/lifecycle-toolkit/commit/0130576a17a78453019c150af849c06553d799a6)) -* **lifecycle-operator:** refactor event emitter unit tests ([#1867](https://github.com/keptn/lifecycle-toolkit/issues/1867)) ([2558f74](https://github.com/keptn/lifecycle-toolkit/commit/2558f742031e4d38a8006ce9894f41bddac7cd3f)) diff --git a/lifecycle-operator/Makefile b/lifecycle-operator/Makefile index 8325fc123e3..70826b91061 100644 --- a/lifecycle-operator/Makefile +++ b/lifecycle-operator/Makefile @@ -7,7 +7,7 @@ RELEASE_REGISTRY?=ghcr.io/keptn RELEASE_TIME=$(shell date +%Y%m%d%s) BUILD_TIME=$(shell date -u "+%F_%T") RELEASE_VERSION?=$(RELEASE_TIME)-v0.24.3#$(shell git describe --tags --match "v*") -TAG?="v0.8.2" # x-release-please-version +TAG?="v0.8.1" # x-release-please-version RELEASE_IMAGE:=lifecycle-operator:$(TAG) CHART_APPVERSION?="" diff --git a/scheduler/CHANGELOG.md b/scheduler/CHANGELOG.md deleted file mode 100644 index b64ebf58b15..00000000000 --- a/scheduler/CHANGELOG.md +++ /dev/null @@ -1,28 +0,0 @@ -# Changelog - -## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/scheduler-v0.8.1...scheduler-v0.8.2) (2023-09-05) - - -### Other - -* fix minor security issues ([#1728](https://github.com/keptn/lifecycle-toolkit/issues/1728)) ([ea73cd9](https://github.com/keptn/lifecycle-toolkit/commit/ea73cd983102632fb162e1b4c8ae56687b288b25)) - - -### Docs - -* implement KLT -> Keptn name change ([#2001](https://github.com/keptn/lifecycle-toolkit/issues/2001)) ([440c308](https://github.com/keptn/lifecycle-toolkit/commit/440c3082e5400f89d791724651984ba2bc0a4724)) -* keptn Scheduler architecture documentation ([#1777](https://github.com/keptn/lifecycle-toolkit/issues/1777)) ([ce96200](https://github.com/keptn/lifecycle-toolkit/commit/ce96200b9bfed62062b199845104c4493b3a2627)) - - -### Dependency Updates - -* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) -* update kubernetes packages (patch) ([#1786](https://github.com/keptn/lifecycle-toolkit/issues/1786)) ([cba2de5](https://github.com/keptn/lifecycle-toolkit/commit/cba2de5a5cd04c094131552aaf92c2b85ac23d21)) -* update module github.com/onsi/ginkgo/v2 to v2.12.0 ([#2019](https://github.com/keptn/lifecycle-toolkit/issues/2019)) ([41e878f](https://github.com/keptn/lifecycle-toolkit/commit/41e878ff8bbb438efa4b221470a571687dd392e9)) -* update module github.com/onsi/gomega to v1.27.10 ([#1796](https://github.com/keptn/lifecycle-toolkit/issues/1796)) ([8f14bff](https://github.com/keptn/lifecycle-toolkit/commit/8f14bffe27485a36e0b05b770a01e357402d92f7)) -* update module github.com/onsi/gomega to v1.27.9 ([#1787](https://github.com/keptn/lifecycle-toolkit/issues/1787)) ([90b6ce9](https://github.com/keptn/lifecycle-toolkit/commit/90b6ce92253f52a43f3c13dddaa918ca73b515d0)) -* update module golang.org/x/net to v0.12.0 ([#1662](https://github.com/keptn/lifecycle-toolkit/issues/1662)) ([49318bf](https://github.com/keptn/lifecycle-toolkit/commit/49318bfc40497a120304de9d831dfe033259220f)) -* update module golang.org/x/net to v0.14.0 ([#1855](https://github.com/keptn/lifecycle-toolkit/issues/1855)) ([3186188](https://github.com/keptn/lifecycle-toolkit/commit/31861889bf7b227f489b941ac4a52db86551fcc2)) -* update module google.golang.org/grpc to v1.56.2 ([#1663](https://github.com/keptn/lifecycle-toolkit/issues/1663)) ([0b618c4](https://github.com/keptn/lifecycle-toolkit/commit/0b618c4bf15209fbb81ec7c05f1d05543bdfd1cf)) -* update module google.golang.org/grpc to v1.57.0 ([#1861](https://github.com/keptn/lifecycle-toolkit/issues/1861)) ([fdcbdf5](https://github.com/keptn/lifecycle-toolkit/commit/fdcbdf50365dfd69d16c679c6814e89570a8a0e2)) -* update module k8s.io/kubernetes to v1.25.13 ([#1958](https://github.com/keptn/lifecycle-toolkit/issues/1958)) ([fb23f09](https://github.com/keptn/lifecycle-toolkit/commit/fb23f0948aa0395636b1290f3c7b3b28cbf54976)) diff --git a/scheduler/Makefile b/scheduler/Makefile index 3e4ed62b577..069f0c761eb 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -15,7 +15,7 @@ ARCHS = amd64 arm64 COMMONENVVAR=GOOS=$(shell uname -s | tr A-Z a-z) BUILDENVVAR=CGO_ENABLED=0 -TAG?="v0.8.2" # x-release-please-version +TAG?="v0.8.1" # x-release-please-version CHART_APPVERSION?="" LOCAL_REGISTRY=localhost:5000/scheduler-plugins From 34aca0b036665502461edee4821179b55743737f Mon Sep 17 00:00:00 2001 From: Giovanni Liva Date: Tue, 5 Sep 2023 14:41:46 +0200 Subject: [PATCH 56/78] ci: fix release please version for metric-operator (#2025) --- .release-please-manifest.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7075efa2293..74c52b69ec0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1,9 @@ -{".":"0.8.1","klt-cert-manager":"1.1.0","runtimes/python-runtime":"1.0.0","runtimes/deno-runtime":"1.0.1","lifecycle-operator":"0.8.1","scheduler":"0.8.1"} +{ + ".": "0.8.1", + "klt-cert-manager": "1.1.0", + "runtimes/python-runtime": "1.0.0", + "runtimes/deno-runtime": "1.0.1", + "lifecycle-operator": "0.8.1", + "scheduler": "0.8.1", + "metrics-operator": "0.8.1" +} From e0e30e003c5c54e2e0b4c7728e2735fceaeda87f Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Tue, 5 Sep 2023 14:50:08 +0200 Subject: [PATCH 57/78] ci: fix release matrix again and again and again (#2029) --- .github/workflows/release.yml | 2 +- release-please-config.json | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e49deab561f..b0c3c52ec5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ env: # renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools CONTROLLER_TOOLS_VERSION: "v0.13.0" SCHEDULER_COMPATIBLE_K8S_VERSION: "v0.24.3" - PUBLISHABLE_ITEMS: '[".", "lifecycle-operator", "metrics-operator", "klt-cert-manager", "runtimes/deno-runtime", "runtimes/python-runtime"]' + PUBLISHABLE_ITEMS: '[".", "lifecycle-operator", "metrics-operator", "klt-cert-manager", "runtimes/deno-runtime", "runtimes/python-runtime", "scheduler"]' jobs: release-please: diff --git a/release-please-config.json b/release-please-config.json index 9b9d57efb1c..327207c302b 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -92,17 +92,6 @@ "draft": false } }, - "plugins": [ - { - "type": "linked-versions", - "groupName": "lifecycle-operator-and-scheduler", - "components": [ - "lifecycle-operator", - "scheduler" - ], - "merge": true - } - ], "changelog-sections": [ { "type": "feat", From cb4d2b14a7a772572b505fa844db6f08a45db291 Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Tue, 5 Sep 2023 15:20:51 +0200 Subject: [PATCH 58/78] chore: release scheduler 0.8.2 (#2032) --- .release-please-manifest.json | 2 +- scheduler/CHANGELOG.md | 29 +++++++++++++++++++++++++++++ scheduler/Makefile | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 scheduler/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 74c52b69ec0..5e21f7ed268 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -4,6 +4,6 @@ "runtimes/python-runtime": "1.0.0", "runtimes/deno-runtime": "1.0.1", "lifecycle-operator": "0.8.1", - "scheduler": "0.8.1", + "scheduler": "0.8.2", "metrics-operator": "0.8.1" } diff --git a/scheduler/CHANGELOG.md b/scheduler/CHANGELOG.md new file mode 100644 index 00000000000..3368861e1b1 --- /dev/null +++ b/scheduler/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/scheduler-v0.8.1...scheduler-v0.8.2) (2023-09-05) + + +### Other + +* fix minor security issues ([#1728](https://github.com/keptn/lifecycle-toolkit/issues/1728)) ([ea73cd9](https://github.com/keptn/lifecycle-toolkit/commit/ea73cd983102632fb162e1b4c8ae56687b288b25)) +* **main:** release lifecycle-operator-and-scheduler libraries ([#1979](https://github.com/keptn/lifecycle-toolkit/issues/1979)) ([12d0f40](https://github.com/keptn/lifecycle-toolkit/commit/12d0f40725e466825c4a0d483fa344e5888b03ae)) + + +### Docs + +* implement KLT -> Keptn name change ([#2001](https://github.com/keptn/lifecycle-toolkit/issues/2001)) ([440c308](https://github.com/keptn/lifecycle-toolkit/commit/440c3082e5400f89d791724651984ba2bc0a4724)) +* keptn Scheduler architecture documentation ([#1777](https://github.com/keptn/lifecycle-toolkit/issues/1777)) ([ce96200](https://github.com/keptn/lifecycle-toolkit/commit/ce96200b9bfed62062b199845104c4493b3a2627)) + + +### Dependency Updates + +* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) +* update kubernetes packages (patch) ([#1786](https://github.com/keptn/lifecycle-toolkit/issues/1786)) ([cba2de5](https://github.com/keptn/lifecycle-toolkit/commit/cba2de5a5cd04c094131552aaf92c2b85ac23d21)) +* update module github.com/onsi/ginkgo/v2 to v2.12.0 ([#2019](https://github.com/keptn/lifecycle-toolkit/issues/2019)) ([41e878f](https://github.com/keptn/lifecycle-toolkit/commit/41e878ff8bbb438efa4b221470a571687dd392e9)) +* update module github.com/onsi/gomega to v1.27.10 ([#1796](https://github.com/keptn/lifecycle-toolkit/issues/1796)) ([8f14bff](https://github.com/keptn/lifecycle-toolkit/commit/8f14bffe27485a36e0b05b770a01e357402d92f7)) +* update module github.com/onsi/gomega to v1.27.9 ([#1787](https://github.com/keptn/lifecycle-toolkit/issues/1787)) ([90b6ce9](https://github.com/keptn/lifecycle-toolkit/commit/90b6ce92253f52a43f3c13dddaa918ca73b515d0)) +* update module golang.org/x/net to v0.12.0 ([#1662](https://github.com/keptn/lifecycle-toolkit/issues/1662)) ([49318bf](https://github.com/keptn/lifecycle-toolkit/commit/49318bfc40497a120304de9d831dfe033259220f)) +* update module golang.org/x/net to v0.14.0 ([#1855](https://github.com/keptn/lifecycle-toolkit/issues/1855)) ([3186188](https://github.com/keptn/lifecycle-toolkit/commit/31861889bf7b227f489b941ac4a52db86551fcc2)) +* update module google.golang.org/grpc to v1.56.2 ([#1663](https://github.com/keptn/lifecycle-toolkit/issues/1663)) ([0b618c4](https://github.com/keptn/lifecycle-toolkit/commit/0b618c4bf15209fbb81ec7c05f1d05543bdfd1cf)) +* update module google.golang.org/grpc to v1.57.0 ([#1861](https://github.com/keptn/lifecycle-toolkit/issues/1861)) ([fdcbdf5](https://github.com/keptn/lifecycle-toolkit/commit/fdcbdf50365dfd69d16c679c6814e89570a8a0e2)) +* update module k8s.io/kubernetes to v1.25.13 ([#1958](https://github.com/keptn/lifecycle-toolkit/issues/1958)) ([fb23f09](https://github.com/keptn/lifecycle-toolkit/commit/fb23f0948aa0395636b1290f3c7b3b28cbf54976)) diff --git a/scheduler/Makefile b/scheduler/Makefile index 069f0c761eb..3e4ed62b577 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -15,7 +15,7 @@ ARCHS = amd64 arm64 COMMONENVVAR=GOOS=$(shell uname -s | tr A-Z a-z) BUILDENVVAR=CGO_ENABLED=0 -TAG?="v0.8.1" # x-release-please-version +TAG?="v0.8.2" # x-release-please-version CHART_APPVERSION?="" LOCAL_REGISTRY=localhost:5000/scheduler-plugins From 07cc3a9bbfefa3558dfac7dfae5b92abe8d25eb5 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Tue, 5 Sep 2023 15:41:20 +0200 Subject: [PATCH 59/78] ci: fix release matrix again again again again (#2034) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0c3c52ec5f..d59596576ad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -123,7 +123,7 @@ jobs: } }); console.log("release matrix: " + JSON.stringify({ config: releaseMatrix })); - return { config: releaseMatrix }; + return releaseMatrix.length > 0 ? { config: releaseMatrix } : {}; build-release: if: needs.release-please.outputs.releases-created == 'true' From dff41fe85918ce3d80a59005720ac3acb4d8f625 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Wed, 6 Sep 2023 09:08:13 +0200 Subject: [PATCH 60/78] revert: revert "chore: release scheduler 0.8.2" (#2036) --- .release-please-manifest.json | 2 +- scheduler/CHANGELOG.md | 29 ----------------------------- scheduler/Makefile | 2 +- 3 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 scheduler/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5e21f7ed268..74c52b69ec0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -4,6 +4,6 @@ "runtimes/python-runtime": "1.0.0", "runtimes/deno-runtime": "1.0.1", "lifecycle-operator": "0.8.1", - "scheduler": "0.8.2", + "scheduler": "0.8.1", "metrics-operator": "0.8.1" } diff --git a/scheduler/CHANGELOG.md b/scheduler/CHANGELOG.md deleted file mode 100644 index 3368861e1b1..00000000000 --- a/scheduler/CHANGELOG.md +++ /dev/null @@ -1,29 +0,0 @@ -# Changelog - -## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/scheduler-v0.8.1...scheduler-v0.8.2) (2023-09-05) - - -### Other - -* fix minor security issues ([#1728](https://github.com/keptn/lifecycle-toolkit/issues/1728)) ([ea73cd9](https://github.com/keptn/lifecycle-toolkit/commit/ea73cd983102632fb162e1b4c8ae56687b288b25)) -* **main:** release lifecycle-operator-and-scheduler libraries ([#1979](https://github.com/keptn/lifecycle-toolkit/issues/1979)) ([12d0f40](https://github.com/keptn/lifecycle-toolkit/commit/12d0f40725e466825c4a0d483fa344e5888b03ae)) - - -### Docs - -* implement KLT -> Keptn name change ([#2001](https://github.com/keptn/lifecycle-toolkit/issues/2001)) ([440c308](https://github.com/keptn/lifecycle-toolkit/commit/440c3082e5400f89d791724651984ba2bc0a4724)) -* keptn Scheduler architecture documentation ([#1777](https://github.com/keptn/lifecycle-toolkit/issues/1777)) ([ce96200](https://github.com/keptn/lifecycle-toolkit/commit/ce96200b9bfed62062b199845104c4493b3a2627)) - - -### Dependency Updates - -* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) -* update kubernetes packages (patch) ([#1786](https://github.com/keptn/lifecycle-toolkit/issues/1786)) ([cba2de5](https://github.com/keptn/lifecycle-toolkit/commit/cba2de5a5cd04c094131552aaf92c2b85ac23d21)) -* update module github.com/onsi/ginkgo/v2 to v2.12.0 ([#2019](https://github.com/keptn/lifecycle-toolkit/issues/2019)) ([41e878f](https://github.com/keptn/lifecycle-toolkit/commit/41e878ff8bbb438efa4b221470a571687dd392e9)) -* update module github.com/onsi/gomega to v1.27.10 ([#1796](https://github.com/keptn/lifecycle-toolkit/issues/1796)) ([8f14bff](https://github.com/keptn/lifecycle-toolkit/commit/8f14bffe27485a36e0b05b770a01e357402d92f7)) -* update module github.com/onsi/gomega to v1.27.9 ([#1787](https://github.com/keptn/lifecycle-toolkit/issues/1787)) ([90b6ce9](https://github.com/keptn/lifecycle-toolkit/commit/90b6ce92253f52a43f3c13dddaa918ca73b515d0)) -* update module golang.org/x/net to v0.12.0 ([#1662](https://github.com/keptn/lifecycle-toolkit/issues/1662)) ([49318bf](https://github.com/keptn/lifecycle-toolkit/commit/49318bfc40497a120304de9d831dfe033259220f)) -* update module golang.org/x/net to v0.14.0 ([#1855](https://github.com/keptn/lifecycle-toolkit/issues/1855)) ([3186188](https://github.com/keptn/lifecycle-toolkit/commit/31861889bf7b227f489b941ac4a52db86551fcc2)) -* update module google.golang.org/grpc to v1.56.2 ([#1663](https://github.com/keptn/lifecycle-toolkit/issues/1663)) ([0b618c4](https://github.com/keptn/lifecycle-toolkit/commit/0b618c4bf15209fbb81ec7c05f1d05543bdfd1cf)) -* update module google.golang.org/grpc to v1.57.0 ([#1861](https://github.com/keptn/lifecycle-toolkit/issues/1861)) ([fdcbdf5](https://github.com/keptn/lifecycle-toolkit/commit/fdcbdf50365dfd69d16c679c6814e89570a8a0e2)) -* update module k8s.io/kubernetes to v1.25.13 ([#1958](https://github.com/keptn/lifecycle-toolkit/issues/1958)) ([fb23f09](https://github.com/keptn/lifecycle-toolkit/commit/fb23f0948aa0395636b1290f3c7b3b28cbf54976)) diff --git a/scheduler/Makefile b/scheduler/Makefile index 3e4ed62b577..069f0c761eb 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -15,7 +15,7 @@ ARCHS = amd64 arm64 COMMONENVVAR=GOOS=$(shell uname -s | tr A-Z a-z) BUILDENVVAR=CGO_ENABLED=0 -TAG?="v0.8.2" # x-release-please-version +TAG?="v0.8.1" # x-release-please-version CHART_APPVERSION?="" LOCAL_REGISTRY=localhost:5000/scheduler-plugins From e91137ee91e08bb59b91d8f1dad1bcbc977e2a39 Mon Sep 17 00:00:00 2001 From: Giovanni Liva Date: Wed, 6 Sep 2023 09:32:54 +0200 Subject: [PATCH 61/78] docs: fix branding homepage (#2041) --- docs/assets/scss/_variables_project.scss | 2 +- docs/content/en/_index.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/assets/scss/_variables_project.scss b/docs/assets/scss/_variables_project.scss index c0bc7fe3cff..002d8f34966 100644 --- a/docs/assets/scss/_variables_project.scss +++ b/docs/assets/scss/_variables_project.scss @@ -88,7 +88,7 @@ $fontFamilyStyled: Ubuntu, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto } .navbar-logo::after { - content: "Lifecycle Toolkit"; + content: ""; font-size: 23px; font-weight: 700; font-family: $fontFamilyStyled; diff --git a/docs/content/en/_index.md b/docs/content/en/_index.md index 49795a6245d..91bb0eca44b 100644 --- a/docs/content/en/_index.md +++ b/docs/content/en/_index.md @@ -34,7 +34,6 @@ cascade: keptn -

Lifecycle Toolkit

Cloud native application lifecycle orchestration

}}"> From a8b37a4620a4ac14f0a076c19522f4f344c6a078 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Wed, 6 Sep 2023 09:33:24 +0200 Subject: [PATCH 62/78] ci: fix release matrix again again again again again (#2035) --- .github/workflows/release.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d59596576ad..fd86cfeb42e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,19 +82,7 @@ jobs: itemsToPublish.forEach(item => { switch (item) { case "lifecycle-operator": - releaseMatrix.push(...[ - { - name: item, - folder: item, - tagName: process.env.ARTIFACT_TAG_NAME - }, - { - name: "scheduler", - folder: "scheduler/", - tagName: process.env.ARTIFACT_TAG_NAME - } - ]); - break; + case "scheduler": case "metrics-operator": releaseMatrix.push({ name: item, From 621c59d26c22af492ea3fbc947071c6a07c0ffbd Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:33:57 +0200 Subject: [PATCH 63/78] chore: release scheduler 0.8.2 (#2043) --- .release-please-manifest.json | 2 +- scheduler/CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ scheduler/Makefile | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 scheduler/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 74c52b69ec0..5e21f7ed268 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -4,6 +4,6 @@ "runtimes/python-runtime": "1.0.0", "runtimes/deno-runtime": "1.0.1", "lifecycle-operator": "0.8.1", - "scheduler": "0.8.1", + "scheduler": "0.8.2", "metrics-operator": "0.8.1" } diff --git a/scheduler/CHANGELOG.md b/scheduler/CHANGELOG.md new file mode 100644 index 00000000000..a569a6c06d3 --- /dev/null +++ b/scheduler/CHANGELOG.md @@ -0,0 +1,30 @@ +# Changelog + +## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/scheduler-v0.8.1...scheduler-v0.8.2) (2023-09-06) + + +### Other + +* fix minor security issues ([#1728](https://github.com/keptn/lifecycle-toolkit/issues/1728)) ([ea73cd9](https://github.com/keptn/lifecycle-toolkit/commit/ea73cd983102632fb162e1b4c8ae56687b288b25)) +* **main:** release lifecycle-operator-and-scheduler libraries ([#1979](https://github.com/keptn/lifecycle-toolkit/issues/1979)) ([12d0f40](https://github.com/keptn/lifecycle-toolkit/commit/12d0f40725e466825c4a0d483fa344e5888b03ae)) +* release scheduler 0.8.2 ([#2032](https://github.com/keptn/lifecycle-toolkit/issues/2032)) ([cb4d2b1](https://github.com/keptn/lifecycle-toolkit/commit/cb4d2b14a7a772572b505fa844db6f08a45db291)) + + +### Docs + +* implement KLT -> Keptn name change ([#2001](https://github.com/keptn/lifecycle-toolkit/issues/2001)) ([440c308](https://github.com/keptn/lifecycle-toolkit/commit/440c3082e5400f89d791724651984ba2bc0a4724)) +* keptn Scheduler architecture documentation ([#1777](https://github.com/keptn/lifecycle-toolkit/issues/1777)) ([ce96200](https://github.com/keptn/lifecycle-toolkit/commit/ce96200b9bfed62062b199845104c4493b3a2627)) + + +### Dependency Updates + +* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) +* update kubernetes packages (patch) ([#1786](https://github.com/keptn/lifecycle-toolkit/issues/1786)) ([cba2de5](https://github.com/keptn/lifecycle-toolkit/commit/cba2de5a5cd04c094131552aaf92c2b85ac23d21)) +* update module github.com/onsi/ginkgo/v2 to v2.12.0 ([#2019](https://github.com/keptn/lifecycle-toolkit/issues/2019)) ([41e878f](https://github.com/keptn/lifecycle-toolkit/commit/41e878ff8bbb438efa4b221470a571687dd392e9)) +* update module github.com/onsi/gomega to v1.27.10 ([#1796](https://github.com/keptn/lifecycle-toolkit/issues/1796)) ([8f14bff](https://github.com/keptn/lifecycle-toolkit/commit/8f14bffe27485a36e0b05b770a01e357402d92f7)) +* update module github.com/onsi/gomega to v1.27.9 ([#1787](https://github.com/keptn/lifecycle-toolkit/issues/1787)) ([90b6ce9](https://github.com/keptn/lifecycle-toolkit/commit/90b6ce92253f52a43f3c13dddaa918ca73b515d0)) +* update module golang.org/x/net to v0.12.0 ([#1662](https://github.com/keptn/lifecycle-toolkit/issues/1662)) ([49318bf](https://github.com/keptn/lifecycle-toolkit/commit/49318bfc40497a120304de9d831dfe033259220f)) +* update module golang.org/x/net to v0.14.0 ([#1855](https://github.com/keptn/lifecycle-toolkit/issues/1855)) ([3186188](https://github.com/keptn/lifecycle-toolkit/commit/31861889bf7b227f489b941ac4a52db86551fcc2)) +* update module google.golang.org/grpc to v1.56.2 ([#1663](https://github.com/keptn/lifecycle-toolkit/issues/1663)) ([0b618c4](https://github.com/keptn/lifecycle-toolkit/commit/0b618c4bf15209fbb81ec7c05f1d05543bdfd1cf)) +* update module google.golang.org/grpc to v1.57.0 ([#1861](https://github.com/keptn/lifecycle-toolkit/issues/1861)) ([fdcbdf5](https://github.com/keptn/lifecycle-toolkit/commit/fdcbdf50365dfd69d16c679c6814e89570a8a0e2)) +* update module k8s.io/kubernetes to v1.25.13 ([#1958](https://github.com/keptn/lifecycle-toolkit/issues/1958)) ([fb23f09](https://github.com/keptn/lifecycle-toolkit/commit/fb23f0948aa0395636b1290f3c7b3b28cbf54976)) diff --git a/scheduler/Makefile b/scheduler/Makefile index 069f0c761eb..3e4ed62b577 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -15,7 +15,7 @@ ARCHS = amd64 arm64 COMMONENVVAR=GOOS=$(shell uname -s | tr A-Z a-z) BUILDENVVAR=CGO_ENABLED=0 -TAG?="v0.8.1" # x-release-please-version +TAG?="v0.8.2" # x-release-please-version CHART_APPVERSION?="" LOCAL_REGISTRY=localhost:5000/scheduler-plugins From af4f417ea0455d2dc26c00eafc9445fe1a208d49 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 6 Sep 2023 03:54:11 -0700 Subject: [PATCH 64/78] docs: improve "Intro to Keptn" page (#2040) Co-authored-by: Giovanni Liva --- .../content/en/docs/getting-started/_index.md | 3 +- docs/content/en/docs/intro/_index.md | 258 +++++++----------- 2 files changed, 107 insertions(+), 154 deletions(-) diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md index 968d815f1c4..5ed9477d6be 100644 --- a/docs/content/en/docs/getting-started/_index.md +++ b/docs/content/en/docs/getting-started/_index.md @@ -1,8 +1,7 @@ --- title: Getting started with Keptn description: Get started with Keptn -weight: 10 -hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html +weight: 20 --- Keptn works whether or not you use a GitOps strategy. diff --git a/docs/content/en/docs/intro/_index.md b/docs/content/en/docs/intro/_index.md index e9a49fb4862..073df9952ae 100644 --- a/docs/content/en/docs/intro/_index.md +++ b/docs/content/en/docs/intro/_index.md @@ -1,173 +1,127 @@ --- title: Introduction to Keptn description: An introduction to Keptn and the usecases. -weight: 20 -hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html +weight: 10 --- -This section contains tutorials on how to use Keptn. - -When you understand the toolkit, begin with the [getting started guide](../getting-started/). - ----- - -Keptn implements observability -for deployments and seamlessly integrates with GitOps tools +Keptn implements observability for deployments. +It seamlessly integrates with deployment tools such as ArgoCD, Flux, and Gitlab -and brings application awareness to your Kubernetes cluster. +to bring application awareness to your Kubernetes cluster. -These standard GitOps deployment tools +These standard deployment tools do an excellent job at deploying applications but do not handle all issues that are required to ensure that your deployment is usable. -Keptn "wraps" a standard Kubernetes GitOps deployment +Keptn "wraps" a standard Kubernetes deployment with the capability to automatically handle issues before and after the actual deployment. -Pre-deployment issues that Keptn can handle: +Keptn includes multiple features +that can be implemented independently or together. +It targets three main use cases: +Custom metrics, Observability, and Release lifecycle management. + +## Custom metrics + +The Custom Keptn metrics feature extends the functionality of +[Kubernetes metrics](https://kubernetes.io/docs/concepts/cluster-administration/system-metrics/): + +* Allows you to define metrics + from multiple data sources in your Kubernetes cluster. -* Send appropriate notifications that this deployment is about to happen -* Check that downstream services meet their SLOs -* Verify that your infrastructure is ready -* Ensure that your infrastructure - has the resources necessary for a successful deployment +* Supports deployment tools like Argo, Flux, KEDA, HPA, or + Keptn for automated decision-making based on observability data. -Post-deployment issues that Keptn can handle: +* Handles observability data from multiple instances + of multiple observability solutions + – Prometheus, Dynatrace, Datadog and others – + as well as data that comes directly from your cloud provider + such as AWS, Google, or Azure. -* Integrate with tooling beyond the standard Kubernetes probes -* Automatically test the deployment -* Ensure that the deployment is meeting its SLOs -* Identify any downstream issues that may be caused by this deployment -* Send appropriate notifications - about whether the deployment was successful or unsuccessful +The Keptn metrics server unifies and standardizes +access to data from various sources, +simplifying configuration and integration into a single set of metrics. -Keptn can evaluate both workload (single service) tests -and SLO evaluations before and after the actual deployment. -Multiple workloads can also be logically grouped and evaluated -as a single cohesive unit called a `KeptnApp`. -In other words, a `KeptnApp` is a collection of multiple workloads. +## Observability -Keptn is tool- and vendor neutral and does not depend on particular GitOps tooling. +Keptn ensures observability for Kubernetes deployments +by creating a comprehensive trace +of all Kubernetes activities within a deployment. +Keptn observability makes it easy to understand +deployment durations and failures across multiple deployment strategies. + +* Provides observability data for standard Kubernetes workload resources + as well as + [KeptnApp](https://lifecycle.keptn.sh/docs/yaml-crd-ref/app/) + resources (which connect logically related workloads) + using different deployment strategies. + +* Captures + [DORA metrics](../implementing/dora/) + and exposes them as OpenTelemetry metrics out of the box. + +* Reports traces and custom Keptn metrics from configured data providers + using OpenTelemetry. + +* Enables monitoring of new logs from log monitoring solutions. + +* Information can be displayed on standard dashboard tools + like Grafana. + +Keptn is tool- and vendor neutral +and does not depend on particular tooling. Keptn emits signals at every stage -(Kubernetes events, OpenTelemetry metrics and traces) +([Kubernetes events](https://kubernetes.io/docs/reference/kubernetes-api/cluster-resources/event-v1/), +[CloudEvents](https://cloudevents.io/), and +OpenTelemetry metrics and traces) to ensure that your deployments are observable. -It supports the following steps: - -* Pre-Deployment Tasks: e.g. checking for dependant services, - setting the cluster to be ready for the deployment, etc. -* Pre-Deployment Evaluations: e.g. evaluate metrics - before your application gets deployed (e.g. layout of the cluster) -* Post-Deployment Tasks: e.g. trigger a test, - trigger a deployment to another cluster, etc. -* Post-Deployment Evaluations: e.g. evaluate the deployment, - evaluate the test results, etc. - -All of these things can be executed for a workload or for a [KeptnApp](https://lifecycle.keptn.sh/docs/yaml-crd-ref/app/). - -## Main features of : Metrics, Observability and Release lifecycle - -* **Custom Metrics:** The Custom Keptn Metrics feature in -Keptn allows you to define metrics from -multiple data sources in your Kubernetes cluster. -It supports deployment tools like Argo, Flux, KEDA, HPA, or -Keptn for automated decision-making based on observability data. -Your observability data may come from multiple observability solutions -– Prometheus, Dynatrace, Datadog and others – or may be data that comes -directly from your cloud provider such as AWS, Google, or Azure. -The Keptn Metrics Server unifies and standardizes access to data from -various sources, simplifying configuration and integration into a single -set of metrics. - -* **Observability:** Keptn ensures observability -for Kubernetes deployments by creating a comprehensive trace of all Kubernetes -activities within a deployment. -It introduces the concept of applications, which connect logically related -workloads using different deployment strategies. -With Keptn, you can easily understand deployment durations and failures across -multiple strategies. -It captures DORA metrics and exposes them as OpenTelemetry metrics. -The observability data includes out-of-the-box DORA metrics, traces from -OpenTelemetry, and custom Keptn metrics from configured data providers. -Visualizing this information is possible using dashboard tools like Grafana. - -* **Release Lifecycle:** Keptn offers versatile functionalities -for deployment scenarios, including pre-deployment validation, image scanning, -and post-deployment tasks like test execution and stakeholder notification. -It automatically validates against Service Level Objectives (SLOs) and provides -end-to-end deployment traceability. -Keptn extends deployments with application-aware tasks and evaluations, -allowing checks before or after deployment initiation. -It validates Keptn metrics using the Keptn Metrics Server, ensuring a healthy -environment and confirming software health against SLOs like performance and -user experience. -Additionally, it enables monitoring of new logs from log monitoring solutions. - -To get started with Keptn, refer to the -[Getting Started Exercises](https://lifecycle.keptn.sh/docs/getting-started/) -for detailed instructions and examples. -This guide will walk you through the installation process and help you set up -your environment for using Keptn effectively. - -## Differences between Keptn and Keptn v1 - -Keptn is a subproject -whose design reflects lessons we learned while developing Keptn v1. -Keptn recognizes that tools such as Argo and Flux -are very good at deploying applications. -However, these deployment tools do not provide -pre-deployment and post-deployment evaluations and actions; -this is what Keptn adds. - -Keptn v1 is a long-term support release -that can deploy applications on platforms other than Kubernetes, -can accommodate complex scoring algorithms for SLO evaluations, -and can implement remediations (self-healing) for problems discovered -on the production site. -Keptn includes multiple features -that can be implemented independently or together. -Different features are at different levels of stability. -See the [Keptn README file](https://github.com/keptn/lifecycle-toolkit/blob/main/README.md) -for a list of the features that have been implemented to date -and their level of stability. - -In a December 2022 Keptn Community meeting, -we discussed the differences and similarities -between Keptn v1 and Keptn -to help you decide which best fits your needs. -View the recording: -[Compare Keptn v1 and the Keptn Lifecycle Toolkit](https://www.youtube.com/watch?v=-cKyUKFjtwE&t=170s) - -## Overviews of Keptn - -A number of presentations are available to help you understand Keptn. -Note that many of these refer to the "Keptn Lifecycle Controller" -or "Keptn Lifecycle Toolkit", which was the development code name for Keptn. - -* [Orchestrating and Observing GitOps Deployments with Keptn](https://www.youtube.com/watch?v=-cKyUKFjtwE&t=11s) - discusses the evolution of Keptn and the concepts that drive it, - then gives a simple demonstration of a Keptn implementation. - -* [Introducing Keptn Lifecycle Toolkit](https://youtu.be/449HAFYkUlY) - gives an overview of what Keptn does and how to implement it. - -* [Keptn Lifecycle Toolkit Demo Tutorial on k3s, with ArgoCD for GitOps, OTel, Prometheus and Grafana](https://www.youtube.com/watch?v=6J_RzpmXoCc) - is a short video demonstration of how Keptn works. - You can download the exercise and run it for yourself; - notes below the video give a link to the github repo. - The README file in that repo gives instructions for installing the software - either automatically or manually. - -* [What is the Keptn Lifecycle Toolkit?](https://isitobservable.io/observability/kubernetes/what-is-the-keptn-lifecycle-toolkit) - blog discusses Keptn as part of the "Is It Observable?" series. - This links to: - -* [What is Keptn Lifecycle Toolkit?](https://www.youtube.com/watch?v=Uvg4uG8AbFg) - is a video that steps through the process of integrating Keptn - with your existing cloud native cluster. - -* [Keptn Lifecycle Toolkit: Installation and KeptnTask Creation in Minutes](https://www.youtube.com/watch?v=Hh01bBwZ_qM) - demonstrates how to install Keptn and create your first KeptnTask in less than ten minutes. - -* You can explore the [GitHub repository](https://github.com/isItObservable/keptn-lifecycle-Toolkit) - for more information. +## Release lifecycle management + +The Release lifecycle management tools run in conjunction +with the standard Kubernetes deployment tools +to make deployments more robust. + +These tools run checks and tasks before or after deployment initiation. + +* Pre-deployment tasks such as checking for dependent services, + image scanning, and setting the cluster to be ready for the deployment. + +* Pre-deployment evaluations such as checking whether the cluster + has enough resources for the deployment. + +* Post-deployment tasks such as triggering tests, + triggering a deployment to another cluster, + or sending notifications that the deployment succeeded or failed. + +* Post-deployment evaluations to evaluate the deployment, + evaluate test results, + or confirm software health against SLOs + like performance and user experience. + +All `KeptnTask` resources that are defined by `KeptnTaskDefinition` resources +at the same level (either pre-deployment or post-deployment) run in parallel. +Task sequences that are not part of the lifecycle workflow +should be handled by the pipeline engine tools rather than Keptn. +A `KeptnTask` resource can be defined to run multiple executables +(functions, programs, and scripts) +that are part of the lifecycle workflow. +The executables within a `KeptnTask` resource +run in sequential order. + +Keptn tasks and evaluations can be run +for either a Kubernetes workload (single service) resource +or a +[KeptnApp](https://lifecycle.keptn.sh/docs/yaml-crd-ref/app/) resource, +which is a single, cohesive unit that groups multiple workloads. + +To familiarize yourself with how Keptn works, refer to the +[Getting started with Keptn](../getting-started/) +and the +[Getting Started Exercises](https://lifecycle.keptn.sh/docs/getting-started/). + +For information about the history of the Keptn project, +see the +[Keptn Lifecycle Toolkit is now Keptn!](https://medium.com/keptn/keptn-lifecycle-toolkit-is-now-keptn-e0812217bf46). +blog. From 17ef13a2fe2782c7499d923d1a91fd05f6503047 Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:15:53 +0200 Subject: [PATCH 65/78] chore: release lifecycle-operator 0.8.2 (#2033) Co-authored-by: Moritz Wiesinger --- .release-please-manifest.json | 2 +- lifecycle-operator/CHANGELOG.md | 51 +++++++++++++++++++++++++++++++++ lifecycle-operator/Makefile | 2 +- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 lifecycle-operator/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5e21f7ed268..3bcf6843c6f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -3,7 +3,7 @@ "klt-cert-manager": "1.1.0", "runtimes/python-runtime": "1.0.0", "runtimes/deno-runtime": "1.0.1", - "lifecycle-operator": "0.8.1", + "lifecycle-operator": "0.8.2", "scheduler": "0.8.2", "metrics-operator": "0.8.1" } diff --git a/lifecycle-operator/CHANGELOG.md b/lifecycle-operator/CHANGELOG.md new file mode 100644 index 00000000000..ce9bc382673 --- /dev/null +++ b/lifecycle-operator/CHANGELOG.md @@ -0,0 +1,51 @@ +# Changelog + +## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/lifecycle-operator-v0.8.1...lifecycle-operator-v0.8.2) (2023-09-06) + + +### Features + +* add cloud events support ([#1843](https://github.com/keptn/lifecycle-toolkit/issues/1843)) ([5b47120](https://github.com/keptn/lifecycle-toolkit/commit/5b471203e412a919903876212ac45c04f180e482)) +* **lifecycle-operator:** clean up KeptnTask API by removing duplicated attributes ([#1965](https://github.com/keptn/lifecycle-toolkit/issues/1965)) ([257b220](https://github.com/keptn/lifecycle-toolkit/commit/257b220a6171ccc82d1b471002b6cf773ec9bd09)) +* **metrics-operator:** add analysis controller ([#1875](https://github.com/keptn/lifecycle-toolkit/issues/1875)) ([017e08b](https://github.com/keptn/lifecycle-toolkit/commit/017e08b0a65679ca417e363f2223b7f4fef3bc55)) +* **metrics-operator:** add Analysis CRD ([#1839](https://github.com/keptn/lifecycle-toolkit/issues/1839)) ([9521a16](https://github.com/keptn/lifecycle-toolkit/commit/9521a16ce4946d3169993780f2d2a4f3a75d0445)) +* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) + + +### Bug Fixes + +* **lifecycle-operator:** avoid setting the overall state of an App or WorkloadInstance between state transitions ([#1871](https://github.com/keptn/lifecycle-toolkit/issues/1871)) ([ee0b085](https://github.com/keptn/lifecycle-toolkit/commit/ee0b085b05b2b9781457eba34d5d1050b3c7a604)) + + +### Other + +* **main:** release lifecycle-operator-and-scheduler libraries ([#1979](https://github.com/keptn/lifecycle-toolkit/issues/1979)) ([12d0f40](https://github.com/keptn/lifecycle-toolkit/commit/12d0f40725e466825c4a0d483fa344e5888b03ae)) +* rename operator folder to lifecycle-operator ([#1819](https://github.com/keptn/lifecycle-toolkit/issues/1819)) ([97a2d25](https://github.com/keptn/lifecycle-toolkit/commit/97a2d25919c0a02165dd0dc6c7c82d57ad200139)) + + +### Docs + +* fix typos and grammar issues ([#1925](https://github.com/keptn/lifecycle-toolkit/issues/1925)) ([5570d55](https://github.com/keptn/lifecycle-toolkit/commit/5570d555bfc4bbdcbfc66b2725d5352090e5b937)) +* implement KLT -> Keptn name change ([#2001](https://github.com/keptn/lifecycle-toolkit/issues/2001)) ([440c308](https://github.com/keptn/lifecycle-toolkit/commit/440c3082e5400f89d791724651984ba2bc0a4724)) + + +### Dependency Updates + +* update dependency kubernetes-sigs/controller-tools to v0.13.0 ([#1930](https://github.com/keptn/lifecycle-toolkit/issues/1930)) ([8b34b63](https://github.com/keptn/lifecycle-toolkit/commit/8b34b63404d0339633ef41ff1cf2005deae8d2b7)) +* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 440c308 ([#2017](https://github.com/keptn/lifecycle-toolkit/issues/2017)) ([c365734](https://github.com/keptn/lifecycle-toolkit/commit/c365734fa7e3e40b2ae4c97c61628892d040dacc)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 88a54f9 ([#1794](https://github.com/keptn/lifecycle-toolkit/issues/1794)) ([fc976eb](https://github.com/keptn/lifecycle-toolkit/commit/fc976eb07ed9a5e49ed7d4ab1dbf187cee583e64)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 8dbec2d ([#1995](https://github.com/keptn/lifecycle-toolkit/issues/1995)) ([2f51445](https://github.com/keptn/lifecycle-toolkit/commit/2f5144540c4b3876e800bff29c30bfded334be40)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to bb133cf ([#1963](https://github.com/keptn/lifecycle-toolkit/issues/1963)) ([c7697bf](https://github.com/keptn/lifecycle-toolkit/commit/c7697bf54d5fe18b7c62c5b11801c6c83079b0a3)) +* update kubernetes packages to v0.26.8 (patch) ([#1945](https://github.com/keptn/lifecycle-toolkit/issues/1945)) ([6ce03d6](https://github.com/keptn/lifecycle-toolkit/commit/6ce03d600cbb3d3d3988573c616ec7f3830ba324)) +* update module github.com/onsi/ginkgo/v2 to v2.12.0 ([#2019](https://github.com/keptn/lifecycle-toolkit/issues/2019)) ([41e878f](https://github.com/keptn/lifecycle-toolkit/commit/41e878ff8bbb438efa4b221470a571687dd392e9)) +* update module github.com/onsi/gomega to v1.27.10 ([#1796](https://github.com/keptn/lifecycle-toolkit/issues/1796)) ([8f14bff](https://github.com/keptn/lifecycle-toolkit/commit/8f14bffe27485a36e0b05b770a01e357402d92f7)) +* update module golang.org/x/net to v0.14.0 ([#1855](https://github.com/keptn/lifecycle-toolkit/issues/1855)) ([3186188](https://github.com/keptn/lifecycle-toolkit/commit/31861889bf7b227f489b941ac4a52db86551fcc2)) +* update module google.golang.org/grpc to v1.57.0 ([#1861](https://github.com/keptn/lifecycle-toolkit/issues/1861)) ([fdcbdf5](https://github.com/keptn/lifecycle-toolkit/commit/fdcbdf50365dfd69d16c679c6814e89570a8a0e2)) +* update opentelemetry-go monorepo (minor) ([#1931](https://github.com/keptn/lifecycle-toolkit/issues/1931)) ([a0a1a7e](https://github.com/keptn/lifecycle-toolkit/commit/a0a1a7e97906ab56ed85da7ab9b6d1e13c902397)) + + +### Refactoring + +* **lifecycle-operator:** eventing and telemetry ([#1844](https://github.com/keptn/lifecycle-toolkit/issues/1844)) ([0130576](https://github.com/keptn/lifecycle-toolkit/commit/0130576a17a78453019c150af849c06553d799a6)) +* **lifecycle-operator:** refactor event emitter unit tests ([#1867](https://github.com/keptn/lifecycle-toolkit/issues/1867)) ([2558f74](https://github.com/keptn/lifecycle-toolkit/commit/2558f742031e4d38a8006ce9894f41bddac7cd3f)) diff --git a/lifecycle-operator/Makefile b/lifecycle-operator/Makefile index 70826b91061..8325fc123e3 100644 --- a/lifecycle-operator/Makefile +++ b/lifecycle-operator/Makefile @@ -7,7 +7,7 @@ RELEASE_REGISTRY?=ghcr.io/keptn RELEASE_TIME=$(shell date +%Y%m%d%s) BUILD_TIME=$(shell date -u "+%F_%T") RELEASE_VERSION?=$(RELEASE_TIME)-v0.24.3#$(shell git describe --tags --match "v*") -TAG?="v0.8.1" # x-release-please-version +TAG?="v0.8.2" # x-release-please-version RELEASE_IMAGE:=lifecycle-operator:$(TAG) CHART_APPVERSION?="" From aa430e7f106949e1ee3108bc08c2e604d3e25a9b Mon Sep 17 00:00:00 2001 From: odubajDT <93584209+odubajDT@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:33:31 +0200 Subject: [PATCH 66/78] feat(metrics-operator): support combination of OR criteria in SLO converter (#2023) Signed-off-by: odubajDT --- metrics-operator/converter/sli_converter.go | 2 +- metrics-operator/converter/slo_converter.go | 51 +++++-- .../converter/slo_converter_test.go | 127 ++++++++++++++++-- metrics-operator/main.go | 8 +- 4 files changed, 159 insertions(+), 29 deletions(-) diff --git a/metrics-operator/converter/sli_converter.go b/metrics-operator/converter/sli_converter.go index 125c22328a0..777e993d7bd 100644 --- a/metrics-operator/converter/sli_converter.go +++ b/metrics-operator/converter/sli_converter.go @@ -24,7 +24,7 @@ func NewSLIConverter() *SLIConverter { func (c *SLIConverter) Convert(fileContent []byte, provider string, namespace string) (string, error) { //check that provider and namespace is set if provider == "" || namespace == "" { - return "", fmt.Errorf("--sli-provider and --sli-namespace needs to be set for conversion") + return "", fmt.Errorf("missing arguments: 'keptn-provider-name' and 'keptn-provider-namespace' needs to be set for conversion") } // unmarshall content diff --git a/metrics-operator/converter/slo_converter.go b/metrics-operator/converter/slo_converter.go index 382d52f2d8f..d23214d4fe1 100644 --- a/metrics-operator/converter/slo_converter.go +++ b/metrics-operator/converter/slo_converter.go @@ -43,13 +43,27 @@ type Criteria struct { } func (o *Objective) hasNotSupportedCriteria() bool { - return len(o.Pass) > 1 || len(o.Warning) > 1 + // no pass criteria -> informative + if len(o.Pass) == 0 { + return true + } + // support only warning criteria with a single criteria element + if len(o.Warning) > 1 { + return true + } + // warning criteria == 1, pass can be only 1 + if len(o.Warning) == 1 { + return len(o.Pass) > 1 + } + + // warn criteria == 0, pass can be anything + return false } func (c *SLOConverter) Convert(fileContent []byte, analysisDef string, namespace string) (string, error) { //check that provider and namespace is set if analysisDef == "" || namespace == "" { - return "", fmt.Errorf("missing arguments: 'definition' and 'namespace' needs to be set for conversion") + return "", fmt.Errorf("missing arguments: 'analysis-definition-name' and 'analysis-value-template-namespace' needs to be set for conversion") } // unmarshall content @@ -142,10 +156,19 @@ func removePercentage(str string) (int, error) { // nolint:gocognit,gocyclo func setupTarget(o *Objective) (*metricsapi.Target, error) { target := &metricsapi.Target{} - // skip objective target conversion if it has criteria combined with logical OR -> not supported - // this way the SLO will become "informative" - // it will become informative as well when the pass criteria are not defined - if o.hasNotSupportedCriteria() || len(o.Pass) == 0 { + // skip unsupported combination of criteria and informative objectives + if o.hasNotSupportedCriteria() { + return target, nil + } + + // multiple criteria combined with logical OR operator + if len(o.Pass) > 1 { + ops := []string{o.Pass[0].Operators[0], o.Pass[1].Operators[0]} + op, err := newOperator(ops, true) + if err != nil { + return nil, err + } + target.Failure = op return target, nil } @@ -155,7 +178,7 @@ func setupTarget(o *Objective) (*metricsapi.Target, error) { if len(o.Pass[0].Operators) > 0 { op, err := newOperator(o.Pass[0].Operators, true) if err != nil { - return target, err + return nil, err } target.Failure = op return target, nil @@ -168,16 +191,16 @@ func setupTarget(o *Objective) (*metricsapi.Target, error) { // !(pass criteria) -> warn criteria isWarningSuperInterval, err := isSuperInterval(o.Warning[0].Operators, o.Pass[0].Operators) if err != nil { - return target, err + return nil, err } if (len(o.Pass[0].Operators) == 1 && len(o.Warning[0].Operators) == 1) || isWarningSuperInterval { op1, err := newOperator(o.Pass[0].Operators, true) if err != nil { - return target, err + return nil, err } op2, err := newOperator(o.Warning[0].Operators, true) if err != nil { - return target, err + return nil, err } target.Failure = op2 target.Warning = op1 @@ -189,16 +212,16 @@ func setupTarget(o *Objective) (*metricsapi.Target, error) { // warn criteria -> warn criteria isPassSuperInterval, err := isSuperInterval(o.Pass[0].Operators, o.Warning[0].Operators) if err != nil { - return target, err + return nil, err } if isPassSuperInterval { op1, err := newOperator(o.Warning[0].Operators, false) if err != nil { - return target, err + return nil, err } op2, err := newOperator(o.Pass[0].Operators, true) if err != nil { - return target, err + return nil, err } target.Failure = op2 target.Warning = op1 @@ -396,7 +419,7 @@ func negateSingleOperator(op string, value string) (*metricsapi.Operator, error) }, nil } - return &metricsapi.Operator{}, NewInvalidOperatorErr(op) + return nil, NewInvalidOperatorErr(op) } // checks and creates single operator diff --git a/metrics-operator/converter/slo_converter_test.go b/metrics-operator/converter/slo_converter_test.go index 4beaaec1daf..1d642042bf6 100644 --- a/metrics-operator/converter/slo_converter_test.go +++ b/metrics-operator/converter/slo_converter_test.go @@ -23,14 +23,22 @@ objectives: - sli: "response_time_p90" key_sli: false pass: - - criteria: + - criteria: - ">600" - "<800" warning: - - criteria: + - criteria: - "<=1000" - ">500" weight: 2 + - sli: "response_time_p91" + key_sli: false + pass: + - criteria: + - "<600" + - criteria: + - ">800" + weight: 5 - sli: "response_time_p80" key_sli: false pass: @@ -66,10 +74,10 @@ objectives: pass: - criteria: - "<=+100%" - - ">=80" + - ">=100" - criteria: - "<=+100%" - - ">=80" + - "<=80" - sli: "throughput" pass: - criteria: @@ -100,6 +108,15 @@ spec: highBound: "800" lowBound: "600" weight: 2 + - analysisValueTemplateRef: + name: response_time_p91 + namespace: default + target: + failure: + inRange: + highBound: "800" + lowBound: "600" + weight: 5 - analysisValueTemplateRef: name: response_time_p80 namespace: default @@ -138,7 +155,11 @@ spec: - analysisValueTemplateRef: name: cpu namespace: default - target: {} + target: + failure: + inRange: + highBound: "100" + lowBound: "80" - analysisValueTemplateRef: name: throughput namespace: default @@ -840,7 +861,7 @@ func TestNewOperator(t *testing.T) { } } -func TestShouldIgnoreObjective(t *testing.T) { +func TestHasNotSupportedCriteria(t *testing.T) { tests := []struct { name string o *Objective @@ -852,10 +873,34 @@ func TestShouldIgnoreObjective(t *testing.T) { Pass: []Criteria{}, Warning: []Criteria{}, }, + want: true, + }, + { + name: "pass == 1, warn == 0", + o: &Objective{ + Pass: []Criteria{ + { + Operators: []string{}, + }, + }, + Warning: []Criteria{}, + }, want: false, }, { - name: "valid criteria", + name: "pass == 0, warn == 1", + o: &Objective{ + Pass: []Criteria{}, + Warning: []Criteria{ + { + Operators: []string{}, + }, + }, + }, + want: true, + }, + { + name: "pass == 1; warn == 1", o: &Objective{ Pass: []Criteria{ { @@ -871,7 +916,7 @@ func TestShouldIgnoreObjective(t *testing.T) { want: false, }, { - name: "OR criteria", + name: "pass == 2; warn == 1", o: &Objective{ Pass: []Criteria{ { @@ -889,6 +934,21 @@ func TestShouldIgnoreObjective(t *testing.T) { }, want: true, }, + { + name: "pass == 2; warn == 0", + o: &Objective{ + Pass: []Criteria{ + { + Operators: []string{}, + }, + { + Operators: []string{}, + }, + }, + Warning: []Criteria{}, + }, + want: false, + }, } for _, tt := range tests { @@ -1154,15 +1214,62 @@ func TestSetupTarget(t *testing.T) { wantErr: true, }, { - name: "logical OR criteria -> informative slo", + name: "logical OR criteria -> with pass only", o: &Objective{ Name: "criteria", Pass: []Criteria{ + { + Operators: []string{">15"}, + }, { Operators: []string{"<10"}, }, + }, + }, + want: &metricsapi.Target{ + Failure: &metricsapi.Operator{ + InRange: &metricsapi.RangeValue{ + LowBound: *resource.NewDecimalQuantity(*dec10, resource.DecimalSI), + HighBound: *resource.NewDecimalQuantity(*dec15, resource.DecimalSI), + }, + }, + }, + wantErr: false, + }, + { + name: "logical OR criteria -> with pass only - error", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ { - Operators: []string{">1"}, + Operators: []string{">====15"}, + }, + { + Operators: []string{"<10"}, + }, + }, + }, + want: &metricsapi.Target{}, + wantErr: true, + }, + { + name: "logical OR criteria with pass and warn -> informative", + o: &Objective{ + Name: "criteria", + Pass: []Criteria{ + { + Operators: []string{">15"}, + }, + { + Operators: []string{"<10"}, + }, + }, + Warning: []Criteria{ + { + Operators: []string{">15"}, + }, + { + Operators: []string{"<10"}, }, }, }, diff --git a/metrics-operator/main.go b/metrics-operator/main.go index ced779a28a6..6beac86a10c 100644 --- a/metrics-operator/main.go +++ b/metrics-operator/main.go @@ -92,11 +92,11 @@ func main() { var disableWebhook bool var probeAddr string flag.StringVar(&SLIFilePath, "convert-sli", "", "The path the the SLI file to be converted") - flag.StringVar(&provider, "sli-provider", "", "The name of KeptnMetricsProvider referenced in KeptnValueTemplates") - flag.StringVar(&namespace, "sli-namespace", "", "The namespace of the referenced KeptnMetricsProvider") + flag.StringVar(&provider, "keptn-provider-name", "", "The name of KeptnMetricsProvider referenced in KeptnValueTemplates") + flag.StringVar(&namespace, "keptn-provider-namespace", "", "The namespace of the referenced KeptnMetricsProvider") flag.StringVar(&SLOFilePath, "convert-slo", "", "The path the the SLO file to be converted") - flag.StringVar(&analysisDefinition, "definition", "", "The name of AnalysisDefinition to be created") - flag.StringVar(&namespace, "slo-namespace", "", "The namespace of the referenced AnalysisValueTemplate") + flag.StringVar(&analysisDefinition, "analysis-definition-name", "", "The name of AnalysisDefinition to be created") + flag.StringVar(&namespace, "analysis-value-template-namespace", "", "The namespace of the referenced AnalysisValueTemplate") flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") flag.BoolVar(&disableWebhook, "disable-webhook", false, "Disable the registration of webhooks.") From e5a92c1c8405d478018006f018a13fa81cb729b4 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Wed, 6 Sep 2023 14:35:35 +0200 Subject: [PATCH 67/78] chore: add metrics-operator back to renovate (#2047) --- renovate.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/renovate.json b/renovate.json index 3dd72b42464..e51aba51fc5 100644 --- a/renovate.json +++ b/renovate.json @@ -22,9 +22,6 @@ "**/test/**", "**/tests/**" ], - "ignoreDeps": [ - "ghcr.io/keptn/metrics-operator" - ], "packageRules": [ { "excludePackagePatterns": [ From c523cb017f3ff9d6adb65b9a0e7d9e63712e6b3e Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:55:33 +0200 Subject: [PATCH 68/78] chore: release metrics-operator 0.8.2 (#2030) --- .release-please-manifest.json | 2 +- metrics-operator/CHANGELOG.md | 77 +++++++++++++++++++++++++++++++++++ metrics-operator/Makefile | 2 +- 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 metrics-operator/CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3bcf6843c6f..f5628c025ec 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -5,5 +5,5 @@ "runtimes/deno-runtime": "1.0.1", "lifecycle-operator": "0.8.2", "scheduler": "0.8.2", - "metrics-operator": "0.8.1" + "metrics-operator": "0.8.2" } diff --git a/metrics-operator/CHANGELOG.md b/metrics-operator/CHANGELOG.md new file mode 100644 index 00000000000..7a5453b8502 --- /dev/null +++ b/metrics-operator/CHANGELOG.md @@ -0,0 +1,77 @@ +# Changelog + +## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/metrics-operator-v0.8.1...metrics-operator-v0.8.2) (2023-09-06) + + +### Features + +* add `aggregation` field in `KeptnMetric` ([#1780](https://github.com/keptn/lifecycle-toolkit/issues/1780)) ([c0b66ea](https://github.com/keptn/lifecycle-toolkit/commit/c0b66eae296e0502608dd66c5fe7eb8f890497e6)) +* add `interval` field for `kubectl get KeptnMetric` ([#1689](https://github.com/keptn/lifecycle-toolkit/issues/1689)) ([1599ee9](https://github.com/keptn/lifecycle-toolkit/commit/1599ee939c94c6dbdf6207796b7b4e5211c2cbf7)) +* add `step` field in `KeptnMetric` ([#1755](https://github.com/keptn/lifecycle-toolkit/issues/1755)) ([03ca7dd](https://github.com/keptn/lifecycle-toolkit/commit/03ca7ddde4ce787d0bfddaba2bb3f7b422ff5d6a)) +* metrics-operator monorepo setup ([#1791](https://github.com/keptn/lifecycle-toolkit/issues/1791)) ([51445eb](https://github.com/keptn/lifecycle-toolkit/commit/51445ebd24b0914d34b0339ab05ec939440aa4a3)) +* **metrics-operator:** adapt to changes in DQL API ([#1948](https://github.com/keptn/lifecycle-toolkit/issues/1948)) ([88d693a](https://github.com/keptn/lifecycle-toolkit/commit/88d693af82d41656a991546b4cef555c5171ffdf)) +* **metrics-operator:** add analysis controller ([#1875](https://github.com/keptn/lifecycle-toolkit/issues/1875)) ([017e08b](https://github.com/keptn/lifecycle-toolkit/commit/017e08b0a65679ca417e363f2223b7f4fef3bc55)) +* **metrics-operator:** add Analysis CRD ([#1839](https://github.com/keptn/lifecycle-toolkit/issues/1839)) ([9521a16](https://github.com/keptn/lifecycle-toolkit/commit/9521a16ce4946d3169993780f2d2a4f3a75d0445)) +* **metrics-operator:** add AnalysisDefinition CRD ([#1823](https://github.com/keptn/lifecycle-toolkit/issues/1823)) ([adf4621](https://github.com/keptn/lifecycle-toolkit/commit/adf4621c2e8147bc0e4ee7f1719859007290c978)) +* **metrics-operator:** add AnalysisValueTemplate CRD ([#1822](https://github.com/keptn/lifecycle-toolkit/issues/1822)) ([f25b24d](https://github.com/keptn/lifecycle-toolkit/commit/f25b24dfef07a600c0fbcd4bdb540efe58cff387)) +* **metrics-operator:** add new provider interface ([#1943](https://github.com/keptn/lifecycle-toolkit/issues/1943)) ([66320f8](https://github.com/keptn/lifecycle-toolkit/commit/66320f893c1bfc88b2e5a03d77caecaa0b42681f)) +* **metrics-operator:** convert corner cases in SLO convertor ([#1999](https://github.com/keptn/lifecycle-toolkit/issues/1999)) ([95e0953](https://github.com/keptn/lifecycle-toolkit/commit/95e0953c2c95ac22fe62d592c4ff6dd186e6a260)) +* **metrics-operator:** introduce range operators in AnalysisDefinition ([#1976](https://github.com/keptn/lifecycle-toolkit/issues/1976)) ([7fb8952](https://github.com/keptn/lifecycle-toolkit/commit/7fb8952c514909ce2c0202e01f1cf501de2c8d55)) +* **metrics-operator:** introduce scoring logic for Analysis evaluations ([#1872](https://github.com/keptn/lifecycle-toolkit/issues/1872)) ([b6f2172](https://github.com/keptn/lifecycle-toolkit/commit/b6f2172637481a395fcd48d428ab39780f5c0fa8)) +* **metrics-operator:** introduce SLI -> AnalysisValueTemplate converter ([#1939](https://github.com/keptn/lifecycle-toolkit/issues/1939)) ([6f2d261](https://github.com/keptn/lifecycle-toolkit/commit/6f2d2614c2fcd6b83edfa77db01255a666e0b07b)) +* **metrics-operator:** introduce SLO -> AnalysisDefinition converter ([#1955](https://github.com/keptn/lifecycle-toolkit/issues/1955)) ([9c9929c](https://github.com/keptn/lifecycle-toolkit/commit/9c9929c6f0cf1d51baedc6ddb40f0b0f25ddc228)) +* **metrics-operator:** support combination of OR criteria in SLO converter ([#2023](https://github.com/keptn/lifecycle-toolkit/issues/2023)) ([aa430e7](https://github.com/keptn/lifecycle-toolkit/commit/aa430e7f106949e1ee3108bc08c2e604d3e25a9b)) +* **metrics-operator:** update datadog api to support `range.step` ([#1842](https://github.com/keptn/lifecycle-toolkit/issues/1842)) ([1d957b7](https://github.com/keptn/lifecycle-toolkit/commit/1d957b724c5db7679bf32a33441f96108537d8e3)) +* **metrics-operator:** update dql provider to include range ([#1919](https://github.com/keptn/lifecycle-toolkit/issues/1919)) ([39db23e](https://github.com/keptn/lifecycle-toolkit/commit/39db23e60c6d6f0a8f298bae045abf374877d7f1)) +* **metrics-operator:** update dynatrace api to support `range.step` ([#1812](https://github.com/keptn/lifecycle-toolkit/issues/1812)) ([4407fc4](https://github.com/keptn/lifecycle-toolkit/commit/4407fc4f3878ba5897991734df7e38fc273531a9)) +* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) +* update Datadog API to query metrics for range ([#1615](https://github.com/keptn/lifecycle-toolkit/issues/1615)) ([3b370ab](https://github.com/keptn/lifecycle-toolkit/commit/3b370abd2c887ea939f8a22c4c36babecb114265)) +* update Dynatrace provider to query metrics over a range ([#1658](https://github.com/keptn/lifecycle-toolkit/issues/1658)) ([0f0cddb](https://github.com/keptn/lifecycle-toolkit/commit/0f0cddb2b6cd97aadff4da266c8d15f8ecab2881)) +* update prometheus api to support `range.step` ([#1801](https://github.com/keptn/lifecycle-toolkit/issues/1801)) ([e64fcd6](https://github.com/keptn/lifecycle-toolkit/commit/e64fcd6d63cb87d76e83fc7e718f387953a0ff02)) + + +### Bug Fixes + +* **metrics-operator:** fix url encoding in DT metrics queries ([#1893](https://github.com/keptn/lifecycle-toolkit/issues/1893)) ([5437df9](https://github.com/keptn/lifecycle-toolkit/commit/5437df9419a71b4f9b2ae21534839704c5a05762)) +* **metrics-operator:** flaky test in SLI converter ([#1954](https://github.com/keptn/lifecycle-toolkit/issues/1954)) ([cadb170](https://github.com/keptn/lifecycle-toolkit/commit/cadb170f4a7f26443a77634f9d7fb936610b9677)) +* **metrics-operator:** flaky test in SLI converter ([#1961](https://github.com/keptn/lifecycle-toolkit/issues/1961)) ([d02a8ef](https://github.com/keptn/lifecycle-toolkit/commit/d02a8efa37f8cb5319f4f0b521b1b6c2696c5461)) +* **metrics-operator:** make Fail target in AnalysisDefinition optional ([#1903](https://github.com/keptn/lifecycle-toolkit/issues/1903)) ([df874e2](https://github.com/keptn/lifecycle-toolkit/commit/df874e25dcfde7ae848dbb65c9fbe846d3ce1f61)) + + +### Other + +* add status field docs to all CRDs ([#1807](https://github.com/keptn/lifecycle-toolkit/issues/1807)) ([650ecba](https://github.com/keptn/lifecycle-toolkit/commit/650ecba95624ed3dc2bd61bf1f86578f450223a5)) +* remove debug log containing secret ([#1967](https://github.com/keptn/lifecycle-toolkit/issues/1967)) ([75baefd](https://github.com/keptn/lifecycle-toolkit/commit/75baefd7b45de3dbe3e8ba0fc473ee25351a31e7)) +* rename operator folder to lifecycle-operator ([#1819](https://github.com/keptn/lifecycle-toolkit/issues/1819)) ([97a2d25](https://github.com/keptn/lifecycle-toolkit/commit/97a2d25919c0a02165dd0dc6c7c82d57ad200139)) + + +### Docs + +* document `timeframe` feature for `KeptnMetric` ([#1703](https://github.com/keptn/lifecycle-toolkit/issues/1703)) ([077f0d5](https://github.com/keptn/lifecycle-toolkit/commit/077f0d5d0a49bc5b1f0e800274343660b8218c65)) + + +### Performance + +* **metrics-operator:** improve performance of storing analysis results ([#1905](https://github.com/keptn/lifecycle-toolkit/issues/1905)) ([efe3380](https://github.com/keptn/lifecycle-toolkit/commit/efe33803c4878599db958dcb76c7217b9e82c77f)) + + +### Dependency Updates + +* update dependency kubernetes-sigs/controller-tools to v0.12.1 ([#1765](https://github.com/keptn/lifecycle-toolkit/issues/1765)) ([ba79a32](https://github.com/keptn/lifecycle-toolkit/commit/ba79a32ef6acc9de8fb5d618b9ede7d6f96ce15e)) +* update dependency kubernetes-sigs/controller-tools to v0.13.0 ([#1930](https://github.com/keptn/lifecycle-toolkit/issues/1930)) ([8b34b63](https://github.com/keptn/lifecycle-toolkit/commit/8b34b63404d0339633ef41ff1cf2005deae8d2b7)) +* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 0b618c4 ([#1654](https://github.com/keptn/lifecycle-toolkit/issues/1654)) ([c749313](https://github.com/keptn/lifecycle-toolkit/commit/c749313bfad7bd98b8d0ae7cc6dd2ea56f23e041)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 440c308 ([#2017](https://github.com/keptn/lifecycle-toolkit/issues/2017)) ([c365734](https://github.com/keptn/lifecycle-toolkit/commit/c365734fa7e3e40b2ae4c97c61628892d040dacc)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 88a54f9 ([#1794](https://github.com/keptn/lifecycle-toolkit/issues/1794)) ([fc976eb](https://github.com/keptn/lifecycle-toolkit/commit/fc976eb07ed9a5e49ed7d4ab1dbf187cee583e64)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 8dbec2d ([#1995](https://github.com/keptn/lifecycle-toolkit/issues/1995)) ([2f51445](https://github.com/keptn/lifecycle-toolkit/commit/2f5144540c4b3876e800bff29c30bfded334be40)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to bb133cf ([#1963](https://github.com/keptn/lifecycle-toolkit/issues/1963)) ([c7697bf](https://github.com/keptn/lifecycle-toolkit/commit/c7697bf54d5fe18b7c62c5b11801c6c83079b0a3)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to cba2de5 ([#1762](https://github.com/keptn/lifecycle-toolkit/issues/1762)) ([b77bcea](https://github.com/keptn/lifecycle-toolkit/commit/b77bceae39d6e4372b879afa326e7658d4ccdd89)) +* update golang.org/x/exp digest to d852ddb ([#2011](https://github.com/keptn/lifecycle-toolkit/issues/2011)) ([12ee7b6](https://github.com/keptn/lifecycle-toolkit/commit/12ee7b6f37c2422a37da1e53e4b9e250db6d8ca3)) +* update kubernetes packages (patch) ([#1786](https://github.com/keptn/lifecycle-toolkit/issues/1786)) ([cba2de5](https://github.com/keptn/lifecycle-toolkit/commit/cba2de5a5cd04c094131552aaf92c2b85ac23d21)) +* update kubernetes packages to v0.26.8 (patch) ([#1945](https://github.com/keptn/lifecycle-toolkit/issues/1945)) ([6ce03d6](https://github.com/keptn/lifecycle-toolkit/commit/6ce03d600cbb3d3d3988573c616ec7f3830ba324)) +* update module github.com/datadog/datadog-api-client-go/v2 to v2.15.0 ([#1803](https://github.com/keptn/lifecycle-toolkit/issues/1803)) ([ff62c60](https://github.com/keptn/lifecycle-toolkit/commit/ff62c6096f793307b54c0462dddf3473f2c2017d)) +* update module github.com/datadog/datadog-api-client-go/v2 to v2.16.0 ([#1957](https://github.com/keptn/lifecycle-toolkit/issues/1957)) ([00f3cd3](https://github.com/keptn/lifecycle-toolkit/commit/00f3cd3f1d9f27046f31cd36924c0bed855faed2)) +* update module github.com/open-feature/go-sdk to v1.7.0 ([#1854](https://github.com/keptn/lifecycle-toolkit/issues/1854)) ([8b90008](https://github.com/keptn/lifecycle-toolkit/commit/8b90008fc081e0da8029ffb1d28869a01efd15e6)) +* update module golang.org/x/net to v0.12.0 ([#1662](https://github.com/keptn/lifecycle-toolkit/issues/1662)) ([49318bf](https://github.com/keptn/lifecycle-toolkit/commit/49318bfc40497a120304de9d831dfe033259220f)) +* update module golang.org/x/net to v0.14.0 ([#1855](https://github.com/keptn/lifecycle-toolkit/issues/1855)) ([3186188](https://github.com/keptn/lifecycle-toolkit/commit/31861889bf7b227f489b941ac4a52db86551fcc2)) +* update module golang.org/x/net to v0.14.0 ([#2020](https://github.com/keptn/lifecycle-toolkit/issues/2020)) ([14573cd](https://github.com/keptn/lifecycle-toolkit/commit/14573cd1b3a0fec12ceb7bd3f23c3fa8432d8528)) diff --git a/metrics-operator/Makefile b/metrics-operator/Makefile index 77724360f92..825d01adfe8 100644 --- a/metrics-operator/Makefile +++ b/metrics-operator/Makefile @@ -7,7 +7,7 @@ RELEASE_REGISTRY?=ghcr.io/keptn RELEASE_TIME=$(shell date +%Y%m%d%s) BUILD_TIME=$(shell date -u "+%F_%T") RELEASE_VERSION?=$(RELEASE_TIME)-v0.24.3#$(shell git describe --tags --match "v*") -TAG?="v0.8.1" # x-release-please-version +TAG?="v0.8.2" # x-release-please-version RELEASE_IMAGE:=metrics-operator:$(TAG) CHART_APPVERSION?="" From 49a884b70bbe19ea1523d553195db879a71acc4b Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Wed, 6 Sep 2023 15:50:30 +0200 Subject: [PATCH 69/78] deps: update keptn components to v0.8.2 (#2048) --- .github/scripts/.helm-tests/default/result.yaml | 6 +++--- .github/scripts/.helm-tests/default/values.yaml | 6 +++--- helm/chart/README.md | 6 +++--- helm/chart/values.yaml | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/scripts/.helm-tests/default/result.yaml b/.github/scripts/.helm-tests/default/result.yaml index 5d84bab4393..ec42b9e0d98 100644 --- a/.github/scripts/.helm-tests/default/result.yaml +++ b/.github/scripts/.helm-tests/default/result.yaml @@ -7854,7 +7854,7 @@ spec: value: "0" - name: KUBERNETES_CLUSTER_DOMAIN value: cluster.local - image: ghcr.io/keptn/lifecycle-operator:v0.8.1 + image: ghcr.io/keptn/lifecycle-operator:v0.8.2 imagePullPolicy: Always name: manager ports: @@ -7969,7 +7969,7 @@ spec: value: "0" - name: KUBERNETES_CLUSTER_DOMAIN value: cluster.local - image: ghcr.io/keptn/metrics-operator:v0.8.1 + image: ghcr.io/keptn/metrics-operator:v0.8.2 name: manager ports: - containerPort: 9443 @@ -8063,7 +8063,7 @@ spec: value: "otel-collector:4317" - name: KUBERNETES_CLUSTER_DOMAIN value: cluster.local - image: ghcr.io/keptn/scheduler:v0.8.1 + image: ghcr.io/keptn/scheduler:v0.8.2 imagePullPolicy: Always name: scheduler resources: diff --git a/.github/scripts/.helm-tests/default/values.yaml b/.github/scripts/.helm-tests/default/values.yaml index 7fd975846fb..5988e71f988 100644 --- a/.github/scripts/.helm-tests/default/values.yaml +++ b/.github/scripts/.helm-tests/default/values.yaml @@ -81,7 +81,7 @@ lifecycleOperator: pythonRunnerImage: ghcr.io/keptn/python-runtime:v1.0.0 image: repository: ghcr.io/keptn/lifecycle-operator - tag: v0.8.1 + tag: v0.8.2 imagePullPolicy: Always livenessProbe: httpGet: @@ -148,7 +148,7 @@ metricsOperator: metricsControllerLogLevel: "0" image: repository: ghcr.io/keptn/metrics-operator - tag: v0.8.1 + tag: v0.8.2 livenessProbe: httpGet: path: /healthz @@ -211,7 +211,7 @@ scheduler: otelCollectorUrl: otel-collector:4317 image: repository: ghcr.io/keptn/scheduler - tag: v0.8.1 + tag: v0.8.2 imagePullPolicy: Always livenessProbe: httpGet: diff --git a/helm/chart/README.md b/helm/chart/README.md index e55e85d37b0..847af1cd968 100644 --- a/helm/chart/README.md +++ b/helm/chart/README.md @@ -13,7 +13,7 @@ as well as the concept of application health checks | `scheduler.scheduler.containerSecurityContext` | Sets security context | | | `scheduler.scheduler.env.otelCollectorUrl` | sets url for open telemetry collector | `otel-collector:4317` | | `scheduler.scheduler.image.repository` | set image repository for scheduler | `ghcr.io/keptn/scheduler` | -| `scheduler.scheduler.image.tag` | set image tag for scheduler | `v0.8.1` | +| `scheduler.scheduler.image.tag` | set image tag for scheduler | `v0.8.2` | | `scheduler.scheduler.imagePullPolicy` | set image pull policy for scheduler | `Always` | | `scheduler.scheduler.livenessProbe` | customizable liveness probe for the scheduler | | | `scheduler.scheduler.readinessProbe` | customizable readiness probe for the scheduler | | @@ -94,7 +94,7 @@ as well as the concept of application health checks | `lifecycleOperator.manager.env.functionRunnerImage` | specify image for deno task runtime | `ghcr.io/keptn/deno-runtime:v1.0.1` | | `lifecycleOperator.manager.env.pythonRunnerImage` | specify image for python task runtime | `ghcr.io/keptn/python-runtime:v1.0.0` | | `lifecycleOperator.manager.image.repository` | specify registry for manager image | `ghcr.io/keptn/lifecycle-operator` | -| `lifecycleOperator.manager.image.tag` | select tag for manager image | `v0.8.1` | +| `lifecycleOperator.manager.image.tag` | select tag for manager image | `v0.8.2` | | `lifecycleOperator.manager.imagePullPolicy` | specify pull policy for manager image | `Always` | | `lifecycleOperator.manager.livenessProbe` | custom livenessprobe for manager container | | | `lifecycleOperator.manager.readinessProbe` | custom readinessprobe for manager container | | @@ -147,7 +147,7 @@ as well as the concept of application health checks | `metricsOperator.manager.containerSecurityContext.runAsUser` | | `65532` | | `metricsOperator.manager.containerSecurityContext.seccompProfile.type` | | `RuntimeDefault` | | `metricsOperator.manager.image.repository` | specify registry for manager image | `ghcr.io/keptn/metrics-operator` | -| `metricsOperator.manager.image.tag` | select tag for manager image | `v0.8.1` | +| `metricsOperator.manager.image.tag` | select tag for manager image | `v0.8.2` | | `metricsOperator.manager.env.exposeKeptnMetrics` | enable metrics exporter | `true` | | `metricsOperator.manager.env.metricsControllerLogLevel` | sets the log level of Metrics Controller | `0` | | `metricsOperator.manager.env.analysisControllerLogLevel` | sets the log level of Analysis Controller | `0` | diff --git a/helm/chart/values.yaml b/helm/chart/values.yaml index 5d95ac1a418..8b32ea51a4a 100644 --- a/helm/chart/values.yaml +++ b/helm/chart/values.yaml @@ -81,7 +81,7 @@ lifecycleOperator: pythonRunnerImage: ghcr.io/keptn/python-runtime:v1.0.0 image: repository: ghcr.io/keptn/lifecycle-operator - tag: v0.8.1 + tag: v0.8.2 imagePullPolicy: Always livenessProbe: httpGet: @@ -150,7 +150,7 @@ metricsOperator: analysisControllerLogLevel: "0" image: repository: ghcr.io/keptn/metrics-operator - tag: v0.8.1 + tag: v0.8.2 livenessProbe: httpGet: path: /healthz @@ -213,7 +213,7 @@ scheduler: otelCollectorUrl: otel-collector:4317 image: repository: ghcr.io/keptn/scheduler - tag: v0.8.1 + tag: v0.8.2 imagePullPolicy: Always livenessProbe: httpGet: From 68b411e2f2c3cbb6bcfa694304c59cdbdb3e1619 Mon Sep 17 00:00:00 2001 From: keptn-bot <86361500+keptn-bot@users.noreply.github.com> Date: Thu, 7 Sep 2023 09:00:47 +0200 Subject: [PATCH 70/78] chore: release klt 0.8.2 (#1696) Co-authored-by: Moritz Wiesinger --- .../scripts/.helm-tests/default/result.yaml | 240 +++++++++--------- .release-please-manifest.json | 2 +- CHANGELOG.md | 156 ++++++++++++ Makefile | 2 +- helm/chart/Chart.yaml | 4 +- 5 files changed, 280 insertions(+), 124 deletions(-) diff --git a/.github/scripts/.helm-tests/default/result.yaml b/.github/scripts/.helm-tests/default/result.yaml index ec42b9e0d98..5c4ebf6d8d3 100644 --- a/.github/scripts/.helm-tests/default/result.yaml +++ b/.github/scripts/.helm-tests/default/result.yaml @@ -10,10 +10,10 @@ metadata: app.kubernetes.io/component: rbac app.kubernetes.io/created-by: certificate-operator app.kubernetes.io/part-of: keptn-lifecycle-toolkit - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm --- # Source: klt/templates/deployment.yaml @@ -23,10 +23,10 @@ metadata: name: keptn-scheduler namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm --- # Source: klt/templates/deployment.yaml @@ -36,10 +36,10 @@ metadata: name: lifecycle-operator namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm --- # Source: klt/templates/deployment.yaml @@ -49,10 +49,10 @@ metadata: name: metrics-operator namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm --- # Source: klt/templates/lifecycle-manager-config.yaml @@ -62,10 +62,10 @@ metadata: name: lifecycle-manager-config namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm data: controller_manager_config.yaml: | @@ -88,10 +88,10 @@ metadata: name: metrics-manager-config namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm data: controller_manager_config.yaml: | @@ -114,10 +114,10 @@ metadata: name: scheduler-config namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm data: scheduler-config.yaml: | @@ -144,10 +144,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: metrics.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: metrics.keptn.sh @@ -292,10 +292,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: metrics.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: metrics.keptn.sh @@ -652,10 +652,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: metrics.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: metrics.keptn.sh @@ -735,10 +735,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: conversion: @@ -1006,10 +1006,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: lifecycle.keptn.sh @@ -1075,10 +1075,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: conversion: @@ -1898,10 +1898,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: options.keptn.sh @@ -1974,10 +1974,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: lifecycle.keptn.sh @@ -2365,10 +2365,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: lifecycle.keptn.sh @@ -2564,10 +2564,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: conversion: @@ -2749,10 +2749,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: metrics.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: conversion: @@ -3054,10 +3054,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: metrics.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: metrics.keptn.sh @@ -3201,10 +3201,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: lifecycle.keptn.sh @@ -3613,10 +3613,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: lifecycle.keptn.sh @@ -5274,10 +5274,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: lifecycle.keptn.sh @@ -5572,10 +5572,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit crdGroup: lifecycle.keptn.sh keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: conversion: @@ -6359,10 +6359,10 @@ metadata: name: certificate-operator-role namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -6411,10 +6411,10 @@ metadata: name: keptn-scheduler namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -6602,10 +6602,10 @@ metadata: name: lifecycle-operator-role namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -6976,10 +6976,10 @@ metadata: name: metrics-operator-role namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -7084,10 +7084,10 @@ metadata: name: metrics-operator-server-resources namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -7106,10 +7106,10 @@ metadata: name: release-name-klt-server-resources namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -7129,10 +7129,10 @@ metadata: app.kubernetes.io/component: rbac app.kubernetes.io/created-by: certificate-operator app.kubernetes.io/part-of: keptn-lifecycle-toolkit - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7150,10 +7150,10 @@ metadata: name: hpa-controller-keptn-metrics namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7171,10 +7171,10 @@ metadata: name: keptn-scheduler namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7192,10 +7192,10 @@ metadata: name: lifecycle-operator-rolebinding namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7213,10 +7213,10 @@ metadata: name: metrics-operator-hpa-controller namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7234,10 +7234,10 @@ metadata: name: metrics-operator-rolebinding namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7255,10 +7255,10 @@ metadata: name: system-auth-delegator namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7276,10 +7276,10 @@ metadata: name: certificate-operator-role namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -7311,10 +7311,10 @@ metadata: app.kubernetes.io/component: rbac app.kubernetes.io/created-by: certificate-operator app.kubernetes.io/part-of: keptn-lifecycle-toolkit - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -7356,10 +7356,10 @@ metadata: name: lifecycle-operator-leader-election-role namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -7401,10 +7401,10 @@ metadata: name: metrics-operator-leader-election-role namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm rules: - apiGroups: @@ -7449,10 +7449,10 @@ metadata: app.kubernetes.io/component: rbac app.kubernetes.io/created-by: certificate-operator app.kubernetes.io/part-of: keptn-lifecycle-toolkit - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7473,10 +7473,10 @@ metadata: app.kubernetes.io/component: rbac app.kubernetes.io/created-by: certificate-operator app.kubernetes.io/part-of: keptn-lifecycle-toolkit - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7494,10 +7494,10 @@ metadata: name: extension-apiserver-authentication-reader namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7515,10 +7515,10 @@ metadata: name: lifecycle-operator-leader-election-rolebinding namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7536,10 +7536,10 @@ metadata: name: lifecycle-operator-rolebinding namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7557,10 +7557,10 @@ metadata: name: metrics-operator-leader-election-rolebinding namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7578,10 +7578,10 @@ metadata: name: metrics-operator-rolebinding namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm roleRef: apiGroup: rbac.authorization.k8s.io @@ -7600,10 +7600,10 @@ metadata: namespace: "helmtests" labels: control-plane: lifecycle-operator - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: type: ClusterIP @@ -7624,10 +7624,10 @@ metadata: name: lifecycle-webhook-service namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: type: ClusterIP @@ -7648,10 +7648,10 @@ metadata: namespace: "helmtests" labels: control-plane: metrics-operator - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: type: ClusterIP @@ -7679,10 +7679,10 @@ metadata: name: metrics-webhook-service namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: type: ClusterIP @@ -7706,10 +7706,10 @@ metadata: app.kubernetes.io/created-by: certificate-operator app.kubernetes.io/part-of: keptn-lifecycle-toolkit control-plane: certificate-operator - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: replicas: 1 @@ -7791,10 +7791,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit control-plane: lifecycle-operator keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: replicas: 1 @@ -7920,10 +7920,10 @@ metadata: app.kubernetes.io/part-of: keptn-lifecycle-toolkit control-plane: metrics-operator keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: replicas: 1 @@ -8035,10 +8035,10 @@ metadata: namespace: "helmtests" labels: component: scheduler - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: replicas: 1 @@ -8113,10 +8113,10 @@ metadata: name: v1beta1.custom.metrics.k8s.io namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: custom.metrics.k8s.io @@ -8135,10 +8135,10 @@ metadata: name: v1beta2.custom.metrics.k8s.io namespace: "helmtests" labels: - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm spec: group: custom.metrics.k8s.io @@ -8160,10 +8160,10 @@ metadata: labels: keptn.sh/inject-cert: "true" app.kubernetes.io/part-of: "keptn-lifecycle-toolkit" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm webhooks: - admissionReviewVersions: @@ -8216,10 +8216,10 @@ metadata: cert-manager.io/inject-ca-from: 'helmtests/klt-certs' labels: keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm webhooks: - admissionReviewVersions: @@ -8252,10 +8252,10 @@ metadata: cert-manager.io/inject-ca-from: 'helmtests/klt-certs' labels: keptn.sh/inject-cert: "true" - helm.sh/chart: klt-0.2.5 + helm.sh/chart: klt-0.2.6 app.kubernetes.io/name: klt app.kubernetes.io/instance: release-name - app.kubernetes.io/version: "v0.8.1" + app.kubernetes.io/version: "v0.8.2" app.kubernetes.io/managed-by: Helm webhooks: - admissionReviewVersions: diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f5628c025ec..7d75a4fcd70 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,5 +1,5 @@ { - ".": "0.8.1", + ".": "0.8.2", "klt-cert-manager": "1.1.0", "runtimes/python-runtime": "1.0.0", "runtimes/deno-runtime": "1.0.1", diff --git a/CHANGELOG.md b/CHANGELOG.md index ef5b0242dd2..d445b980ade 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,161 @@ # Changelog +## [0.8.2](https://github.com/keptn/lifecycle-toolkit/compare/klt-v0.8.1...klt-v0.8.2) (2023-09-06) + + +### Features + +* add `aggregation` field in `KeptnMetric` ([#1780](https://github.com/keptn/lifecycle-toolkit/issues/1780)) ([c0b66ea](https://github.com/keptn/lifecycle-toolkit/commit/c0b66eae296e0502608dd66c5fe7eb8f890497e6)) +* add `step` field in `KeptnMetric` ([#1755](https://github.com/keptn/lifecycle-toolkit/issues/1755)) ([03ca7dd](https://github.com/keptn/lifecycle-toolkit/commit/03ca7ddde4ce787d0bfddaba2bb3f7b422ff5d6a)) +* add cloud events support ([#1843](https://github.com/keptn/lifecycle-toolkit/issues/1843)) ([5b47120](https://github.com/keptn/lifecycle-toolkit/commit/5b471203e412a919903876212ac45c04f180e482)) +* add grafana labels to work with kube-prometheus-stack ([#1757](https://github.com/keptn/lifecycle-toolkit/issues/1757)) ([3b7d5ed](https://github.com/keptn/lifecycle-toolkit/commit/3b7d5ed9bd4f09ff49a84e34e3b708edbbff12d8)) +* add monitor action to all KLT workflows ([#1923](https://github.com/keptn/lifecycle-toolkit/issues/1923)) ([ee0a0f3](https://github.com/keptn/lifecycle-toolkit/commit/ee0a0f36a42178353202fe0ca407f385cd82b5b5)) +* **lifecycle-operator:** clean up KeptnTask API by removing duplicated attributes ([#1965](https://github.com/keptn/lifecycle-toolkit/issues/1965)) ([257b220](https://github.com/keptn/lifecycle-toolkit/commit/257b220a6171ccc82d1b471002b6cf773ec9bd09)) +* metrics-operator monorepo setup ([#1791](https://github.com/keptn/lifecycle-toolkit/issues/1791)) ([51445eb](https://github.com/keptn/lifecycle-toolkit/commit/51445ebd24b0914d34b0339ab05ec939440aa4a3)) +* **metrics-operator:** add analysis controller ([#1875](https://github.com/keptn/lifecycle-toolkit/issues/1875)) ([017e08b](https://github.com/keptn/lifecycle-toolkit/commit/017e08b0a65679ca417e363f2223b7f4fef3bc55)) +* **metrics-operator:** add Analysis CRD ([#1839](https://github.com/keptn/lifecycle-toolkit/issues/1839)) ([9521a16](https://github.com/keptn/lifecycle-toolkit/commit/9521a16ce4946d3169993780f2d2a4f3a75d0445)) +* **metrics-operator:** add AnalysisDefinition CRD ([#1823](https://github.com/keptn/lifecycle-toolkit/issues/1823)) ([adf4621](https://github.com/keptn/lifecycle-toolkit/commit/adf4621c2e8147bc0e4ee7f1719859007290c978)) +* **metrics-operator:** add AnalysisValueTemplate CRD ([#1822](https://github.com/keptn/lifecycle-toolkit/issues/1822)) ([f25b24d](https://github.com/keptn/lifecycle-toolkit/commit/f25b24dfef07a600c0fbcd4bdb540efe58cff387)) +* **metrics-operator:** introduce range operators in AnalysisDefinition ([#1976](https://github.com/keptn/lifecycle-toolkit/issues/1976)) ([7fb8952](https://github.com/keptn/lifecycle-toolkit/commit/7fb8952c514909ce2c0202e01f1cf501de2c8d55)) +* monorepo setup for lifecycle-operator, scheduler and runtimes ([#1857](https://github.com/keptn/lifecycle-toolkit/issues/1857)) ([84e243a](https://github.com/keptn/lifecycle-toolkit/commit/84e243a213ffba86eddd51ccc4bf4dbd61140069)) +* update stability of Certificate Manager ([#1733](https://github.com/keptn/lifecycle-toolkit/issues/1733)) ([e83d2ae](https://github.com/keptn/lifecycle-toolkit/commit/e83d2ae4a4724d4da8fee63f23a0c063275fac91)) + + +### Bug Fixes + +* add missing cert-injection annotations to helm-chart test result ([#1873](https://github.com/keptn/lifecycle-toolkit/issues/1873)) ([56d6598](https://github.com/keptn/lifecycle-toolkit/commit/56d659812c2fdeda1137d9f9f04701cb1775e434)) +* admit pod without creating KLT resources if owner of the pod is not supported ([#1752](https://github.com/keptn/lifecycle-toolkit/issues/1752)) ([f47ca50](https://github.com/keptn/lifecycle-toolkit/commit/f47ca50c1e34548466f9368c260c533e293754ad)) +* bump KLT version in helm values ([#1697](https://github.com/keptn/lifecycle-toolkit/issues/1697)) ([342d9d1](https://github.com/keptn/lifecycle-toolkit/commit/342d9d14fff2ad7b387d2adff0ef7331d43f48ff)) +* fix Go badge ([#1983](https://github.com/keptn/lifecycle-toolkit/issues/1983)) ([c989a6c](https://github.com/keptn/lifecycle-toolkit/commit/c989a6c5a0d0498d9157380018c3c19013a9cd30)) +* **operator:** sanitize app name annotation from uppercase to lowercase ([#1793](https://github.com/keptn/lifecycle-toolkit/issues/1793)) ([0986360](https://github.com/keptn/lifecycle-toolkit/commit/0986360ddaed1ee1c56552f46b98964809dd19c1)) +* remove klt-cert-manager from version bumps during KLT release ([#1783](https://github.com/keptn/lifecycle-toolkit/issues/1783)) ([a53e8e0](https://github.com/keptn/lifecycle-toolkit/commit/a53e8e0991e46193d7d0e10325ceae98934b7acd)) +* take last element in tag as Workload version number ([#1726](https://github.com/keptn/lifecycle-toolkit/issues/1726)) ([dc3ade0](https://github.com/keptn/lifecycle-toolkit/commit/dc3ade0af20e8ac424bfb860bd8d871d76b81119)) +* update DOCKER CMD on docs/Makefile ([#1745](https://github.com/keptn/lifecycle-toolkit/issues/1745)) ([a9ac9f6](https://github.com/keptn/lifecycle-toolkit/commit/a9ac9f6cba77fd12154bccc8e8647b6dd1a8fba0)) + + +### Other + +* add metrics-operator back to renovate ([#2047](https://github.com/keptn/lifecycle-toolkit/issues/2047)) ([e5a92c1](https://github.com/keptn/lifecycle-toolkit/commit/e5a92c1c8405d478018006f018a13fa81cb729b4)) +* add status field docs to all CRDs ([#1807](https://github.com/keptn/lifecycle-toolkit/issues/1807)) ([650ecba](https://github.com/keptn/lifecycle-toolkit/commit/650ecba95624ed3dc2bd61bf1f86578f450223a5)) +* cleanup unused env variables in Makefile ([#1913](https://github.com/keptn/lifecycle-toolkit/issues/1913)) ([1ddd089](https://github.com/keptn/lifecycle-toolkit/commit/1ddd089556aa381b7bf85764e0d6dba7789cf99c)) +* create pull request template ([#1936](https://github.com/keptn/lifecycle-toolkit/issues/1936)) ([a3f366d](https://github.com/keptn/lifecycle-toolkit/commit/a3f366d4fe4aa2e6d425526c9726dbe7a084e6ac)) +* fix minor security issues ([#1728](https://github.com/keptn/lifecycle-toolkit/issues/1728)) ([ea73cd9](https://github.com/keptn/lifecycle-toolkit/commit/ea73cd983102632fb162e1b4c8ae56687b288b25)) +* improved example on app yamls ([#1821](https://github.com/keptn/lifecycle-toolkit/issues/1821)) ([584138f](https://github.com/keptn/lifecycle-toolkit/commit/584138fe9a37db2e6f9518906de483b6fde0f504)) +* **main:** release lifecycle-operator-and-scheduler libraries ([#1979](https://github.com/keptn/lifecycle-toolkit/issues/1979)) ([12d0f40](https://github.com/keptn/lifecycle-toolkit/commit/12d0f40725e466825c4a0d483fa344e5888b03ae)) +* more renaming ([#1830](https://github.com/keptn/lifecycle-toolkit/issues/1830)) ([f2d5bdd](https://github.com/keptn/lifecycle-toolkit/commit/f2d5bdd5700fef1289f67763bf361af7f2bacbd7)) +* move from continuous helmify to custom chart ([#1840](https://github.com/keptn/lifecycle-toolkit/issues/1840)) ([b8d6241](https://github.com/keptn/lifecycle-toolkit/commit/b8d6241687ac9a02ac09a97c10312dde957634ae)) +* **operator:** remove dependency on metrics-operator ([#1715](https://github.com/keptn/lifecycle-toolkit/issues/1715)) ([8e2aa3b](https://github.com/keptn/lifecycle-toolkit/commit/8e2aa3b37cb074d32623289702bbda81119b5784)) +* **operator:** standardize k8s Events on lifecycle path ([#1692](https://github.com/keptn/lifecycle-toolkit/issues/1692)) ([92730ad](https://github.com/keptn/lifecycle-toolkit/commit/92730ad5bdcca5328b1f5c04636ae057c1d923e5)) +* **operator:** unexport EventSender in BuilderOptions ([#1698](https://github.com/keptn/lifecycle-toolkit/issues/1698)) ([c7e7335](https://github.com/keptn/lifecycle-toolkit/commit/c7e7335a680d3ad7ce76dfdce59e6b64a5d9f41a)) +* promote Release Lifecycle to beta ([#1833](https://github.com/keptn/lifecycle-toolkit/issues/1833)) ([ee90157](https://github.com/keptn/lifecycle-toolkit/commit/ee90157b1d9180526a3483482f1f4d5275178fc8)) +* release cert-manager 1.0.0 ([#1619](https://github.com/keptn/lifecycle-toolkit/issues/1619)) ([5a11d9a](https://github.com/keptn/lifecycle-toolkit/commit/5a11d9a1165f894e7d7e3efd0f29d90d03f7eb36)) +* release cert-manager 1.1.0 ([#1972](https://github.com/keptn/lifecycle-toolkit/issues/1972)) ([bb133cf](https://github.com/keptn/lifecycle-toolkit/commit/bb133cfd2ac3207e8a4006eb7a9390dc58737465)) +* release cert-manager 1.1.0 ([#1993](https://github.com/keptn/lifecycle-toolkit/issues/1993)) ([a8c22f7](https://github.com/keptn/lifecycle-toolkit/commit/a8c22f779eafd68ea12c97c808ad2041fc89acbf)) +* release cert-manager 1.1.0 ([#1998](https://github.com/keptn/lifecycle-toolkit/issues/1998)) ([5fbee38](https://github.com/keptn/lifecycle-toolkit/commit/5fbee380634244e32ac0bb90b0cf4b74ee72b661)) +* release deno-runtime 1.0.0 ([#1975](https://github.com/keptn/lifecycle-toolkit/issues/1975)) ([8df9ca4](https://github.com/keptn/lifecycle-toolkit/commit/8df9ca4840201106361b8ab8d2e7765d946b5ed2)) +* release deno-runtime 1.0.1 ([#1990](https://github.com/keptn/lifecycle-toolkit/issues/1990)) ([4e088c5](https://github.com/keptn/lifecycle-toolkit/commit/4e088c535645815dcb3fb58f1c09dc67b97e0c02)) +* release lifecycle-operator 0.8.2 ([#2033](https://github.com/keptn/lifecycle-toolkit/issues/2033)) ([17ef13a](https://github.com/keptn/lifecycle-toolkit/commit/17ef13a2fe2782c7499d923d1a91fd05f6503047)) +* release metrics-operator 0.8.2 ([#2030](https://github.com/keptn/lifecycle-toolkit/issues/2030)) ([c523cb0](https://github.com/keptn/lifecycle-toolkit/commit/c523cb017f3ff9d6adb65b9a0e7d9e63712e6b3e)) +* release python-runtime 1.0.0 ([#1969](https://github.com/keptn/lifecycle-toolkit/issues/1969)) ([9a995c4](https://github.com/keptn/lifecycle-toolkit/commit/9a995c447e65a4a96d4d3dca53f40a0c1c383b70)) +* release scheduler 0.8.2 ([#2032](https://github.com/keptn/lifecycle-toolkit/issues/2032)) ([cb4d2b1](https://github.com/keptn/lifecycle-toolkit/commit/cb4d2b14a7a772572b505fa844db6f08a45db291)) +* release scheduler 0.8.2 ([#2043](https://github.com/keptn/lifecycle-toolkit/issues/2043)) ([621c59d](https://github.com/keptn/lifecycle-toolkit/commit/621c59d26c22af492ea3fbc947071c6a07c0ffbd)) +* remove cert manager from renovate ignores ([#1962](https://github.com/keptn/lifecycle-toolkit/issues/1962)) ([972b3bb](https://github.com/keptn/lifecycle-toolkit/commit/972b3bbcec735c3361fb8e236b1e2c61edaebbb4)) +* remove generation of KLT manifest releases ([#1850](https://github.com/keptn/lifecycle-toolkit/issues/1850)) ([36b2dff](https://github.com/keptn/lifecycle-toolkit/commit/36b2dff6c8ec26aa4552542e236b3d790d65da57)) +* remove helm chart generation from CI ([#1856](https://github.com/keptn/lifecycle-toolkit/issues/1856)) ([768b3e9](https://github.com/keptn/lifecycle-toolkit/commit/768b3e9d6d3a2254be13402615ee1ff06c734214)) +* remove monitor action ([#1989](https://github.com/keptn/lifecycle-toolkit/issues/1989)) ([b0b37ea](https://github.com/keptn/lifecycle-toolkit/commit/b0b37ea56c5b36298834cb8fc1b6fbc8ac345906)) +* rename operator folder to lifecycle-operator ([#1819](https://github.com/keptn/lifecycle-toolkit/issues/1819)) ([97a2d25](https://github.com/keptn/lifecycle-toolkit/commit/97a2d25919c0a02165dd0dc6c7c82d57ad200139)) +* rename sonar settings ([#1831](https://github.com/keptn/lifecycle-toolkit/issues/1831)) ([952712f](https://github.com/keptn/lifecycle-toolkit/commit/952712f2c1c70dfa412bcb8adfdbe96fd392ad7d)) +* simplify dashboard installation ([#1815](https://github.com/keptn/lifecycle-toolkit/issues/1815)) ([7c4e7bc](https://github.com/keptn/lifecycle-toolkit/commit/7c4e7bc2b5f7679daf6e2a42f0b72eda6a8b2ea3)) +* support external cert-manager ([#1864](https://github.com/keptn/lifecycle-toolkit/issues/1864)) ([50dac48](https://github.com/keptn/lifecycle-toolkit/commit/50dac48ddba2181acb28aa714ba7e6605b038df5)) + + +### Docs + +* adapt DORA metrics kubectl command ([#1865](https://github.com/keptn/lifecycle-toolkit/issues/1865)) ([05d2f51](https://github.com/keptn/lifecycle-toolkit/commit/05d2f51e30b82be89752de3a29fe2743c9dc9154)) +* add info to implementing/tasks about sequential execution ([#1950](https://github.com/keptn/lifecycle-toolkit/issues/1950)) ([61f92c3](https://github.com/keptn/lifecycle-toolkit/commit/61f92c335b26e79cf058db39c9b31fb44088951c)) +* added troubleshooting page ([#1860](https://github.com/keptn/lifecycle-toolkit/issues/1860)) ([43f439b](https://github.com/keptn/lifecycle-toolkit/commit/43f439b09878fbe06bbae2714e033389a367f702)) +* change releases link to get started in mainpage header menu ([#1738](https://github.com/keptn/lifecycle-toolkit/issues/1738)) ([1f9ea33](https://github.com/keptn/lifecycle-toolkit/commit/1f9ea332ad5c2d8375f8d3300927c5ad31ccbf0a)) +* clean up KLT README file ([#1685](https://github.com/keptn/lifecycle-toolkit/issues/1685)) ([5204457](https://github.com/keptn/lifecycle-toolkit/commit/5204457870bbd2ee6e450b244043fe51aea3212a)) +* conceptual mapping of Keptn v1 components to KLT components ([#1628](https://github.com/keptn/lifecycle-toolkit/issues/1628)) ([fa2b54d](https://github.com/keptn/lifecycle-toolkit/commit/fa2b54da52c58a3d9a12fd6cbb39a73e0e58e072)) +* contrib: DCO ([#1886](https://github.com/keptn/lifecycle-toolkit/issues/1886)) ([2fdd9cb](https://github.com/keptn/lifecycle-toolkit/commit/2fdd9cb7f51c7ae210b8a8d2fc4da93cfafd95ec)) +* contrib: set up dev environment ([#1888](https://github.com/keptn/lifecycle-toolkit/issues/1888)) ([2778c21](https://github.com/keptn/lifecycle-toolkit/commit/2778c211d5af5c7e4877445ac3ee768843a24c15)) +* contribution guidelines ([#1906](https://github.com/keptn/lifecycle-toolkit/issues/1906)) ([25bf6ce](https://github.com/keptn/lifecycle-toolkit/commit/25bf6ce1a32b15c870c3dadff861999eef8a4896)) +* create crd-template.md ([#1885](https://github.com/keptn/lifecycle-toolkit/issues/1885)) ([06defd3](https://github.com/keptn/lifecycle-toolkit/commit/06defd31b6d1c805a3ff67cfd9800a3e888337e8)) +* deployment flow architecture ([#1470](https://github.com/keptn/lifecycle-toolkit/issues/1470)) ([6fe5192](https://github.com/keptn/lifecycle-toolkit/commit/6fe5192293175bf6946f74bba0e9057e704ab8c7)) +* document `timeframe` feature for `KeptnMetric` ([#1703](https://github.com/keptn/lifecycle-toolkit/issues/1703)) ([077f0d5](https://github.com/keptn/lifecycle-toolkit/commit/077f0d5d0a49bc5b1f0e800274343660b8218c65)) +* edits to metrics-operator architecture page ([#1679](https://github.com/keptn/lifecycle-toolkit/issues/1679)) ([7eb8afe](https://github.com/keptn/lifecycle-toolkit/commit/7eb8afecde7b5d7d8f96cb3c1f2370eb60410a7a)) +* excercises text changed to exercises ([#1693](https://github.com/keptn/lifecycle-toolkit/issues/1693)) ([df4cda6](https://github.com/keptn/lifecycle-toolkit/commit/df4cda68c97c464983a482faeaabe91e38d05637)) +* fix branding homepage ([#2041](https://github.com/keptn/lifecycle-toolkit/issues/2041)) ([e91137e](https://github.com/keptn/lifecycle-toolkit/commit/e91137ee91e08bb59b91d8f1dad1bcbc977e2a39)) +* fix broken links ([#1921](https://github.com/keptn/lifecycle-toolkit/issues/1921)) ([44074a2](https://github.com/keptn/lifecycle-toolkit/commit/44074a29391ab157b0279f2728b6232c15a8c13a)) +* fix link to deno web page ([#1908](https://github.com/keptn/lifecycle-toolkit/issues/1908)) ([d63182f](https://github.com/keptn/lifecycle-toolkit/commit/d63182f1af83f282676bee97301e80e1f97fdea6)) +* fix links in dev builds ([#1722](https://github.com/keptn/lifecycle-toolkit/issues/1722)) ([a35ed45](https://github.com/keptn/lifecycle-toolkit/commit/a35ed45fabd2314922fc9631ef585bdb10c3c295)) +* fix typo ([#1706](https://github.com/keptn/lifecycle-toolkit/issues/1706)) ([3690cd3](https://github.com/keptn/lifecycle-toolkit/commit/3690cd3aea124b48873168b2a14d31cd67840a8b)) +* fix typo ([#1754](https://github.com/keptn/lifecycle-toolkit/issues/1754)) ([9ebdcec](https://github.com/keptn/lifecycle-toolkit/commit/9ebdcec83ab3c9416c5ae2a597352cfc34271661)) +* fix typos and grammar issues ([#1925](https://github.com/keptn/lifecycle-toolkit/issues/1925)) ([5570d55](https://github.com/keptn/lifecycle-toolkit/commit/5570d555bfc4bbdcbfc66b2725d5352090e5b937)) +* fixed typo ([#1799](https://github.com/keptn/lifecycle-toolkit/issues/1799)) ([b9393be](https://github.com/keptn/lifecycle-toolkit/commit/b9393be558da31b5d0ee4541fc28942b85752f07)) +* fixed typo Troubleshoort to Troubleshoot ([#1776](https://github.com/keptn/lifecycle-toolkit/issues/1776)) ([eb7c9b2](https://github.com/keptn/lifecycle-toolkit/commit/eb7c9b20b7b71ed598a0ac8681335d91c4a621db)) +* git contributing guide ([#1892](https://github.com/keptn/lifecycle-toolkit/issues/1892)) ([30393c6](https://github.com/keptn/lifecycle-toolkit/commit/30393c6e6d1127cde12812810afc1bb8f97a1498)) +* how to use GitHub Codespaces to contribute to Keptn ([#1977](https://github.com/keptn/lifecycle-toolkit/issues/1977)) ([c96cb72](https://github.com/keptn/lifecycle-toolkit/commit/c96cb727931abdeeb9bcbbc2e551dc5722a9ed88)) +* implement KLT -> Keptn name change ([#2001](https://github.com/keptn/lifecycle-toolkit/issues/2001)) ([440c308](https://github.com/keptn/lifecycle-toolkit/commit/440c3082e5400f89d791724651984ba2bc0a4724)) +* implement KLT -> Keptn name change for tasks page ([#2016](https://github.com/keptn/lifecycle-toolkit/issues/2016)) ([8516716](https://github.com/keptn/lifecycle-toolkit/commit/8516716c8c7a7a265df3a9d65b2291707c96cd76)) +* improve "Intro to Keptn" page ([#2040](https://github.com/keptn/lifecycle-toolkit/issues/2040)) ([af4f417](https://github.com/keptn/lifecycle-toolkit/commit/af4f417ea0455d2dc26c00eafc9445fe1a208d49)) +* improve how-to and ref info for apps ([#1868](https://github.com/keptn/lifecycle-toolkit/issues/1868)) ([7139ffd](https://github.com/keptn/lifecycle-toolkit/commit/7139ffd67115210c4fc760987748c01853b94eab)) +* keptn Scheduler architecture documentation ([#1777](https://github.com/keptn/lifecycle-toolkit/issues/1777)) ([ce96200](https://github.com/keptn/lifecycle-toolkit/commit/ce96200b9bfed62062b199845104c4493b3a2627)) +* manifests ref section, edits to ref section intros ([#1800](https://github.com/keptn/lifecycle-toolkit/issues/1800)) ([604876f](https://github.com/keptn/lifecycle-toolkit/commit/604876f6a7b51b7185db18c5daabe0d23a2b5eaf)) +* migrate quality gates ([#1708](https://github.com/keptn/lifecycle-toolkit/issues/1708)) ([0cec244](https://github.com/keptn/lifecycle-toolkit/commit/0cec244f1ed3da8e10312dc6e820b3129d161d9f)) +* restructure migration guide ([#1838](https://github.com/keptn/lifecycle-toolkit/issues/1838)) ([8eb05c7](https://github.com/keptn/lifecycle-toolkit/commit/8eb05c7e75b7d2377835b6915df15bfa7a19c756)) +* rewrite README file ([#1862](https://github.com/keptn/lifecycle-toolkit/issues/1862)) ([e304969](https://github.com/keptn/lifecycle-toolkit/commit/e3049690da849cce749fab9bb8c1d4e0edd6f473)) +* simplify installation page ([#1751](https://github.com/keptn/lifecycle-toolkit/issues/1751)) ([a2144f5](https://github.com/keptn/lifecycle-toolkit/commit/a2144f501f8b8a062f77b711e09bdfbaba3bbf6e)) +* small improvements ([#1951](https://github.com/keptn/lifecycle-toolkit/issues/1951)) ([6273709](https://github.com/keptn/lifecycle-toolkit/commit/627370907807d1805dcff7e224a2edafe30c8383)) +* tutorial Run Standalone tasks for non-k8s apps ([#1947](https://github.com/keptn/lifecycle-toolkit/issues/1947)) ([a8d6902](https://github.com/keptn/lifecycle-toolkit/commit/a8d6902c7e283bf6a9dec1526b35fa57e1d05fc1)) +* update auto generated docs to include `spec.range.step` in `KeptnMetric` ([#1806](https://github.com/keptn/lifecycle-toolkit/issues/1806)) ([8a90145](https://github.com/keptn/lifecycle-toolkit/commit/8a90145bc024b8046423a3847664cb16f74e53a5)) +* update docs/content/en/contribute/docs/local-building/index.md ([#1753](https://github.com/keptn/lifecycle-toolkit/issues/1753)) ([14494c5](https://github.com/keptn/lifecycle-toolkit/commit/14494c5a66e2d4e26ba40299b25424d6127516fa)) +* update the doc source file structure page ([#1984](https://github.com/keptn/lifecycle-toolkit/issues/1984)) ([124e243](https://github.com/keptn/lifecycle-toolkit/commit/124e2433888e76277fca640ba56f5a19bbebdfbe)) + + +### Dependency Updates + +* update actions/setup-node action to v3.7.0 ([#1713](https://github.com/keptn/lifecycle-toolkit/issues/1713)) ([7a610ef](https://github.com/keptn/lifecycle-toolkit/commit/7a610ef50c54ac590a072741e76eeca4c6b27cc4)) +* update actions/setup-node action to v3.8.1 ([#1912](https://github.com/keptn/lifecycle-toolkit/issues/1912)) ([642842a](https://github.com/keptn/lifecycle-toolkit/commit/642842abec87475ccbbda035ef992051c42071ef)) +* update aquasecurity/trivy-action action to v0.12.0 ([#2010](https://github.com/keptn/lifecycle-toolkit/issues/2010)) ([093670c](https://github.com/keptn/lifecycle-toolkit/commit/093670caded5e7d78de5923eed2b795b71ca0eac)) +* update curlimages/curl docker tag to v8.2.1 ([#1792](https://github.com/keptn/lifecycle-toolkit/issues/1792)) ([88a54f9](https://github.com/keptn/lifecycle-toolkit/commit/88a54f97c1573038f8c1e762e2cffe40de513a7e)) +* update denoland/deno docker tag to alpine-1.36.1 ([#1924](https://github.com/keptn/lifecycle-toolkit/issues/1924)) ([4031ec0](https://github.com/keptn/lifecycle-toolkit/commit/4031ec01b44777c86f9d623dcfd8195177be01fa)) +* update dependency argoproj/argo-cd to v2.7.10 ([#1795](https://github.com/keptn/lifecycle-toolkit/issues/1795)) ([3936cf0](https://github.com/keptn/lifecycle-toolkit/commit/3936cf0581eeb27cb409055b0be49127ff4c7c6d)) +* update dependency argoproj/argo-cd to v2.7.11 ([#1877](https://github.com/keptn/lifecycle-toolkit/issues/1877)) ([72fba14](https://github.com/keptn/lifecycle-toolkit/commit/72fba143c16f341bf01899a4e92a21255aaac855)) +* update dependency argoproj/argo-cd to v2.7.8 ([#1763](https://github.com/keptn/lifecycle-toolkit/issues/1763)) ([b168ef5](https://github.com/keptn/lifecycle-toolkit/commit/b168ef58a99bf7993ab153a9361e79f31ddeffd0)) +* update dependency argoproj/argo-cd to v2.8.0 ([#1927](https://github.com/keptn/lifecycle-toolkit/issues/1927)) ([2a6bc6a](https://github.com/keptn/lifecycle-toolkit/commit/2a6bc6a26de4e61a7945b225cc079960f0d7381c)) +* update dependency argoproj/argo-cd to v2.8.2 ([#1956](https://github.com/keptn/lifecycle-toolkit/issues/1956)) ([04456d5](https://github.com/keptn/lifecycle-toolkit/commit/04456d5a75dd855e675bd7375e360612e2a24057)) +* update dependency autoprefixer to v10.4.15 ([#1909](https://github.com/keptn/lifecycle-toolkit/issues/1909)) ([8dbec2d](https://github.com/keptn/lifecycle-toolkit/commit/8dbec2d6116fb20bac86162aaea2b75c24eb96be)) +* update dependency bitnami-labs/readme-generator-for-helm to v2.5.1 ([#1849](https://github.com/keptn/lifecycle-toolkit/issues/1849)) ([48236c9](https://github.com/keptn/lifecycle-toolkit/commit/48236c954a5e97df03d774415443d1dea30eab88)) +* update dependency cloud-bulldozer/kube-burner to v1.7.4 ([#1797](https://github.com/keptn/lifecycle-toolkit/issues/1797)) ([69606e6](https://github.com/keptn/lifecycle-toolkit/commit/69606e60e3478049e3533a2711a0ee1fb4de0d8e)) +* update dependency cloud-bulldozer/kube-burner to v1.7.5 ([#1910](https://github.com/keptn/lifecycle-toolkit/issues/1910)) ([29a82be](https://github.com/keptn/lifecycle-toolkit/commit/29a82be86a945825f0b526f149c223ad7652163f)) +* update dependency cloud-bulldozer/kube-burner to v1.7.6 ([#2000](https://github.com/keptn/lifecycle-toolkit/issues/2000)) ([ca1fe57](https://github.com/keptn/lifecycle-toolkit/commit/ca1fe57fecd5978d63e900a0cb060f29ba7fbe74)) +* update dependency golangci/golangci-lint to v1.54.1 ([#1928](https://github.com/keptn/lifecycle-toolkit/issues/1928)) ([cc36f34](https://github.com/keptn/lifecycle-toolkit/commit/cc36f34096b892611cb42e073cd6f9cc01c5365f)) +* update dependency golangci/golangci-lint to v1.54.2 ([#1937](https://github.com/keptn/lifecycle-toolkit/issues/1937)) ([db5bcbf](https://github.com/keptn/lifecycle-toolkit/commit/db5bcbf33477b11dea602e2050bc9c366c654a6f)) +* update dependency helm/helm to v3.12.2 ([#1764](https://github.com/keptn/lifecycle-toolkit/issues/1764)) ([8216e6b](https://github.com/keptn/lifecycle-toolkit/commit/8216e6b65aac53f670aec5f383f3edbfbcbd526b)) +* update dependency jaegertracing/jaeger to v1.48.0 ([#1542](https://github.com/keptn/lifecycle-toolkit/issues/1542)) ([0596eb5](https://github.com/keptn/lifecycle-toolkit/commit/0596eb51012ff912af9d6e26a5341b0eb707ea06)) +* update dependency jaegertracing/jaeger-operator to v1.47.0 ([#1638](https://github.com/keptn/lifecycle-toolkit/issues/1638)) ([6bb371e](https://github.com/keptn/lifecycle-toolkit/commit/6bb371eb15d60f5d1a2c5e6d175e78a2c3650489)) +* update dependency jaegertracing/jaeger-operator to v1.48.0 ([#2018](https://github.com/keptn/lifecycle-toolkit/issues/2018)) ([db781c7](https://github.com/keptn/lifecycle-toolkit/commit/db781c737d39b79e8a745e245b327d1d6220d98f)) +* update dependency kubernetes-sigs/controller-tools to v0.12.1 ([#1765](https://github.com/keptn/lifecycle-toolkit/issues/1765)) ([ba79a32](https://github.com/keptn/lifecycle-toolkit/commit/ba79a32ef6acc9de8fb5d618b9ede7d6f96ce15e)) +* update dependency kubernetes-sigs/controller-tools to v0.13.0 ([#1930](https://github.com/keptn/lifecycle-toolkit/issues/1930)) ([8b34b63](https://github.com/keptn/lifecycle-toolkit/commit/8b34b63404d0339633ef41ff1cf2005deae8d2b7)) +* update dependency kubernetes-sigs/kustomize to v5.1.1 ([#1853](https://github.com/keptn/lifecycle-toolkit/issues/1853)) ([354ab3f](https://github.com/keptn/lifecycle-toolkit/commit/354ab3f980c2569e17a0354ece417df40317d120)) +* update ghcr.io/keptn/certificate-operator docker tag to v1.1.0 ([#1964](https://github.com/keptn/lifecycle-toolkit/issues/1964)) ([cdc07ae](https://github.com/keptn/lifecycle-toolkit/commit/cdc07ae2ef2e3164d5da74dd777a975e03ff8ee2)) +* update ghcr.io/keptn/deno-runtime docker tag to v1 ([#1988](https://github.com/keptn/lifecycle-toolkit/issues/1988)) ([c6958fd](https://github.com/keptn/lifecycle-toolkit/commit/c6958fd15b84813167d231b745d53748d812e69c)) +* update ghcr.io/keptn/python-runtime docker tag to v1 ([#1985](https://github.com/keptn/lifecycle-toolkit/issues/1985)) ([121de2e](https://github.com/keptn/lifecycle-toolkit/commit/121de2eb8881064f390b5abaef7e6c5f5031c5ec)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to 0b618c4 ([#1654](https://github.com/keptn/lifecycle-toolkit/issues/1654)) ([c749313](https://github.com/keptn/lifecycle-toolkit/commit/c749313bfad7bd98b8d0ae7cc6dd2ea56f23e041)) +* update github.com/keptn/lifecycle-toolkit/klt-cert-manager digest to cba2de5 ([#1762](https://github.com/keptn/lifecycle-toolkit/issues/1762)) ([b77bcea](https://github.com/keptn/lifecycle-toolkit/commit/b77bceae39d6e4372b879afa326e7658d4ccdd89)) +* update helm/kind-action action to v1.8.0 ([#1714](https://github.com/keptn/lifecycle-toolkit/issues/1714)) ([af76757](https://github.com/keptn/lifecycle-toolkit/commit/af7675775ae679ca077cf6281210cf7ec88a768f)) +* update keptn components to v0.8.2 ([#2048](https://github.com/keptn/lifecycle-toolkit/issues/2048)) ([49a884b](https://github.com/keptn/lifecycle-toolkit/commit/49a884b70bbe19ea1523d553195db879a71acc4b)) +* update keptn/docs-tooling action to v0.1.4 ([#1781](https://github.com/keptn/lifecycle-toolkit/issues/1781)) ([bba98c2](https://github.com/keptn/lifecycle-toolkit/commit/bba98c2f2c0eb49fdf15d53b825e78cb319f96b5)) +* update kubernetes packages (patch) ([#1786](https://github.com/keptn/lifecycle-toolkit/issues/1786)) ([cba2de5](https://github.com/keptn/lifecycle-toolkit/commit/cba2de5a5cd04c094131552aaf92c2b85ac23d21)) +* update module github.com/imdario/mergo to v1 ([#1664](https://github.com/keptn/lifecycle-toolkit/issues/1664)) ([3c009d0](https://github.com/keptn/lifecycle-toolkit/commit/3c009d07c379e30489072744c2ceef10edd30923)) +* update module github.com/onsi/gomega to v1.27.9 ([#1787](https://github.com/keptn/lifecycle-toolkit/issues/1787)) ([90b6ce9](https://github.com/keptn/lifecycle-toolkit/commit/90b6ce92253f52a43f3c13dddaa918ca73b515d0)) +* update module golang.org/x/net to v0.12.0 ([#1662](https://github.com/keptn/lifecycle-toolkit/issues/1662)) ([49318bf](https://github.com/keptn/lifecycle-toolkit/commit/49318bfc40497a120304de9d831dfe033259220f)) +* update module google.golang.org/grpc to v1.56.2 ([#1663](https://github.com/keptn/lifecycle-toolkit/issues/1663)) ([0b618c4](https://github.com/keptn/lifecycle-toolkit/commit/0b618c4bf15209fbb81ec7c05f1d05543bdfd1cf)) +* update otel/opentelemetry-collector docker tag to v0.81.0 ([#1188](https://github.com/keptn/lifecycle-toolkit/issues/1188)) ([cbfdc84](https://github.com/keptn/lifecycle-toolkit/commit/cbfdc8499cce26b4d66e1d2179302e1ebfc14141)) +* update otel/opentelemetry-collector docker tag to v0.84.0 ([#1916](https://github.com/keptn/lifecycle-toolkit/issues/1916)) ([7e4bab4](https://github.com/keptn/lifecycle-toolkit/commit/7e4bab4a89ae9fc984083840bd719f12ecd995e0)) +* update sigstore/cosign-installer action to v3.1.2 ([#2009](https://github.com/keptn/lifecycle-toolkit/issues/2009)) ([044d3b5](https://github.com/keptn/lifecycle-toolkit/commit/044d3b52338f027c2095d3949e4f21a2848016bf)) + ## [0.8.1](https://github.com/keptn/lifecycle-toolkit/compare/klt-v0.8.0...klt-v0.8.1) (2023-07-07) diff --git a/Makefile b/Makefile index 40157016503..b787f1ea289 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # renovate: datasource=github-tags depName=kubernetes-sigs/kustomize KUSTOMIZE_VERSION?=v5.1.1 -CHART_APPVERSION ?= v0.8.1 # x-release-please-version +CHART_APPVERSION ?= v0.8.2 # x-release-please-version # renovate: datasource=docker depName=cytopia/yamllint YAMLLINT_VERSION ?= alpine diff --git a/helm/chart/Chart.yaml b/helm/chart/Chart.yaml index ec3659c1f54..b819e9081f3 100644 --- a/helm/chart/Chart.yaml +++ b/helm/chart/Chart.yaml @@ -41,10 +41,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.5 +version: 0.2.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.8.1" # x-release-please-version +appVersion: "v0.8.2" # x-release-please-version From 678c4c9efaa53eb2bb64ef31c98a08d92eccd810 Mon Sep 17 00:00:00 2001 From: Rakshit Gondwal <98955085+rakshitgondwal@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:03:15 +0530 Subject: [PATCH 71/78] feat: aggregation functions support for metrics controller (#1802) Signed-off-by: Rakshit Gondwal Signed-off-by: Rakshit Gondwal <98955085+rakshitgondwal@users.noreply.github.com> --- .../common/aggregation/aggregation.go | 75 +++++++ .../common/providers/fake/provider_mock.go | 57 ++++- .../controllers/common/providers/provider.go | 1 + .../controllers/metrics/controller.go | 74 ++++++- .../controllers/metrics/controller_test.go | 198 +++++++++++++++++- 5 files changed, 400 insertions(+), 5 deletions(-) create mode 100644 metrics-operator/controllers/common/aggregation/aggregation.go diff --git a/metrics-operator/controllers/common/aggregation/aggregation.go b/metrics-operator/controllers/common/aggregation/aggregation.go new file mode 100644 index 00000000000..1923d27b5f1 --- /dev/null +++ b/metrics-operator/controllers/common/aggregation/aggregation.go @@ -0,0 +1,75 @@ +package aggregation + +import ( + "math" + "sort" +) + +func CalculateMax(values []float64) float64 { + if len(values) == 0 { + return 0.0 + } + + max := values[0] + for _, value := range values { + if value > max { + max = value + } + } + return max +} + +func CalculateMin(values []float64) float64 { + if len(values) == 0 { + return 0.0 + } + + min := values[0] + for _, value := range values { + if value < min { + min = value + } + } + return min +} + +func CalculateMedian(values []float64) float64 { + if len(values) == 0 { + return 0.0 + } + + // Sort the values + sortedValues := make([]float64, len(values)) + copy(sortedValues, values) + sort.Float64s(sortedValues) + + // Calculate the median + middle := len(sortedValues) / 2 + if len(sortedValues)%2 == 0 { + return (sortedValues[middle-1] + sortedValues[middle]) / 2 + } + return sortedValues[middle] +} + +func CalculateAverage(values []float64) float64 { + sum := 0.0 + + for _, value := range values { + sum += value + } + if len(values) > 0 { + return sum / float64(len(values)) + } + + return 0.0 +} + +func CalculatePercentile(values sort.Float64Slice, perc float64) float64 { + if len(values) == 0 { + return 0.0 + } + // Calculate the index for the requested percentile + i := math.Ceil(float64(len(values)) * perc / 100) + + return values[int(i-1)] +} diff --git a/metrics-operator/controllers/common/providers/fake/provider_mock.go b/metrics-operator/controllers/common/providers/fake/provider_mock.go index 2ee3f8d229f..2c0ee811aca 100644 --- a/metrics-operator/controllers/common/providers/fake/provider_mock.go +++ b/metrics-operator/controllers/common/providers/fake/provider_mock.go @@ -31,6 +31,9 @@ type KeptnSLIProviderMock struct { // EvaluateQueryFunc mocks the EvaluateQuery method. EvaluateQueryFunc func(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) (string, []byte, error) + // EvaluateQueryForStep mocks the EvaluateQueryForStep method. + EvaluateQueryForStepFunc func (ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) ([]string, []byte, error) + // FetchAnalysisValueFunc mocks the FetchAnalysisValue method. FetchAnalysisValueFunc func(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) @@ -45,6 +48,15 @@ type KeptnSLIProviderMock struct { // Provider is the provider argument value. Provider metricsapi.KeptnMetricsProvider } + // EvaluateQuery holds details about calls to the EvaluateQuery method. + EvaluateQueryForStep []struct { + // Ctx is the ctx argument value. + Ctx context.Context + // Metric is the metric argument value. + Metric metricsapi.KeptnMetric + // Provider is the provider argument value. + Provider metricsapi.KeptnMetricsProvider + } // FetchAnalysisValue holds details about calls to the FetchAnalysisValue method. FetchAnalysisValue []struct { // Ctx is the ctx argument value. @@ -57,8 +69,9 @@ type KeptnSLIProviderMock struct { Provider *metricsapi.KeptnMetricsProvider } } - lockEvaluateQuery sync.RWMutex - lockFetchAnalysisValue sync.RWMutex + lockEvaluateQuery sync.RWMutex + lockEvaluateQueryForStep sync.RWMutex + lockFetchAnalysisValue sync.RWMutex } // EvaluateQuery calls EvaluateQueryFunc. @@ -101,6 +114,46 @@ func (mock *KeptnSLIProviderMock) EvaluateQueryCalls() []struct { return calls } +// EvaluateQueryForStep calls EvaluateQueryForStepFunc. +func (mock *KeptnSLIProviderMock) EvaluateQueryForStep(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) ([]string, []byte, error) { + if mock.EvaluateQueryFunc == nil { + panic("KeptnSLIProviderMock.EvaluateQueryForStepFunc: method is nil but KeptnSLIProvider.EvaluateQueryForStep was just called") + } + callInfo := struct { + Ctx context.Context + Metric metricsapi.KeptnMetric + Provider metricsapi.KeptnMetricsProvider + }{ + Ctx: ctx, + Metric: metric, + Provider: provider, + } + mock.lockEvaluateQueryForStep.Lock() + mock.calls.EvaluateQueryForStep = append(mock.calls.EvaluateQueryForStep, callInfo) + mock.lockEvaluateQueryForStep.Unlock() + return mock.EvaluateQueryForStepFunc(ctx, metric, provider) +} + +// EvaluateQueryForStepCalls gets all the calls that were made to EvaluateQueryForStep. +// Check the length with: +// +// len(mockedKeptnSLIProvider.EvaluateQueryForStepCalls()) +func (mock *KeptnSLIProviderMock) EvaluateQueryForStepCalls() []struct { + Ctx context.Context + Metric metricsapi.KeptnMetric + Provider metricsapi.KeptnMetricsProvider +} { + var calls []struct { + Ctx context.Context + Metric metricsapi.KeptnMetric + Provider metricsapi.KeptnMetricsProvider + } + mock.lockEvaluateQueryForStep.RLock() + calls = mock.calls.EvaluateQueryForStep + mock.lockEvaluateQueryForStep.RUnlock() + return calls +} + // FetchAnalysisValue calls FetchAnalysisValueFunc. func (mock *KeptnSLIProviderMock) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) { if mock.FetchAnalysisValueFunc == nil { diff --git a/metrics-operator/controllers/common/providers/provider.go b/metrics-operator/controllers/common/providers/provider.go index fa1597f5380..b2e6d549c43 100644 --- a/metrics-operator/controllers/common/providers/provider.go +++ b/metrics-operator/controllers/common/providers/provider.go @@ -19,6 +19,7 @@ import ( //go:generate moq -pkg fake -skip-ensure -out ./fake/provider_mock.go . KeptnSLIProvider type KeptnSLIProvider interface { EvaluateQuery(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) (string, []byte, error) + EvaluateQueryForStep(ctx context.Context, metric metricsapi.KeptnMetric, provider metricsapi.KeptnMetricsProvider) ([]string, []byte, error) FetchAnalysisValue(ctx context.Context, query string, spec metricsapi.AnalysisSpec, provider *metricsapi.KeptnMetricsProvider) (string, error) } diff --git a/metrics-operator/controllers/metrics/controller.go b/metrics-operator/controllers/metrics/controller.go index 2d38a4c5801..c55ba2edfbc 100644 --- a/metrics-operator/controllers/metrics/controller.go +++ b/metrics-operator/controllers/metrics/controller.go @@ -18,10 +18,14 @@ package metrics import ( "context" + "fmt" + "sort" + "strconv" "time" "github.com/go-logr/logr" metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha3" + "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/aggregation" "github.com/keptn/lifecycle-toolkit/metrics-operator/controllers/common/providers" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -94,9 +98,9 @@ func (r *KeptnMetricReconciler) Reconcile(ctx context.Context, req ctrl.Request) r.Log.Error(err2, "Failed to get the correct Metric Provider") return ctrl.Result{Requeue: false}, err2 } - reconcile := ctrl.Result{Requeue: true, RequeueAfter: 10 * time.Second} - value, rawValue, err := provider.EvaluateQuery(ctx, *metric, *metricProvider) + + value, rawValue, err := r.getResults(ctx, metric, provider, metricProvider) if err != nil { r.Log.Error(err, "Failed to evaluate the query", "Response from provider was:", (string)(rawValue)) metric.Status.ErrMsg = err.Error() @@ -118,6 +122,33 @@ func (r *KeptnMetricReconciler) Reconcile(ctx context.Context, req ctrl.Request) return reconcile, err } +func (r *KeptnMetricReconciler) getResults(ctx context.Context, metric *metricsapi.KeptnMetric, provider providers.KeptnSLIProvider, metricProvider *metricsapi.KeptnMetricsProvider) (string, []byte, error) { + if metric.Spec.Range != nil && metric.Spec.Range.Step != "" { + return r.getStepQueryResults(ctx, metric, provider, metricProvider) + } + return r.getQueryResults(ctx, metric, provider, metricProvider) +} +func (r *KeptnMetricReconciler) getQueryResults(ctx context.Context, metric *metricsapi.KeptnMetric, provider providers.KeptnSLIProvider, metricProvider *metricsapi.KeptnMetricsProvider) (string, []byte, error) { + value, rawValue, err := provider.EvaluateQuery(ctx, *metric, *metricProvider) + if err != nil { + r.Log.Error(err, "Failed to evaluate the query", "Response from provider was:", (string)(rawValue)) + return "", cupSize(rawValue), err + } + return value, cupSize(rawValue), nil +} +func (r *KeptnMetricReconciler) getStepQueryResults(ctx context.Context, metric *metricsapi.KeptnMetric, provider providers.KeptnSLIProvider, metricProvider *metricsapi.KeptnMetricsProvider) (string, []byte, error) { + value, rawValue, err := provider.EvaluateQueryForStep(ctx, *metric, *metricProvider) + if err != nil { + r.Log.Error(err, "Failed to evaluate the query", "Response from provider was:", (string)(rawValue)) + return "", cupSize(rawValue), err + } + aggValue, err := aggregateValues(value, metric.Spec.Range.Aggregation) + if err != nil { + return "", nil, err + } + return aggValue, cupSize(rawValue), nil +} + func cupSize(value []byte) []byte { if len(value) == 0 { return []byte{} @@ -142,3 +173,42 @@ func (r *KeptnMetricReconciler) fetchProvider(ctx context.Context, namespacedMet } return provider, nil } + +func aggregateValues(stringSlice []string, aggFunc string) (string, error) { + floatSlice, err := stringSliceToFloatSlice(stringSlice) + if err != nil { + return "", err + } + var aggValue float64 + switch aggFunc { + case "max": + aggValue = aggregation.CalculateMax(floatSlice) + case "min": + aggValue = aggregation.CalculateMin(floatSlice) + case "median": + aggValue = aggregation.CalculateMedian(floatSlice) + case "avg": + aggValue = aggregation.CalculateAverage(floatSlice) + case "p90": + aggValue = aggregation.CalculatePercentile(sort.Float64Slice(floatSlice), 90) + case "p95": + aggValue = aggregation.CalculatePercentile(sort.Float64Slice(floatSlice), 95) + case "p99": + aggValue = aggregation.CalculatePercentile(sort.Float64Slice(floatSlice), 99) + } + return fmt.Sprintf("%v", aggValue), nil +} + +func stringSliceToFloatSlice(strSlice []string) ([]float64, error) { + floatSlice := make([]float64, len(strSlice)) + + for i, str := range strSlice { + floatValue, err := strconv.ParseFloat(str, 64) + if err != nil { + return nil, err + } + floatSlice[i] = floatValue + } + + return floatSlice, nil +} diff --git a/metrics-operator/controllers/metrics/controller_test.go b/metrics-operator/controllers/metrics/controller_test.go index 9a13ba1cd58..0c339485fd2 100644 --- a/metrics-operator/controllers/metrics/controller_test.go +++ b/metrics-operator/controllers/metrics/controller_test.go @@ -145,6 +145,52 @@ func TestKeptnMetricReconciler_Reconcile(t *testing.T) { }, } + metric6 := &metricsapi.KeptnMetric{ + ObjectMeta: metav1.ObjectMeta{ + Name: "mymetric6", + Namespace: "default", + }, + Spec: metricsapi.KeptnMetricSpec{ + Provider: metricsapi.ProviderRef{ + Name: "prometheus", + }, + Query: "", + FetchIntervalSeconds: 10, + Range: &metricsapi.RangeSpec{ + Interval: "5m", + }, + }, + Status: metricsapi.KeptnMetricStatus{ + Value: "12", + RawValue: nil, + LastUpdated: metav1.Time{Time: time.Now().Add(-1 * time.Minute)}, + }, + } + + metric7 := &metricsapi.KeptnMetric{ + ObjectMeta: metav1.ObjectMeta{ + Name: "mymetric7", + Namespace: "default", + }, + Spec: metricsapi.KeptnMetricSpec{ + Provider: metricsapi.ProviderRef{ + Name: "prometheus", + }, + Query: "", + FetchIntervalSeconds: 10, + Range: &metricsapi.RangeSpec{ + Interval: "5m", + Step: "1m", + Aggregation: "max", + }, + }, + Status: metricsapi.KeptnMetricStatus{ + Value: "12", + RawValue: nil, + LastUpdated: metav1.Time{Time: time.Now().Add(-1 * time.Minute)}, + }, + } + unsupportedProvider := &metricsapi.KeptnMetricsProvider{ ObjectMeta: metav1.ObjectMeta{Name: "myprov", Namespace: "default"}, Spec: metricsapi.KeptnMetricsProviderSpec{ @@ -173,7 +219,7 @@ func TestKeptnMetricReconciler_Reconcile(t *testing.T) { }, } - client := fake.NewClient(metric, metric2, metric3, metric4, metric5, unsupportedProvider, supportedProvider, oldSupportedProvider) + client := fake.NewClient(metric, metric2, metric3, metric4, metric5, metric6, metric7, unsupportedProvider, supportedProvider, oldSupportedProvider) r := &KeptnMetricReconciler{ Client: client, @@ -313,3 +359,153 @@ func Test_cupSize(t *testing.T) { require.Equal(t, len(res3), MB) } + +func Test_AggregateValues(t *testing.T) { + tests := []struct { + name string + aggFunc string + stringSlice []string + want string + }{ + { + name: "test-max-for-even-length", + aggFunc: "max", + stringSlice: []string{"1", "2", "3", "4"}, + want: "4", + }, + { + name: "test-max-for-odd-length", + aggFunc: "max", + stringSlice: []string{"1", "2", "3", "4", "5"}, + want: "5", + }, + { + name: "test-min-for-even-length", + aggFunc: "min", + stringSlice: []string{"1", "2", "3", "4"}, + want: "1", + }, + { + name: "test-min-for-odd-length", + aggFunc: "min", + stringSlice: []string{"1", "2", "3", "4", "5"}, + want: "1", + }, + { + name: "test-median-for-even-length", + aggFunc: "median", + stringSlice: []string{"1", "2", "3", "4"}, + want: "2.5", + }, + { + name: "test-median-for-odd-length", + aggFunc: "median", + stringSlice: []string{"1", "2", "3", "4", "5"}, + want: "3", + }, + { + name: "test-avg-for-even-length", + aggFunc: "avg", + stringSlice: []string{"1", "2", "3", "4"}, + want: "2.5", + }, + { + name: "test-avg-for-odd-length", + aggFunc: "avg", + stringSlice: []string{"1", "2", "3", "4", "5"}, + want: "3", + }, + { + name: "test-p90-for-even-length", + aggFunc: "p90", + stringSlice: []string{"1", "2", "3", "4"}, + want: "4", + }, + { + name: "test-p90-for-odd-length", + aggFunc: "p90", + stringSlice: []string{"1", "2", "3", "4", "5"}, + want: "5", + }, + { + name: "test-p95-for-even-length", + aggFunc: "p95", + stringSlice: []string{"1", "2", "3", "4"}, + want: "4", + }, + { + name: "test-p95-for-odd-length", + aggFunc: "p95", + stringSlice: []string{"1", "2", "3", "4", "5"}, + want: "5", + }, + { + name: "test-p99-for-even-length", + aggFunc: "p99", + stringSlice: []string{"1", "2", "3", "4"}, + want: "4", + }, + { + name: "test-p99-for-odd-length", + aggFunc: "p99", + stringSlice: []string{"1", "2", "3", "4", "5"}, + want: "5", + }, + { + name: "test-max-empty-string", + aggFunc: "max", + stringSlice: []string(nil), + want: "0", + }, + { + name: "test-min-empty-string", + aggFunc: "min", + stringSlice: []string(nil), + want: "0", + }, + { + name: "test-median-empty-string", + aggFunc: "median", + stringSlice: []string(nil), + want: "0", + }, + { + name: "test-avg-empty-string", + aggFunc: "avg", + stringSlice: []string(nil), + want: "0", + }, + { + name: "test-p90-empty-string", + aggFunc: "p90", + stringSlice: []string(nil), + want: "0", + }, + { + name: "test-p95-empty-string", + aggFunc: "p95", + stringSlice: []string(nil), + want: "0", + }, + { + name: "test-p99-empty-string", + aggFunc: "p99", + stringSlice: []string(nil), + want: "0", + }, + { + name: "wrong-aggFunc", + aggFunc: "p50", + stringSlice: []string{"1", "2", "3", "4"}, + want: "0", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Log(tt.name) + res, err := aggregateValues(tt.stringSlice, tt.aggFunc) + require.Equal(t, tt.want, res) + require.Nil(t, err) + }) + } +} From 2fba7c94ff0fa6aa14facc7dc22b1a7558a88a18 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 10:37:31 +0200 Subject: [PATCH 72/78] deps: update golang.org/x/exp digest to 9212866 (#2039) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- metrics-operator/go.mod | 4 ++-- metrics-operator/go.sum | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/metrics-operator/go.mod b/metrics-operator/go.mod index 670dc0f1c55..e783134c876 100644 --- a/metrics-operator/go.mod +++ b/metrics-operator/go.mod @@ -14,7 +14,7 @@ require ( github.com/prometheus/client_golang v1.16.0 github.com/prometheus/common v0.44.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 golang.org/x/net v0.14.0 gopkg.in/inf.v0 v0.9.1 k8s.io/api v0.26.8 @@ -99,7 +99,7 @@ require ( golang.org/x/crypto v0.12.0 // indirect golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/sync v0.2.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect golang.org/x/term v0.11.0 // indirect golang.org/x/text v0.12.0 // indirect golang.org/x/time v0.3.0 // indirect diff --git a/metrics-operator/go.sum b/metrics-operator/go.sum index 386e57cd671..faf1f876022 100644 --- a/metrics-operator/go.sum +++ b/metrics-operator/go.sum @@ -442,8 +442,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -546,8 +546,9 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= @@ -620,7 +621,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 h1:Vve/L0v7CXXuxUmaMGIEK/dEeq7uiqb5qBgQrZzIE7E= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 83b34c80a426f89f8014498c6d9d69ee76c840c9 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 7 Sep 2023 01:52:04 -0700 Subject: [PATCH 73/78] docs: fix xref to cert-manager page (#2052) Signed-off-by: Meg McRoberts --- docs/content/en/docs/concepts/architecture/cert-manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/concepts/architecture/cert-manager.md b/docs/content/en/docs/concepts/architecture/cert-manager.md index db7f653bd54..794b3d0d701 100644 --- a/docs/content/en/docs/concepts/architecture/cert-manager.md +++ b/docs/content/en/docs/concepts/architecture/cert-manager.md @@ -11,7 +11,7 @@ hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.htm The Keptn Cert Manager automatically configures TLS certificates to [secure communication with the Kubernetes API](https://kubernetes.io/docs/concepts/security/controlling-access/#transport-security). You can instead -[configure your own certificate manager](https://lifecycle.keptn.sh/docs/install/cert-manager/) +[configure Keptn to use cert-manager.io](../../operate/cert-manager.md) for this purpose. Keptn includes a Mutating Webhook From a6e4d6542dd8989d7c46bc1ce24f15f449c0ca19 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 7 Sep 2023 14:12:55 +0200 Subject: [PATCH 74/78] docs: improve getting started guide (#2058) --- docs/content/en/docs/getting-started/_index.md | 14 +++++--------- release-please-config.json | 3 ++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md index 5ed9477d6be..ac4ade43741 100644 --- a/docs/content/en/docs/getting-started/_index.md +++ b/docs/content/en/docs/getting-started/_index.md @@ -77,10 +77,6 @@ Apply the file and restart Keptn to pick up the new config: ```shell kubectl apply -f collectorconfig.yaml -kubectl rollout restart deployment -n keptn-lifecycle-toolkit-system -l control-plane=lifecycle-operator -kubectl rollout status deployment -n keptn-lifecycle-toolkit-system -l control-plane=lifecycle-operator --watch -kubectl rollout restart deployment -n keptn-lifecycle-toolkit-system -l component=scheduler -kubectl rollout status deployment -n keptn-lifecycle-toolkit-system -l component=scheduler --watch ``` ## Step 2: Create Namespace for Demo Application @@ -331,10 +327,10 @@ Create some Keptn Grafana dashboards that will be available when Grafana is inst ```shell kubectl create ns monitoring -kubectl apply -f https://raw.githubusercontent.com/keptn/lifecycle-toolkit/klt-v0.8.1/examples/support/observability/config/prometheus/grafana-config.yaml -kubectl apply -f https://raw.githubusercontent.com/keptn/lifecycle-toolkit/klt-v0.8.1/examples/support/observability/config/prometheus/grafana-dashboard-keptn-applications.yaml -kubectl apply -f https://raw.githubusercontent.com/keptn/lifecycle-toolkit/klt-v0.8.1/examples/support/observability/config/prometheus/grafana-dashboard-keptn-overview.yaml -kubectl apply -f https://raw.githubusercontent.com/keptn/lifecycle-toolkit/klt-v0.8.1/examples/support/observability/config/prometheus/grafana-dashboard-keptn-workloads.yaml +kubectl apply -f https://raw.githubusercontent.com/keptn/lifecycle-toolkit/klt-v0.8.2/examples/support/observability/config/prometheus/grafana-config.yaml +kubectl apply -f https://raw.githubusercontent.com/keptn/lifecycle-toolkit/klt-v0.8.2/examples/support/observability/config/prometheus/grafana-dashboard-keptn-applications.yaml +kubectl apply -f https://raw.githubusercontent.com/keptn/lifecycle-toolkit/klt-v0.8.2/examples/support/observability/config/prometheus/grafana-dashboard-keptn-overview.yaml +kubectl apply -f https://raw.githubusercontent.com/keptn/lifecycle-toolkit/klt-v0.8.2/examples/support/observability/config/prometheus/grafana-dashboard-keptn-workloads.yaml ``` @@ -412,7 +408,7 @@ prometheus: - job_name: "scrape_klt" scrape_interval: 5s static_configs: - - targets: ['keptn-klt-lifecycle-operator-metrics-service.keptn-lifecycle-toolkit-system.svc.cluster.local:2222'] + - targets: ['lifecycle-operator-metrics-service.keptn-lifecycle-toolkit-system.svc.cluster.local:2222'] ``` ```shell diff --git a/release-please-config.json b/release-please-config.json index 327207c302b..e63546ba915 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -26,7 +26,8 @@ "helm/chart/Chart.yaml", "Makefile", "helm/chart/values.yaml", - "helm/chart/README.md" + "helm/chart/README.md", + "docs/content/en/docs/getting-started/_index.md" ] }, "klt-cert-manager": { From 785de1023aef59bd1fc451ae7a83294da141932f Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 7 Sep 2023 05:19:13 -0700 Subject: [PATCH 75/78] docs: move "Architecture" section to top level (#2057) Signed-off-by: Meg McRoberts --- .../en/docs/{concepts => }/architecture/_index.md | 2 +- .../{concepts => }/architecture/cert-manager.md | 4 ++-- .../architecture/components/_index.md | 0 .../components/lifecycle-operator/_index.md | 0 .../components/metrics-operator/_index.md | 10 +++++----- .../architecture/components/scheduler/_index.md | 0 .../{concepts => }/architecture/deployment-flow.md | 2 +- .../architecture/keptn-apps/_index.md | 14 +++++++------- .../{concepts => }/architecture/working/_index.md | 0 docs/content/en/docs/concepts/_index.md | 6 ------ .../en/docs/implementing/integrate/_index.md | 2 +- docs/content/en/docs/intro/usecase_metrics.md | 2 +- docs/content/en/docs/migrate/strategy/_index.md | 2 +- docs/content/en/docs/operate/cert-manager.md | 2 +- docs/content/en/docs/yaml-crd-ref/app.md | 2 +- docs/content/en/docs/yaml-crd-ref/metric.md | 2 +- .../content/en/docs/yaml-crd-ref/taskdefinition.md | 2 +- 17 files changed, 23 insertions(+), 29 deletions(-) rename docs/content/en/docs/{concepts => }/architecture/_index.md (92%) rename docs/content/en/docs/{concepts => }/architecture/cert-manager.md (94%) rename docs/content/en/docs/{concepts => }/architecture/components/_index.md (100%) rename docs/content/en/docs/{concepts => }/architecture/components/lifecycle-operator/_index.md (100%) rename docs/content/en/docs/{concepts => }/architecture/components/metrics-operator/_index.md (89%) rename docs/content/en/docs/{concepts => }/architecture/components/scheduler/_index.md (100%) rename docs/content/en/docs/{concepts => }/architecture/deployment-flow.md (99%) rename docs/content/en/docs/{concepts => }/architecture/keptn-apps/_index.md (91%) rename docs/content/en/docs/{concepts => }/architecture/working/_index.md (100%) delete mode 100644 docs/content/en/docs/concepts/_index.md diff --git a/docs/content/en/docs/concepts/architecture/_index.md b/docs/content/en/docs/architecture/_index.md similarity index 92% rename from docs/content/en/docs/concepts/architecture/_index.md rename to docs/content/en/docs/architecture/_index.md index 6a3f768dce7..258b0f1f247 100644 --- a/docs/content/en/docs/concepts/architecture/_index.md +++ b/docs/content/en/docs/architecture/_index.md @@ -2,7 +2,7 @@ title: Architecture linktitle: Architecture description: Understand the details of how Keptn works -weight: 80 +weight: 50 cascade: --- diff --git a/docs/content/en/docs/concepts/architecture/cert-manager.md b/docs/content/en/docs/architecture/cert-manager.md similarity index 94% rename from docs/content/en/docs/concepts/architecture/cert-manager.md rename to docs/content/en/docs/architecture/cert-manager.md index 794b3d0d701..8f1045984a3 100644 --- a/docs/content/en/docs/concepts/architecture/cert-manager.md +++ b/docs/content/en/docs/architecture/cert-manager.md @@ -11,7 +11,7 @@ hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.htm The Keptn Cert Manager automatically configures TLS certificates to [secure communication with the Kubernetes API](https://kubernetes.io/docs/concepts/security/controlling-access/#transport-security). You can instead -[configure Keptn to use cert-manager.io](../../operate/cert-manager.md) +[configure Keptn to use cert-manager.io](../operate/cert-manager.md) for this purpose. Keptn includes a Mutating Webhook @@ -38,7 +38,7 @@ It is included to simplify installation for new users and because it is much smaller than most standard certificate managers. However, Keptn is compatible with most certificate managers and can be configured to use another certificate manager if you prefer. -See [Use Keptn with cert-manager.io](../../operate/cert-manager.md) +See [Use Keptn with cert-manager.io](../operate/cert-manager.md) for instructions. ## Invalid certificate errors diff --git a/docs/content/en/docs/concepts/architecture/components/_index.md b/docs/content/en/docs/architecture/components/_index.md similarity index 100% rename from docs/content/en/docs/concepts/architecture/components/_index.md rename to docs/content/en/docs/architecture/components/_index.md diff --git a/docs/content/en/docs/concepts/architecture/components/lifecycle-operator/_index.md b/docs/content/en/docs/architecture/components/lifecycle-operator/_index.md similarity index 100% rename from docs/content/en/docs/concepts/architecture/components/lifecycle-operator/_index.md rename to docs/content/en/docs/architecture/components/lifecycle-operator/_index.md diff --git a/docs/content/en/docs/concepts/architecture/components/metrics-operator/_index.md b/docs/content/en/docs/architecture/components/metrics-operator/_index.md similarity index 89% rename from docs/content/en/docs/concepts/architecture/components/metrics-operator/_index.md rename to docs/content/en/docs/architecture/components/metrics-operator/_index.md index 2346e9454e4..1edb268f11e 100644 --- a/docs/content/en/docs/concepts/architecture/components/metrics-operator/_index.md +++ b/docs/content/en/docs/architecture/components/metrics-operator/_index.md @@ -28,7 +28,7 @@ so they are compatible with the Kubernetes (HPA), which enables the horizontal scaling of workloads based on metrics collected from multiple observability platforms. See -[Using the HorizontalPodAutoscaler](../../../../implementing/evaluatemetrics.md/#using-the-horizontalpodautoscaler) +[Using the HorizontalPodAutoscaler](../../../implementing/evaluatemetrics.md/#using-the-horizontalpodautoscaler) for instructions. The Metrics Operator consists of the following components: @@ -55,18 +55,18 @@ which can be used to gain insight into the behavior and performance of applications running on a Kubernetes cluster. The **Metrics controller** fetches metrics from an SLI provider. -The controller reconciles a [`KeptnMetric`](../../../../yaml-crd-ref/metric.md) +The controller reconciles a [`KeptnMetric`](../../../yaml-crd-ref/metric.md) resource and updates its status with the metric value provided by the selected metric provider. Each `KeptnMetric` is identified by `name` and is associated with an instance of an observability platform that is defined in a -[KeptnMetricsProvider](../../../../yaml-crd-ref/metricsprovider.md) +[KeptnMetricsProvider](../../../yaml-crd-ref/metricsprovider.md) resource. The steps in which the controller fetches metrics are given below: -1. When a [`KeptnMetric`](../../../../yaml-crd-ref/metric.md) +1. When a [`KeptnMetric`](../../../yaml-crd-ref/metric.md) resource is found or modified, the controller checks whether the metric has been updated within the interval that is defined in the `spec.fetchintervalseconds` field. @@ -86,7 +86,7 @@ The steps in which the controller fetches metrics are given below: in the `status` field of the `KeptnMetric` object. * If the evaluation fails, the error and reason is written to the - [KeptnMetricStatus](../../../../crd-ref/metrics/v1alpha3/#keptnmetricstatus) + [KeptnMetricStatus](../../../crd-ref/metrics/v1alpha3/#keptnmetricstatus) resource. The error is described in both human-readable language and as raw data to help identify the source of the problem diff --git a/docs/content/en/docs/concepts/architecture/components/scheduler/_index.md b/docs/content/en/docs/architecture/components/scheduler/_index.md similarity index 100% rename from docs/content/en/docs/concepts/architecture/components/scheduler/_index.md rename to docs/content/en/docs/architecture/components/scheduler/_index.md diff --git a/docs/content/en/docs/concepts/architecture/deployment-flow.md b/docs/content/en/docs/architecture/deployment-flow.md similarity index 99% rename from docs/content/en/docs/concepts/architecture/deployment-flow.md rename to docs/content/en/docs/architecture/deployment-flow.md index 841df8331a7..9a9c88d14ee 100644 --- a/docs/content/en/docs/concepts/architecture/deployment-flow.md +++ b/docs/content/en/docs/architecture/deployment-flow.md @@ -22,7 +22,7 @@ Within each phase, all tasks and evaluations for each phase are executed in parallel. They are not affected by the order in which evaluations and tasks are listed in the -[KeptnApp](../../yaml-crd-ref/app.md/) +[KeptnApp](../yaml-crd-ref/app.md/) resource or in the order of the pre/post-tasks and pre/post-evaluations that are listed in the Workflow manifests. diff --git a/docs/content/en/docs/concepts/architecture/keptn-apps/_index.md b/docs/content/en/docs/architecture/keptn-apps/_index.md similarity index 91% rename from docs/content/en/docs/concepts/architecture/keptn-apps/_index.md rename to docs/content/en/docs/architecture/keptn-apps/_index.md index 1c15e3045f6..2d13d72a7f9 100644 --- a/docs/content/en/docs/concepts/architecture/keptn-apps/_index.md +++ b/docs/content/en/docs/architecture/keptn-apps/_index.md @@ -9,7 +9,7 @@ cascade: ## Keptn Workloads A -[KeptnWorkload](../../../crd-ref/lifecycle/v1alpha3/#keptnworkload) +[KeptnWorkload](../../crd-ref/lifecycle/v1alpha3/#keptnworkload) resource augments a Kubernetes [Workload](https://kubernetes.io/docs/concepts/workloads/) with the ability to handle extra phases. @@ -32,7 +32,7 @@ as soon as the workload manifest is applied. ## Keptn Applications -A [KeptnApp](../../../yaml-crd-ref/app.md) +A [KeptnApp](../../yaml-crd-ref/app.md) resource combines multiple Kubernetes [workloads](https://kubernetes.io/docs/concepts/workloads/) into a single entity @@ -65,12 +65,12 @@ plus specific tasks and evaluations that you define for the `KeptnApp` resource itself: * The annotations described in - [Basic annotations](../../../implementing/integrate/#basic-annotations) + [Basic annotations](../../implementing/integrate/#basic-annotations) are used to automatically generate `KeptnApp` resources that contain the identifications required to run the Keptn observability features. * You must manually add the annotations described in - [Pre- and post-deployment checks](../../../implementing/integrate/#pre--and-post-deployment-checks) + [Pre- and post-deployment checks](../../implementing/integrate/#pre--and-post-deployment-checks) to the basic `KeptnApp` manifest to define the evaluations and tasks you want to run pre- and post-deployment. @@ -87,12 +87,12 @@ The timeout is provided because it may take some time to apply all `KeptnWorkload` resources to the cluster. This interval can be modified for the cluster by changing the value of the `keptnAppCreationRequestTimeoutSeconds` field in the -[KeptnConfig](../../../yaml-crd-ref/config.md) +[KeptnConfig](../../yaml-crd-ref/config.md) resource. ## How basic annotations are implemented -The [Basic annotations](../../../implementing/integrate/#basic-annotations) +The [Basic annotations](../../implementing/integrate/#basic-annotations) page gives instructions for applying the annotations or labels that identify the pods that Keptn should manage. @@ -109,7 +109,7 @@ In other words: again first in the annotations, then in the labels. Keptn automatically generates appropriate -[KeptnApp](../../../yaml-crd-ref/app.md) +[KeptnApp](../../yaml-crd-ref/app.md) resources that are used for observability, based on whether the `keptn.sh/app` or `app.kubernetes.io/part-of` annotation/label is populated: diff --git a/docs/content/en/docs/concepts/architecture/working/_index.md b/docs/content/en/docs/architecture/working/_index.md similarity index 100% rename from docs/content/en/docs/concepts/architecture/working/_index.md rename to docs/content/en/docs/architecture/working/_index.md diff --git a/docs/content/en/docs/concepts/_index.md b/docs/content/en/docs/concepts/_index.md deleted file mode 100644 index d2ec6ce6659..00000000000 --- a/docs/content/en/docs/concepts/_index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Concepts -description: Learn about underlying concepts of the keptn lifecycle toolkit. -weight: 50 -hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html ---- diff --git a/docs/content/en/docs/implementing/integrate/_index.md b/docs/content/en/docs/implementing/integrate/_index.md index 9068cb3bd2e..ccd2efda314 100644 --- a/docs/content/en/docs/implementing/integrate/_index.md +++ b/docs/content/en/docs/implementing/integrate/_index.md @@ -124,7 +124,7 @@ annotation/label is populated: but not the combined workloads that constitute your deployed application. See -[Keptn Applications and Keptn Workloads](../../concepts/architecture/keptn-apps/) +[Keptn Applications and Keptn Workloads](../../architecture/keptn-apps/) for architectural information about how `KeptnApp` and `KeptnWorkloads` are implemented. diff --git a/docs/content/en/docs/intro/usecase_metrics.md b/docs/content/en/docs/intro/usecase_metrics.md index 2bed2f146f1..6c8a8815ae1 100644 --- a/docs/content/en/docs/intro/usecase_metrics.md +++ b/docs/content/en/docs/intro/usecase_metrics.md @@ -286,6 +286,6 @@ for detailed information. To learn more about the Keptn Metrics Server, see: - Architecture: - [Keptn Metrics Operator](../concepts/architecture/components/metrics-operator/_index.md) + [Keptn Metrics Operator](../architecture/components/metrics-operator/_index.md) - More information about implementing Keptn Metrics: [Keptn Metrics](../implementing/evaluatemetrics.md) diff --git a/docs/content/en/docs/migrate/strategy/_index.md b/docs/content/en/docs/migrate/strategy/_index.md index 6b00374de8f..5b6d84fc906 100644 --- a/docs/content/en/docs/migrate/strategy/_index.md +++ b/docs/content/en/docs/migrate/strategy/_index.md @@ -93,7 +93,7 @@ Some key points: For in-depth information about Keptn components and how they work, see the -[Architecture](../../concepts/architecture) +[Architecture](../../architecture) section. ## Disposition of Keptn v1 components in Keptn diff --git a/docs/content/en/docs/operate/cert-manager.md b/docs/content/en/docs/operate/cert-manager.md index 9d455e87992..9f1470ce95e 100644 --- a/docs/content/en/docs/operate/cert-manager.md +++ b/docs/content/en/docs/operate/cert-manager.md @@ -12,7 +12,7 @@ Bundling the cert-manager simplifies the installation for new users and provides the functionality Keptn needs without the overhead of other cert-managers. For a description of the architecture, see -[Keptn Certificate Manager](../concepts/architecture/cert-manager.md). +[Keptn Certificate Manager](../architecture/cert-manager.md). Keptn also works well with `cert-manager.io`. If you are already using `cert-manager.io`, diff --git a/docs/content/en/docs/yaml-crd-ref/app.md b/docs/content/en/docs/yaml-crd-ref/app.md index baab7680971..341537d8e34 100644 --- a/docs/content/en/docs/yaml-crd-ref/app.md +++ b/docs/content/en/docs/yaml-crd-ref/app.md @@ -171,7 +171,7 @@ spec: - [KeptnTaskDefinition](taskdefinition.md) - [KeptnEvaluationDefinition](evaluationdefinition.md) - [Working with tasks](../implementing/tasks) -- [Architecture of KeptnWorkloads and KeptnTasks](../concepts/architecture/keptn-apps/) +- [Architecture of KeptnWorkloads and KeptnTasks](../architecture/keptn-apps/) - [Pre- and post-deployment tasks](../implementing/integrate/#pre--and-post-deployment-checks) - [Orchestrate deployment checks](../intro/usecase-orchestrate.md) - [Use Keptn automatic app discovery](../implementing/integrate/#use-keptn-automatic-app-discovery) diff --git a/docs/content/en/docs/yaml-crd-ref/metric.md b/docs/content/en/docs/yaml-crd-ref/metric.md index 77dfb8d12b3..af4e3862caf 100644 --- a/docs/content/en/docs/yaml-crd-ref/metric.md +++ b/docs/content/en/docs/yaml-crd-ref/metric.md @@ -157,4 +157,4 @@ spec: * [KeptnMetricsProvider](metricsprovider.md) * Implementing [Keptn Metrics](../implementing/evaluatemetrics.md) * [Getting started with Keptn metrics](../intro/usecase_metrics.md) -* Architecture of the [Keptn Metrics Operator](../concepts/architecture/components/metrics-operator/_index.md) +* Architecture of the [Keptn Metrics Operator](../architecture/components/metrics-operator/_index.md) diff --git a/docs/content/en/docs/yaml-crd-ref/taskdefinition.md b/docs/content/en/docs/yaml-crd-ref/taskdefinition.md index e1a5b32f558..a1846a6963a 100644 --- a/docs/content/en/docs/yaml-crd-ref/taskdefinition.md +++ b/docs/content/en/docs/yaml-crd-ref/taskdefinition.md @@ -662,5 +662,5 @@ is allowed per `KeptnTaskDefinition`. * [KeptnApp](app.md) * [Working with tasks](../implementing/tasks) * [Pre- and post-deployment tasks](../implementing/integrate/#pre--and-post-deployment-checks) -* [KeptnApp and KeptnWorkload resources](../concepts/architecture/keptn-apps/). +* [KeptnApp and KeptnWorkload resources](../architecture/keptn-apps/). * [Orchestrate deployment checks](../intro/usecase-orchestrate.md) From 2e11b2592214fb2c3299370960c79e134b519470 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:36:43 +0200 Subject: [PATCH 76/78] deps: update module github.com/keptn/docs-tooling to v0.1.5 (#2055) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Moritz Wiesinger --- docs/go.mod | 7 ++----- docs/go.sum | 17 +++++++---------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/docs/go.mod b/docs/go.mod index 76323efa0da..ac21c5f6050 100644 --- a/docs/go.mod +++ b/docs/go.mod @@ -2,11 +2,8 @@ module github.com/keptn/keptn-lifecycle-toolkit/docs go 1.20 -require ( - github.com/keptn/docs-tooling v0.1.4 -) - require ( github.com/google/docsy/dependencies v0.6.0 // indirect - github.com/keptn/community v0.0.0-20230615192024-1cadfa6b2ad0 // indirect + github.com/keptn/community v0.0.0-20230906052955-7eb1261c06ac // indirect + github.com/keptn/docs-tooling v0.1.5 // indirect ) diff --git a/docs/go.sum b/docs/go.sum index ff82ffc80b1..48ab9d44970 100644 --- a/docs/go.sum +++ b/docs/go.sum @@ -1,16 +1,13 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20220831210243-d3a7818c253f/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/google/docsy v0.6.0 h1:43bVF18t2JihAamelQjjGzx1vO2ljCilVrBgetCA8oI= github.com/google/docsy/dependencies v0.6.0 h1:BFXDCINbp8ZuUGl/mrHjMfhCg+b1YX+hVLAA5fGW7Pc= github.com/google/docsy/dependencies v0.6.0/go.mod h1:EDGc2znMbGUw0RW5kWwy2oGgLt0iVXBmoq4UOqstuNE= -github.com/google/docsy/dependencies v0.7.0 h1:/xUlWCZOSMDubHfrhIz1YtaRn2Oc/swfJ7OUfglXE8U= -github.com/google/docsy/dependencies v0.7.0/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4= -github.com/keptn/community v0.0.0-20230615192024-1cadfa6b2ad0 h1:gT4CJA5fM9HlF8AGghB7YlS7Yj8wsrBPfpuW22Rc+WU= -github.com/keptn/community v0.0.0-20230615192024-1cadfa6b2ad0/go.mod h1:0G5nUhSv7ch9BgIFXiY7+U+cV5SbVmneysNGQwQkH8s= -github.com/keptn/docs-tooling v0.1.1 h1:IuI0Fgs0JrtffLN05iaRZVkRMbPu6h9bxR4C8q1ApGU= -github.com/keptn/docs-tooling v0.1.1/go.mod h1:x0iT5YsJosz6wzjQke/YaLgiXF6PV+N8QzxSAc2MY/4= -github.com/keptn/docs-tooling v0.1.2 h1:qKu4U6ugnF7+uQ4buDqYuCehFsGF4bunJYsQWv8MenI= -github.com/keptn/docs-tooling v0.1.2/go.mod h1:x0iT5YsJosz6wzjQke/YaLgiXF6PV+N8QzxSAc2MY/4= -github.com/keptn/docs-tooling v0.1.4 h1:nanQzfAjnLOpFBG4JXyGbcCdN83tDAOrZJFVWGpBE1o= -github.com/keptn/docs-tooling v0.1.4/go.mod h1:x0iT5YsJosz6wzjQke/YaLgiXF6PV+N8QzxSAc2MY/4= +github.com/google/docsy/dependencies v0.7.1 h1:NbzYKJYMin2q50xdWSUzR2c9gCp7zR/XHDBcxklEcTQ= +github.com/google/docsy/dependencies v0.7.1/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4= +github.com/keptn/community v0.0.0-20230906052955-7eb1261c06ac h1:ewU/L6PZuoR1T292iLpc39Nf9SOXWk839UfbJ6KDmb4= +github.com/keptn/community v0.0.0-20230906052955-7eb1261c06ac/go.mod h1:0G5nUhSv7ch9BgIFXiY7+U+cV5SbVmneysNGQwQkH8s= +github.com/keptn/docs-tooling v0.1.5 h1:D/w9GFxRMqIhTznwOvb6GA+qOw4XkuXEvyrDzOz55lc= +github.com/keptn/docs-tooling v0.1.5/go.mod h1:x0iT5YsJosz6wzjQke/YaLgiXF6PV+N8QzxSAc2MY/4= github.com/twbs/bootstrap v4.6.2+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= From 26139170f87b1bf446ec48ee356b3885842dcf10 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 14:37:01 +0200 Subject: [PATCH 77/78] deps: update keptn/docs-tooling action to v0.1.5 (#2054) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd86cfeb42e..50980e8bb19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -210,7 +210,7 @@ jobs: if: needs.release-please.outputs.klt-release-created == 'true' with: tag_name: ${{ needs.release-please.outputs.klt-tag-name }} - uses: keptn/docs-tooling/.github/workflows/release-docs.yml@v0.1.4 + uses: keptn/docs-tooling/.github/workflows/release-docs.yml@v0.1.5 secrets: inherit update-examples: From 328dfc2aedb1de5eefaf507383b753ce8a1ec612 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Fri, 8 Sep 2023 02:53:53 -0700 Subject: [PATCH 78/78] docs: remove "Migration pages" that are no longer scheduled (#2063) Signed-off-by: Meg McRoberts --- docs/content/en/docs/migrate/_index.md | 30 ++----------------- docs/content/en/docs/migrate/cicd/_index.md | 16 ---------- docs/content/en/docs/migrate/day2/_index.md | 13 -------- .../en/docs/migrate/evaluations/_index.md | 13 -------- docs/content/en/docs/migrate/jes/_index.md | 13 -------- .../en/docs/migrate/metrics-observe/_index.md | 13 ++------ 6 files changed, 5 insertions(+), 93 deletions(-) delete mode 100644 docs/content/en/docs/migrate/cicd/_index.md delete mode 100644 docs/content/en/docs/migrate/day2/_index.md delete mode 100644 docs/content/en/docs/migrate/evaluations/_index.md delete mode 100644 docs/content/en/docs/migrate/jes/_index.md diff --git a/docs/content/en/docs/migrate/_index.md b/docs/content/en/docs/migrate/_index.md index 1a67dfd5c1a..ad44231f699 100644 --- a/docs/content/en/docs/migrate/_index.md +++ b/docs/content/en/docs/migrate/_index.md @@ -6,38 +6,12 @@ hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.htm --- Keptn uses a different paradigm than that used for Keptn v1 -and so migration from Keptn v1 will not be a straight-forward process. +and so migration from Keptn v1 is not a straight-forward process. In this section, we will assemble information to help people -who want to move from Keptn v1 as it becomes available. - -> **Note** -This section is under development. -Information that is published here has been reviewed for technical accuracy -but the format and content is still evolving. -We hope you will contribute your experiences -and questions that you have. +who want to move from Keptn v1. These instructions mostly assume that you want to utilize all Keptn features. Note, however, that you can install and use some functionality such as Keptn Metrics and Observability without implementing all Keptn features. - -This section currently includes the following topics: - -* [Migration strategy](strategy) -- - Overview of the recommended migration strategy - -* [Set up metrics and observability](metrics-observe) -- - When you identify the data-sources being used - and provide Keptn with information about your OpenTelemetry collector, - Keptn begins to accumulate information that you can view - for your deployment. - -* [Migrate Quality Gates to Keptn Evaluations](evaluations) - -* [Migrate CI/CD functionality](cicd) - -* [Migrate JES services to Keptn Tasks](jes) - -* [Migrate remediation services to Day 2 monitoring](day2) diff --git a/docs/content/en/docs/migrate/cicd/_index.md b/docs/content/en/docs/migrate/cicd/_index.md deleted file mode 100644 index 8302b61e028..00000000000 --- a/docs/content/en/docs/migrate/cicd/_index.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Migrate CI/CD functionality to Keptn -description: Translate Keptn v1 CI/CD funtionality to Keptn resources -weight: 60 -hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html ---- - -> **Note** -This section is under development. -Information that is published here has been reviewed for technical accuracy -but the format and content is still evolving. -We hope you will contribute your experiences -and questions that you have. - -No two migrations are alike but these are some general guidelines -for how to approach the project: diff --git a/docs/content/en/docs/migrate/day2/_index.md b/docs/content/en/docs/migrate/day2/_index.md deleted file mode 100644 index fbbb512e6ef..00000000000 --- a/docs/content/en/docs/migrate/day2/_index.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Implement Day 2 evaluations -description: How to implement some Day 2 evaluations and remediations -weight: 80 -hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html ---- - -> **Note** -This section is under development. -Information that is published here has been reviewed for technical accuracy -but the format and content is still evolving. -We hope you will contribute your experiences -and questions that you have. diff --git a/docs/content/en/docs/migrate/evaluations/_index.md b/docs/content/en/docs/migrate/evaluations/_index.md deleted file mode 100644 index 210f8358d5a..00000000000 --- a/docs/content/en/docs/migrate/evaluations/_index.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Migrate Quality Gates to Keptn Evaluations -description: How to define Keptn Evaluations for some Quality Gates checks -weight: 50 -hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html ---- - -> **Note** -This section is under development. -Information that is published here has been reviewed for technical accuracy -but the format and content is still evolving. -We hope you will contribute your experiences -and questions that you have. diff --git a/docs/content/en/docs/migrate/jes/_index.md b/docs/content/en/docs/migrate/jes/_index.md deleted file mode 100644 index 5523eeec63c..00000000000 --- a/docs/content/en/docs/migrate/jes/_index.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Convert JES services to Keptn tasks -description: How to turn JES services into Keptn tasks -weight: 70 -hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html ---- - -> **Note** -This section is under development. -Information that is published here has been reviewed for technical accuracy -but the format and content is still evolving. -We hope you will contribute your experiences -and questions that you have. diff --git a/docs/content/en/docs/migrate/metrics-observe/_index.md b/docs/content/en/docs/migrate/metrics-observe/_index.md index 4d76e590d6f..bba6d6ff8f1 100644 --- a/docs/content/en/docs/migrate/metrics-observe/_index.md +++ b/docs/content/en/docs/migrate/metrics-observe/_index.md @@ -1,17 +1,10 @@ --- -title: Migrate Quality Gates to Keptn metrics and evaluations +title: Migrate Quality Gates description: How to translate Quality Gates into Keptn Metrics and evaluations weight: 40 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- -> **Note** -This section is under development. -Information that is published here has been reviewed for technical accuracy -but the format and content is still evolving. -We hope you will contribute your experiences -and questions that you have. - The SLIs and SLOs used for Keptn v1 quality gates can be ported to Keptn KeptnMetrics and KeptnEvaluationDefintions. @@ -53,8 +46,8 @@ Notice the paradigm differences when implementing Keptn evaluations: [KeptnEvaluationDefinition](../../yaml-crd-ref/evaluationdefinition.md) resources. * Keptn v1 calculations that use weighting and scoring - cannot currently be converted to `KeptnEvaluationDefinition` resources - but are under development. + cannot currently be implemented for Keptn + but this functionality is under development. For more information about working with Keptn metrics, see the [Keptn Metrics](../../implementing/evaluatemetrics.md)