diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8663d4006c..53f0dde30f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.7.0"} +{".":"0.7.1"} diff --git a/CHANGELOG.md b/CHANGELOG.md index cd2aead2b1..8237b11010 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,166 @@ # Changelog +## [0.7.1](https://github.com/keptn/lifecycle-toolkit/compare/v0.7.0...v0.7.1) (2023-05-03) + + +### Features + +* add support for multiple metrics providers ([#1193](https://github.com/keptn/lifecycle-toolkit/issues/1193)) ([3c465d0](https://github.com/keptn/lifecycle-toolkit/commit/3c465d07044b0317cbb6e462004dff9cf8f1d533)) +* datadog metric provider for KLT ([#948](https://github.com/keptn/lifecycle-toolkit/issues/948)) ([597a23f](https://github.com/keptn/lifecycle-toolkit/commit/597a23f93433ce56aac7000cf1806dd79f67b3f6)) +* improve API reference generation script with path extension ([#1271](https://github.com/keptn/lifecycle-toolkit/issues/1271)) ([74fa4f5](https://github.com/keptn/lifecycle-toolkit/commit/74fa4f56471853e564a91d49132b4f7ce2367f44)) +* make examples resource footprint smaller, fix bugs ([#1171](https://github.com/keptn/lifecycle-toolkit/issues/1171)) ([8b165d3](https://github.com/keptn/lifecycle-toolkit/commit/8b165d3bf63a63b452ac2f1423166978b80facc9)) +* **operator:** add information about evaluation target in status ([#1341](https://github.com/keptn/lifecycle-toolkit/issues/1341)) ([cc03a85](https://github.com/keptn/lifecycle-toolkit/commit/cc03a8513d469200becb371844e15fd4f832371c)) +* **operator:** additional parameters for KeptnTask to support retry logic ([#1084](https://github.com/keptn/lifecycle-toolkit/issues/1084)) ([eed5568](https://github.com/keptn/lifecycle-toolkit/commit/eed5568e51f381f62e2e6db3fddc13a610bcd5e0)) +* **operator:** bootstrapped KeptnAppCreationRequest CRD ([#1134](https://github.com/keptn/lifecycle-toolkit/issues/1134)) ([6b58da3](https://github.com/keptn/lifecycle-toolkit/commit/6b58da3c907af591633052ba3d7fc49a2b801ebc)) +* **operator:** consider corner cases in KACR controller ([#1270](https://github.com/keptn/lifecycle-toolkit/issues/1270)) ([b3b7010](https://github.com/keptn/lifecycle-toolkit/commit/b3b70109a9125ef4ea017a5f3d25d02146438a46)) +* **operator:** create KeptnAppCreationRequest in pod webhook ([#1277](https://github.com/keptn/lifecycle-toolkit/issues/1277)) ([da942c2](https://github.com/keptn/lifecycle-toolkit/commit/da942c2f12fe4a8d5fd89ec0615228d05064b183)) +* **operator:** implement KeptnAppCreationRequest controller ([#1191](https://github.com/keptn/lifecycle-toolkit/issues/1191)) ([79afd83](https://github.com/keptn/lifecycle-toolkit/commit/79afd83476baa567285bddc3fc4bc40a76783e67)) +* **operator:** introduce fallback search to KLT default namespace when KeptnTaskDefinition is not found ([#1340](https://github.com/keptn/lifecycle-toolkit/issues/1340)) ([6794fe2](https://github.com/keptn/lifecycle-toolkit/commit/6794fe2d7e3334deb17dd13e5580bfc358edb57c)) +* **operator:** introduce retry logic for KeptnTasks ([#1088](https://github.com/keptn/lifecycle-toolkit/issues/1088)) ([e49b5a3](https://github.com/keptn/lifecycle-toolkit/commit/e49b5a3f133b5ba5f1ceaad53c12899415ea58b2)) +* **operator:** polish `KeptnConfig` and use Env Var for initial configuration ([#1097](https://github.com/keptn/lifecycle-toolkit/issues/1097)) ([559acee](https://github.com/keptn/lifecycle-toolkit/commit/559acee5059016b96703fb9f6f8d842d3c392c29)) +* **operator:** propagate KeptnTaskDefinition labels and annotations to Job Pods ([#1283](https://github.com/keptn/lifecycle-toolkit/issues/1283)) ([83be9d9](https://github.com/keptn/lifecycle-toolkit/commit/83be9d98381f7a53c0de324cd868fd03635b52ef)) +* **operator:** support Argo Rollout resources ([#879](https://github.com/keptn/lifecycle-toolkit/issues/879)) ([c2b0fa3](https://github.com/keptn/lifecycle-toolkit/commit/c2b0fa35f875d250564f1a75acab6752e65b504d)) +* use smaller distroless images for released containers ([#1092](https://github.com/keptn/lifecycle-toolkit/issues/1092)) ([8a7a6af](https://github.com/keptn/lifecycle-toolkit/commit/8a7a6af9f44c3a3f88b0a2f2331e3e820741d26f)) + + +### Bug Fixes + +* adapt mapping for community files ([#1215](https://github.com/keptn/lifecycle-toolkit/issues/1215)) ([99ef223](https://github.com/keptn/lifecycle-toolkit/commit/99ef2235648e1fa97d9ae30c7df4551dbb7bcf94)) +* add missing control-plane label into lifecycle operator service ([#1148](https://github.com/keptn/lifecycle-toolkit/issues/1148)) ([df04fbe](https://github.com/keptn/lifecycle-toolkit/commit/df04fbe5512d1f9e0c8d8e81a253a8c4892e1dec)) +* fix examples restart make command, reduce prometheus resources ([#1158](https://github.com/keptn/lifecycle-toolkit/issues/1158)) ([06b10a8](https://github.com/keptn/lifecycle-toolkit/commit/06b10a82fd3e8c942ef7592f919acb60552c4ae4)) +* fix examples, update podtatohead ([#1098](https://github.com/keptn/lifecycle-toolkit/issues/1098)) ([f581ed5](https://github.com/keptn/lifecycle-toolkit/commit/f581ed500f55da2be69a10ac67da5d8717ac3104)) +* fix kubecon examples ([#1225](https://github.com/keptn/lifecycle-toolkit/issues/1225)) ([a47fe1d](https://github.com/keptn/lifecycle-toolkit/commit/a47fe1d10d433a121381d0fdd2a9def087f14046)) +* fix kubecon examples ([#1226](https://github.com/keptn/lifecycle-toolkit/issues/1226)) ([5fb61ba](https://github.com/keptn/lifecycle-toolkit/commit/5fb61ba00c57bfa4d062d137e2d89781b9d274ea)) +* fix metrics demo setup ([#1207](https://github.com/keptn/lifecycle-toolkit/issues/1207)) ([b261172](https://github.com/keptn/lifecycle-toolkit/commit/b261172ff2e2921923ca7d6bb6519a55182bacdf)) +* generate missing CRD docs, fix validation pipeline ([#1086](https://github.com/keptn/lifecycle-toolkit/issues/1086)) ([71e9073](https://github.com/keptn/lifecycle-toolkit/commit/71e9073288c55da4ccbc51c1beb01a2d00b0921a)) +* helm generation checker pipeline ([#1209](https://github.com/keptn/lifecycle-toolkit/issues/1209)) ([72396cd](https://github.com/keptn/lifecycle-toolkit/commit/72396cda0e8b02913f060a6e99e782be2fab4e85)) +* **helm-chart:** fix missing values in the KLT helm chart ([#1082](https://github.com/keptn/lifecycle-toolkit/issues/1082)) ([52311c1](https://github.com/keptn/lifecycle-toolkit/commit/52311c1a1ee023ff5d271456c1fe09737ba94d60)) +* **metrics-operator:** normalize Dynatrace URL ([#1145](https://github.com/keptn/lifecycle-toolkit/issues/1145)) ([b33b4f4](https://github.com/keptn/lifecycle-toolkit/commit/b33b4f49320bf75c5098190d0b36ab3c49be9b45)) +* move prometheus install into make file ([#1093](https://github.com/keptn/lifecycle-toolkit/issues/1093)) ([f6f44e4](https://github.com/keptn/lifecycle-toolkit/commit/f6f44e4c5d880f00605e2923292c039503bb7903)) +* **operator:** fix otel collector URL setup ([#1262](https://github.com/keptn/lifecycle-toolkit/issues/1262)) ([c3754b7](https://github.com/keptn/lifecycle-toolkit/commit/c3754b755146e27bedd73a18d5f66d9c01a46677)) +* **operator:** look up latest AppVersion based on creation timestamp ([#1186](https://github.com/keptn/lifecycle-toolkit/issues/1186)) ([45a96e7](https://github.com/keptn/lifecycle-toolkit/commit/45a96e7fdf464d1248c3674787966d2e5ae50828)) +* removed failure branch ([#1175](https://github.com/keptn/lifecycle-toolkit/issues/1175)) ([66df012](https://github.com/keptn/lifecycle-toolkit/commit/66df01257a1abce26e4b3577527a8fbe651358d6)) +* security pipeline ([#1333](https://github.com/keptn/lifecycle-toolkit/issues/1333)) ([79e475c](https://github.com/keptn/lifecycle-toolkit/commit/79e475ce1f8d7f05d88365d8711fb491eae0c374)) +* use correct control-plane label for metrics-operator ([#1147](https://github.com/keptn/lifecycle-toolkit/issues/1147)) ([1035183](https://github.com/keptn/lifecycle-toolkit/commit/10351834d70b000b8296bea65b80fc9e22e54cee)) +* use custom k8s label to inject certificates where needed ([#1288](https://github.com/keptn/lifecycle-toolkit/issues/1288)) ([8fe5df3](https://github.com/keptn/lifecycle-toolkit/commit/8fe5df34e2e4f5ef544a1952040ec1b170148d7a)) +* use hash as revision instead of generation number ([#1243](https://github.com/keptn/lifecycle-toolkit/issues/1243)) ([2ad5d81](https://github.com/keptn/lifecycle-toolkit/commit/2ad5d811921834c7049e76879cbf61c819f1a39d)) + + +### Dependency Updates + +* bump denoland/deno to 1.32.5 ([#1329](https://github.com/keptn/lifecycle-toolkit/issues/1329)) ([73f0af0](https://github.com/keptn/lifecycle-toolkit/commit/73f0af062832dc0d86297fb2305c287450c3bc05)) +* remove github.com/open-feature/flagd ([#1110](https://github.com/keptn/lifecycle-toolkit/issues/1110)) ([e118851](https://github.com/keptn/lifecycle-toolkit/commit/e11885180bcab7dac93409fd5868328c6dade508)) +* update actions/setup-go action to v4 ([#1051](https://github.com/keptn/lifecycle-toolkit/issues/1051)) ([8b470d4](https://github.com/keptn/lifecycle-toolkit/commit/8b470d4c8e7285b481df5ae2e1e4674413caaaab)) +* update amannn/action-semantic-pull-request action to v5.2.0 ([#1102](https://github.com/keptn/lifecycle-toolkit/issues/1102)) ([c57b1fe](https://github.com/keptn/lifecycle-toolkit/commit/c57b1febc0501648c5c2d3c94c4434536ece2871)) +* update anchore/sbom-action action to v0.13.4 ([#1101](https://github.com/keptn/lifecycle-toolkit/issues/1101)) ([4c9a1aa](https://github.com/keptn/lifecycle-toolkit/commit/4c9a1aabe6550d21d80c8696421203896847297e)) +* update anchore/sbom-action action to v0.14.1 ([#1187](https://github.com/keptn/lifecycle-toolkit/issues/1187)) ([21e72a3](https://github.com/keptn/lifecycle-toolkit/commit/21e72a3a38dafda79d2cdb9f129bf48382696821)) +* update aquasecurity/trivy-action action to v0.10.0 ([#1255](https://github.com/keptn/lifecycle-toolkit/issues/1255)) ([1ff448c](https://github.com/keptn/lifecycle-toolkit/commit/1ff448cafb76c385ef358dd36392b99371d0561e)) +* update curlimages/curl docker tag to v8 ([#1116](https://github.com/keptn/lifecycle-toolkit/issues/1116)) ([05bf675](https://github.com/keptn/lifecycle-toolkit/commit/05bf6750563d8956dd29a8964dea1a79136db810)) +* update dawidd6/action-download-artifact action to v2.26.1 ([#1189](https://github.com/keptn/lifecycle-toolkit/issues/1189)) ([1053717](https://github.com/keptn/lifecycle-toolkit/commit/10537174792d1b3514336452bca6dbba3ef49de5)) +* update dawidd6/action-download-artifact action to v2.27.0 ([#1256](https://github.com/keptn/lifecycle-toolkit/issues/1256)) ([dc3e9b2](https://github.com/keptn/lifecycle-toolkit/commit/dc3e9b21e897d10e33a4ef406f357d44675cfacf)) +* update dependency argoproj/argo-cd to v2.6.6 ([#1039](https://github.com/keptn/lifecycle-toolkit/issues/1039)) ([fb0f7a3](https://github.com/keptn/lifecycle-toolkit/commit/fb0f7a39bad1bbeda96210bd198d3e0ca0b6cb86)) +* update dependency argoproj/argo-cd to v2.6.7 ([#1121](https://github.com/keptn/lifecycle-toolkit/issues/1121)) ([97c4b58](https://github.com/keptn/lifecycle-toolkit/commit/97c4b5823398310c11f50ff94d6c4cb4a29526a2)) +* update dependency golangci/golangci-lint to v1.52.0 ([#1103](https://github.com/keptn/lifecycle-toolkit/issues/1103)) ([2b28b4f](https://github.com/keptn/lifecycle-toolkit/commit/2b28b4f58fb14421a704225cf437d08cba6b27b6)) +* update dependency golangci/golangci-lint to v1.52.1 ([#1108](https://github.com/keptn/lifecycle-toolkit/issues/1108)) ([f5fb9ea](https://github.com/keptn/lifecycle-toolkit/commit/f5fb9ead9a53ad9fbd458df8c8b6aa6bfaa720da)) +* update dependency golangci/golangci-lint to v1.52.2 ([#1142](https://github.com/keptn/lifecycle-toolkit/issues/1142)) ([1071f02](https://github.com/keptn/lifecycle-toolkit/commit/1071f0297b59bbd3a755e0a21c8e894bbfde1907)) +* update dependency helm/helm to v3.11.2 ([#1050](https://github.com/keptn/lifecycle-toolkit/issues/1050)) ([2669e1d](https://github.com/keptn/lifecycle-toolkit/commit/2669e1d4760ed89797e312b7160d76d76f2171e8)) +* update dependency helm/helm to v3.11.3 ([#1234](https://github.com/keptn/lifecycle-toolkit/issues/1234)) ([13c8fd8](https://github.com/keptn/lifecycle-toolkit/commit/13c8fd894b4603319591da52ef812214b00c782a)) +* update dependency jaegertracing/jaeger to v1.43.0 ([#794](https://github.com/keptn/lifecycle-toolkit/issues/794)) ([abd4e09](https://github.com/keptn/lifecycle-toolkit/commit/abd4e0977fbc60638e32a19704580a667e0de282)) +* update dependency jaegertracing/jaeger to v1.44.0 ([#1229](https://github.com/keptn/lifecycle-toolkit/issues/1229)) ([1257f0b](https://github.com/keptn/lifecycle-toolkit/commit/1257f0b8d4d83bffeca14139054b50e3a6b20324)) +* update dependency jaegertracing/jaeger-operator to v1.43.0 ([#1152](https://github.com/keptn/lifecycle-toolkit/issues/1152)) ([9890213](https://github.com/keptn/lifecycle-toolkit/commit/9890213a643aac0977f677ac181d1d39e77fa5b5)) +* update dependency kubernetes-sigs/controller-tools to v0.11.4 ([#1280](https://github.com/keptn/lifecycle-toolkit/issues/1280)) ([cfeec33](https://github.com/keptn/lifecycle-toolkit/commit/cfeec33a26207a21d95f21bcafd7e7aa55881b7c)) +* update dependency kubernetes-sigs/kustomize to v5 ([#769](https://github.com/keptn/lifecycle-toolkit/issues/769)) ([33107ac](https://github.com/keptn/lifecycle-toolkit/commit/33107ac07a737053f60b449100c3d86b5cc910b7)) +* update ghcr.io/podtato-head/entry docker tag to v0.2.8 ([#1211](https://github.com/keptn/lifecycle-toolkit/issues/1211)) ([d8f56b1](https://github.com/keptn/lifecycle-toolkit/commit/d8f56b12883a1904f7f6f600710a61d36e4753cd)) +* update ghcr.io/podtato-head/hat docker tag to v0.2.8 ([#1212](https://github.com/keptn/lifecycle-toolkit/issues/1212)) ([ff09fbc](https://github.com/keptn/lifecycle-toolkit/commit/ff09fbc69c65209d26c04bc5418281fad5f438b6)) +* update ghcr.io/podtato-head/left-arm docker tag to v0.2.8 ([#1217](https://github.com/keptn/lifecycle-toolkit/issues/1217)) ([549e76d](https://github.com/keptn/lifecycle-toolkit/commit/549e76d698eeccada0aae74c1c267b8c98f6b727)) +* update ghcr.io/podtato-head/left-leg docker tag to v0.2.8 ([#1218](https://github.com/keptn/lifecycle-toolkit/issues/1218)) ([dd15d4a](https://github.com/keptn/lifecycle-toolkit/commit/dd15d4a0e0e4b4986d8c3d0860662bfa8ad1110e)) +* update ghcr.io/podtato-head/right-arm docker tag to v0.2.8 ([#1219](https://github.com/keptn/lifecycle-toolkit/issues/1219)) ([48f6030](https://github.com/keptn/lifecycle-toolkit/commit/48f603067056d82c9c2fc5369872e5ed6572510d)) +* update ghcr.io/podtato-head/right-leg docker tag to v0.2.8 ([#1220](https://github.com/keptn/lifecycle-toolkit/issues/1220)) ([3a4be7f](https://github.com/keptn/lifecycle-toolkit/commit/3a4be7f3048672994c5b4943844a2aa42f8954b1)) +* update github.com/keptn/lifecycle-toolkit/metrics-operator digest to 6b58da3 ([#1141](https://github.com/keptn/lifecycle-toolkit/issues/1141)) ([3859059](https://github.com/keptn/lifecycle-toolkit/commit/385905913f867c88482e5b1a40643a8957a8e022)) +* update github.com/keptn/lifecycle-toolkit/metrics-operator digest to 720e9e9 ([#1035](https://github.com/keptn/lifecycle-toolkit/issues/1035)) ([8a77f00](https://github.com/keptn/lifecycle-toolkit/commit/8a77f0004bc643a45890a888f3b7942f0c4ef794)) +* update github.com/keptn/lifecycle-toolkit/metrics-operator digest to b32d753 ([#1164](https://github.com/keptn/lifecycle-toolkit/issues/1164)) ([4480444](https://github.com/keptn/lifecycle-toolkit/commit/448044446a315973cbf80fb4d9a24e58bb797eb5)) +* update github.com/keptn/lifecycle-toolkit/metrics-operator digest to dd15d4a ([#1182](https://github.com/keptn/lifecycle-toolkit/issues/1182)) ([87b170f](https://github.com/keptn/lifecycle-toolkit/commit/87b170f4ac7a31812d235e1587d92789b9448da5)) +* update github.com/keptn/lifecycle-toolkit/metrics-operator digest to f5fb9ea ([#1107](https://github.com/keptn/lifecycle-toolkit/issues/1107)) ([65f6a83](https://github.com/keptn/lifecycle-toolkit/commit/65f6a832a60a63226170b342d79ca187bddb6cec)) +* update golang docker tag to v1.20.2 ([#1036](https://github.com/keptn/lifecycle-toolkit/issues/1036)) ([720e9e9](https://github.com/keptn/lifecycle-toolkit/commit/720e9e9b7040a1048d3f6fc86917bd678436c437)) +* update golang docker tag to v1.20.3 ([#1183](https://github.com/keptn/lifecycle-toolkit/issues/1183)) ([f9a1bc7](https://github.com/keptn/lifecycle-toolkit/commit/f9a1bc7f2c4797d61d0afa75844052f945b15acc)) +* update kubernetes packages (patch) ([#1228](https://github.com/keptn/lifecycle-toolkit/issues/1228)) ([ec1ece4](https://github.com/keptn/lifecycle-toolkit/commit/ec1ece41fcb797df3b02f2dd5fd53484b126e10e)) +* update kubernetes packages to v0.26.3 (patch) ([#1072](https://github.com/keptn/lifecycle-toolkit/issues/1072)) ([a6459f8](https://github.com/keptn/lifecycle-toolkit/commit/a6459f8c2cd98fac9897ca40e299790ba35cd569)) +* update module github.com/benbjohnson/clock to v1.3.1 ([#1257](https://github.com/keptn/lifecycle-toolkit/issues/1257)) ([e644597](https://github.com/keptn/lifecycle-toolkit/commit/e644597b17fb10fbae9d25a60b26487d96224841)) +* update module github.com/benbjohnson/clock to v1.3.3 ([#1293](https://github.com/keptn/lifecycle-toolkit/issues/1293)) ([b7b2383](https://github.com/keptn/lifecycle-toolkit/commit/b7b23833faccd963c66a36f3c0b3a1af05d4d05c)) +* update module github.com/datadog/datadog-api-client-go/v2 to v2.11.0 ([#1109](https://github.com/keptn/lifecycle-toolkit/issues/1109)) ([fbc021e](https://github.com/keptn/lifecycle-toolkit/commit/fbc021eadaf2442bfa67bc32947193b7fb6c20ae)) +* update module github.com/datadog/datadog-api-client-go/v2 to v2.12.0 ([#1259](https://github.com/keptn/lifecycle-toolkit/issues/1259)) ([db347de](https://github.com/keptn/lifecycle-toolkit/commit/db347dec20302fae2688df613ca81526c95a0484)) +* update module github.com/go-logr/logr to v1.2.4 ([#1153](https://github.com/keptn/lifecycle-toolkit/issues/1153)) ([c1ecfd0](https://github.com/keptn/lifecycle-toolkit/commit/c1ecfd03e39fc72f8304c78f80e71941aa0162e9)) +* update module github.com/imdario/mergo to v0.3.14 ([#1073](https://github.com/keptn/lifecycle-toolkit/issues/1073)) ([ad408fd](https://github.com/keptn/lifecycle-toolkit/commit/ad408fd3b2dbd8480baad0c730b3f209c0d3b503)) +* update module github.com/imdario/mergo to v0.3.15 ([#1132](https://github.com/keptn/lifecycle-toolkit/issues/1132)) ([17baf34](https://github.com/keptn/lifecycle-toolkit/commit/17baf3499a8681a850dfa7d88d049c26b86f8784)) +* update module github.com/onsi/gomega to v1.27.4 ([#967](https://github.com/keptn/lifecycle-toolkit/issues/967)) ([502189a](https://github.com/keptn/lifecycle-toolkit/commit/502189ad73ed9abc9bedb89bd701258ac729024e)) +* update module github.com/onsi/gomega to v1.27.5 ([#1133](https://github.com/keptn/lifecycle-toolkit/issues/1133)) ([7d0cf4b](https://github.com/keptn/lifecycle-toolkit/commit/7d0cf4b87d3c897ad348e9d1d31284710f99fbd0)) +* update module github.com/onsi/gomega to v1.27.6 ([#1166](https://github.com/keptn/lifecycle-toolkit/issues/1166)) ([ab3a091](https://github.com/keptn/lifecycle-toolkit/commit/ab3a091748b4d3cdccad4854edfaf01798387376)) +* update module github.com/prometheus/client_golang to v1.15.0 ([#1236](https://github.com/keptn/lifecycle-toolkit/issues/1236)) ([80b46c2](https://github.com/keptn/lifecycle-toolkit/commit/80b46c285c811feb126192471e8b7077246a3500)) +* update module github.com/prometheus/common to v0.42.0 ([#1111](https://github.com/keptn/lifecycle-toolkit/issues/1111)) ([7ac89de](https://github.com/keptn/lifecycle-toolkit/commit/7ac89de96afd21e63c5d77465880f9428a822213)) +* update module github.com/spf13/afero to v1.9.5 ([#1037](https://github.com/keptn/lifecycle-toolkit/issues/1037)) ([108e2a5](https://github.com/keptn/lifecycle-toolkit/commit/108e2a50764677dfe2bf6568c35bc2187ddcc206)) +* update module github.com/stretchr/testify to v1.8.2 ([#937](https://github.com/keptn/lifecycle-toolkit/issues/937)) ([ddd3732](https://github.com/keptn/lifecycle-toolkit/commit/ddd3732423cffa1d11bf7b0cef86a8229c3216e2)) +* update module golang.org/x/net to v0.9.0 ([#1298](https://github.com/keptn/lifecycle-toolkit/issues/1298)) ([ba7b679](https://github.com/keptn/lifecycle-toolkit/commit/ba7b679b0781de5558777fc93b8e9deb4ff6406a)) +* update module google.golang.org/grpc to v1.53.0 ([#817](https://github.com/keptn/lifecycle-toolkit/issues/817)) ([f5a3493](https://github.com/keptn/lifecycle-toolkit/commit/f5a3493545f391112f341b5c54b6bdf442d8179b)) +* update module google.golang.org/grpc to v1.54.0 ([#1112](https://github.com/keptn/lifecycle-toolkit/issues/1112)) ([ad2dc51](https://github.com/keptn/lifecycle-toolkit/commit/ad2dc511b9dcd3a8bc3bcd17e6344c9251a17a39)) +* update module k8s.io/component-helpers to v0.25.9 ([#1235](https://github.com/keptn/lifecycle-toolkit/issues/1235)) ([16b9a2b](https://github.com/keptn/lifecycle-toolkit/commit/16b9a2baefc87c695028993160aca4e5bbf5145d)) +* update module k8s.io/kubernetes to v1.25.8 ([#938](https://github.com/keptn/lifecycle-toolkit/issues/938)) ([65b854a](https://github.com/keptn/lifecycle-toolkit/commit/65b854ac9d02057e2bb99c270f629a44d67f258d)) +* update module sigs.k8s.io/controller-runtime to v0.14.5 ([#1038](https://github.com/keptn/lifecycle-toolkit/issues/1038)) ([1be4f11](https://github.com/keptn/lifecycle-toolkit/commit/1be4f11872a634a037ed60cdf07ecf4a58c3b2c0)) +* update module sigs.k8s.io/controller-runtime to v0.14.6 ([#1160](https://github.com/keptn/lifecycle-toolkit/issues/1160)) ([5f0071d](https://github.com/keptn/lifecycle-toolkit/commit/5f0071d114e28863192427e33ac5daa412418995)) +* update peter-evans/create-pull-request action to v5 ([#1190](https://github.com/keptn/lifecycle-toolkit/issues/1190)) ([6c205b1](https://github.com/keptn/lifecycle-toolkit/commit/6c205b1b75ba6ba3591379244a87e5fc5eabc8a2)) +* update sigstore/cosign-installer action to v3.0.2 ([#1198](https://github.com/keptn/lifecycle-toolkit/issues/1198)) ([31c657a](https://github.com/keptn/lifecycle-toolkit/commit/31c657afeac15de38a561d5a73b19d5013edc33c)) + + +### Other + +* adapt CODEOWNERS to new team structure ([#1250](https://github.com/keptn/lifecycle-toolkit/issues/1250)) ([0f11b85](https://github.com/keptn/lifecycle-toolkit/commit/0f11b85474e54a1d7811bb5df90498e40e13ecda)) +* bump go to 1.20 ([#1294](https://github.com/keptn/lifecycle-toolkit/issues/1294)) ([0a6ac23](https://github.com/keptn/lifecycle-toolkit/commit/0a6ac23eb77e2b5f8bdd20028309254dda2c9d1d)) +* bump GO_VERSION to 1.20 in pipelines ([#1326](https://github.com/keptn/lifecycle-toolkit/issues/1326)) ([7e8079e](https://github.com/keptn/lifecycle-toolkit/commit/7e8079ecfcd612bc31f581e66f76e4c895283efc)) +* **cert-manager:** reduce secret permissions ([#1295](https://github.com/keptn/lifecycle-toolkit/issues/1295)) ([bd8de3b](https://github.com/keptn/lifecycle-toolkit/commit/bd8de3b6461fcd599b58461ffbf42ff2e087951e)) +* fix failing component test ([#1282](https://github.com/keptn/lifecycle-toolkit/issues/1282)) ([00fd1f3](https://github.com/keptn/lifecycle-toolkit/commit/00fd1f3f2f6bd8e4d547d7e6b14cbd9fe9e14d42)) +* improve CRD docs generation script output ([#1157](https://github.com/keptn/lifecycle-toolkit/issues/1157)) ([b27adf1](https://github.com/keptn/lifecycle-toolkit/commit/b27adf1edc297dd7723998fcf4960929b2b2952d)) +* **metrics-operator:** add configuration parameters for container securityContext ([#1290](https://github.com/keptn/lifecycle-toolkit/issues/1290)) ([27439ff](https://github.com/keptn/lifecycle-toolkit/commit/27439ff3ad9fff30341fb987fd06ecb3aaef0d1d)) +* **metrics-operator:** restrict custom metrics ClusterRole privileges ([#1330](https://github.com/keptn/lifecycle-toolkit/issues/1330)) ([6f59a6c](https://github.com/keptn/lifecycle-toolkit/commit/6f59a6c0c75d79a54a874fcda64181180723551b)) +* **operator:** read-only RBAC for KeptnConfig controller ([#1096](https://github.com/keptn/lifecycle-toolkit/issues/1096)) ([ea91ff3](https://github.com/keptn/lifecycle-toolkit/commit/ea91ff36dfbe13811143031462407fecf7791596)) +* refactor and add unit tests to watcher ([#1253](https://github.com/keptn/lifecycle-toolkit/issues/1253)) ([4b40b7e](https://github.com/keptn/lifecycle-toolkit/commit/4b40b7ecccecc3bccaccc0532be1cd16d9c7ba6a)) +* remove cert-manager leftovers ([#1216](https://github.com/keptn/lifecycle-toolkit/issues/1216)) ([1c58ba8](https://github.com/keptn/lifecycle-toolkit/commit/1c58ba8edc2320d58096dea1f8beecfdc8c949b5)) +* reorder integration test execution ([#1264](https://github.com/keptn/lifecycle-toolkit/issues/1264)) ([71f2f78](https://github.com/keptn/lifecycle-toolkit/commit/71f2f787072627c807c2802bc57d016ee5b51d1b)) +* revert test makefile changes ([#1281](https://github.com/keptn/lifecycle-toolkit/issues/1281)) ([2261a4a](https://github.com/keptn/lifecycle-toolkit/commit/2261a4ab055095ad6d92b991e5520ff76ad9ba86)) +* set up YAML linter rules, fix YAML files accordingly ([#1174](https://github.com/keptn/lifecycle-toolkit/issues/1174)) ([86fbb75](https://github.com/keptn/lifecycle-toolkit/commit/86fbb757e55cb959e8ccb2ddc62bfcba55271452)) +* stop pushing dev container images to GHCR ([#1192](https://github.com/keptn/lifecycle-toolkit/issues/1192)) ([fa53443](https://github.com/keptn/lifecycle-toolkit/commit/fa53443c704193db029c92ff4ad08fc2bfaaa24d)) + + +### Docs + +* add better overview KeptnApp to readme ([#1254](https://github.com/keptn/lifecycle-toolkit/issues/1254)) ([497e57e](https://github.com/keptn/lifecycle-toolkit/commit/497e57e6ddeac0735871367042e96bca06b73356)) +* add community files to webpage ([#1077](https://github.com/keptn/lifecycle-toolkit/issues/1077)) ([ed3836a](https://github.com/keptn/lifecycle-toolkit/commit/ed3836aa6d75b186b09cb7c8ecf7c049f58af999)) +* add metrics-operator architecture ([#1151](https://github.com/keptn/lifecycle-toolkit/issues/1151)) ([80d0045](https://github.com/keptn/lifecycle-toolkit/commit/80d0045daccc292cad745aebbc2feba0c1e55cbd)) +* added example for autoscaling using KeptnMetric ([#1173](https://github.com/keptn/lifecycle-toolkit/issues/1173)) ([98dd248](https://github.com/keptn/lifecycle-toolkit/commit/98dd248f1fd22964fbae80a1de113f76fff3e55e)) +* adding KLT runtime info for local development ([#1246](https://github.com/keptn/lifecycle-toolkit/issues/1246)) ([c8131b6](https://github.com/keptn/lifecycle-toolkit/commit/c8131b63b55fc11085a7ab83b555b077656d9a7a)) +* change linting CLI and add custom rules ([#1031](https://github.com/keptn/lifecycle-toolkit/issues/1031)) ([acf5f91](https://github.com/keptn/lifecycle-toolkit/commit/acf5f91b2bc600d0008e64ffe602da8147134330)) +* cleanup after theme migration ([#1045](https://github.com/keptn/lifecycle-toolkit/issues/1045)) ([0125462](https://github.com/keptn/lifecycle-toolkit/commit/01254620b2735605d103f418e14487c43e6d3a1e)) +* describe automatic application discovery ([#1304](https://github.com/keptn/lifecycle-toolkit/issues/1304)) ([d576a33](https://github.com/keptn/lifecycle-toolkit/commit/d576a3323ff32a28ff1a8a207d811a01e1865d08)) +* fix missing code fence ([#1343](https://github.com/keptn/lifecycle-toolkit/issues/1343)) ([2576a98](https://github.com/keptn/lifecycle-toolkit/commit/2576a98cc252e66fc8e3ea3c0532e363f173fc61)) +* fix typo ([#1252](https://github.com/keptn/lifecycle-toolkit/issues/1252)) ([4a96b06](https://github.com/keptn/lifecycle-toolkit/commit/4a96b0637f01d597fb0ff2631b5784267386862e)) +* fix typo in the getting started docs ([#1204](https://github.com/keptn/lifecycle-toolkit/issues/1204)) ([c9b1a42](https://github.com/keptn/lifecycle-toolkit/commit/c9b1a42df8a8da1e158fd7a0c1d2a92726b7ca08)) +* improve docs for KeptnEvaluationDefinition ([#1335](https://github.com/keptn/lifecycle-toolkit/issues/1335)) ([d9e0aac](https://github.com/keptn/lifecycle-toolkit/commit/d9e0aac74c4b8fc4a3debd3f08d22155190d9f5f)) +* improve headline of Getting Started subsection ([#1350](https://github.com/keptn/lifecycle-toolkit/issues/1350)) ([a3ef431](https://github.com/keptn/lifecycle-toolkit/commit/a3ef431c5c41978a85df97828f9f297648f2bfdc)) +* improve landing page, based on slides ([#1272](https://github.com/keptn/lifecycle-toolkit/issues/1272)) ([117cda4](https://github.com/keptn/lifecycle-toolkit/commit/117cda489d60a5056e1341ec6f2ee4daf2172dec)) +* improve Notes within the documentation ([#962](https://github.com/keptn/lifecycle-toolkit/issues/962)) ([4e69699](https://github.com/keptn/lifecycle-toolkit/commit/4e69699d12d82cac1c8516c42dee8e131d993b4c)) +* improve rendering of links for local markdown files ([#1177](https://github.com/keptn/lifecycle-toolkit/issues/1177)) ([070bbee](https://github.com/keptn/lifecycle-toolkit/commit/070bbee37ee44be3f8f2c7f03078c3276ee317e3)) +* make cert-manager and manifest installation a detail ([#1099](https://github.com/keptn/lifecycle-toolkit/issues/1099)) ([66b3f01](https://github.com/keptn/lifecycle-toolkit/commit/66b3f013bba551be7471088a53b117242a34b543)) +* modify footer ([#1163](https://github.com/keptn/lifecycle-toolkit/issues/1163)) ([ee4ffcf](https://github.com/keptn/lifecycle-toolkit/commit/ee4ffcfd13469f3fb733e44319508b0c91bd765d)) +* **operator:** adjust docs comment ([#1126](https://github.com/keptn/lifecycle-toolkit/issues/1126)) ([4078fad](https://github.com/keptn/lifecycle-toolkit/commit/4078fada7a1c8a5a392aa11fe0f161acf190478d)) +* replace cert-manager ([#1210](https://github.com/keptn/lifecycle-toolkit/issues/1210)) ([a84cbc7](https://github.com/keptn/lifecycle-toolkit/commit/a84cbc7d67e8608f4c6638ab8d8efc1424f46933)) +* set up get-started directory tree ([#1303](https://github.com/keptn/lifecycle-toolkit/issues/1303)) ([57b6574](https://github.com/keptn/lifecycle-toolkit/commit/57b6574c76d3b5de1c7e361e5c4e64c449894d7a)) +* set up structure for yaml ref pages, guide section ([#1184](https://github.com/keptn/lifecycle-toolkit/issues/1184)) ([c164595](https://github.com/keptn/lifecycle-toolkit/commit/c164595d7682257e6c78f219cb9bc1e2b0f2fb82)) +* set up top-level Installation section ([#1162](https://github.com/keptn/lifecycle-toolkit/issues/1162)) ([2c62593](https://github.com/keptn/lifecycle-toolkit/commit/2c6259366a5ff545404dad2c692b7f1db524de83)) +* technologies to get familiar before working with KLT ([#1060](https://github.com/keptn/lifecycle-toolkit/issues/1060)) ([58e8a4c](https://github.com/keptn/lifecycle-toolkit/commit/58e8a4cac7b02a1b3fc37b5b448cb5df45a4c484)) +* update API reference docs pages ([#1273](https://github.com/keptn/lifecycle-toolkit/issues/1273)) ([706292a](https://github.com/keptn/lifecycle-toolkit/commit/706292aeb3d8280a7eea37ec089e5b7e83e6076e)) +* update docs for multi metrics provider support, fix API reference generator ([#1251](https://github.com/keptn/lifecycle-toolkit/issues/1251)) ([1dfd653](https://github.com/keptn/lifecycle-toolkit/commit/1dfd653eba98056cbee207d32ef5aa5b567bfb10)) +* update KeptnConfig docs to include KeptnAppCreationRequestTimeout ([#1348](https://github.com/keptn/lifecycle-toolkit/issues/1348)) ([117c263](https://github.com/keptn/lifecycle-toolkit/commit/117c263f0e4da43f32c5b3603c792de9a1badf66)) +* update KeptnTaskDefinition to include fallback search to default KLT namespace ([#1349](https://github.com/keptn/lifecycle-toolkit/issues/1349)) ([2f5587e](https://github.com/keptn/lifecycle-toolkit/commit/2f5587ed2407abe053ed6d8fb49ef7a7c1123eb4)) +* update list of videos about KLT ([#1105](https://github.com/keptn/lifecycle-toolkit/issues/1105)) ([ade49e1](https://github.com/keptn/lifecycle-toolkit/commit/ade49e1fd8d4cb9b811fb4b4be871c1907f124ad)) + ## [0.7.0](https://github.com/keptn/lifecycle-toolkit/compare/v0.6.0...v0.7.0) (2023-03-16) diff --git a/Makefile b/Makefile index bb793042e7..9c8906dea1 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ KUSTOMIZE_VERSION?=v5.0.1 # renovate: datasource=github-tags depName=helm/helm HELM_VERSION ?= v3.11.3 -CHART_APPVERSION ?= v0.7.0 # x-release-please-version +CHART_APPVERSION ?= v0.7.1 # x-release-please-version # renovate: datasource=docker depName=cytopia/yamllint YAMLLINT_VERSION ?= alpine diff --git a/README.md b/README.md index 343482dbc5..16d248a472 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ For installing the Lifecycle Toolkit via manifests use: ```shell -kubectl apply -f https://github.com/keptn/lifecycle-toolkit/releases/download/v0.7.0/manifest.yaml +kubectl apply -f https://github.com/keptn/lifecycle-toolkit/releases/download/v0.7.1/manifest.yaml ``` @@ -322,6 +322,8 @@ a `PostDeploymentCheck` can be triggered. A `KeptnTaskDefinition` is a CRD used to define tasks that can be run by the Keptn Lifecycle Toolkit as part of pre- and post-deployment phases of a deployment. +`KeptnTaskDefinition` resource can be created in the namespace where the application is running, or +in the default KLT namespace, which will be the fallback option for the system to search. The task definition is a [Deno](https://deno.land/) script Please, refer to the [function runtime](./functions-runtime/) folder for more information about the runtime. In the future, we also intend to support other runtimes, especially running a container image directly. @@ -485,6 +487,9 @@ resource is specified and the `KeptnMetric` resource does not exist in this name The `KeptnConfig` is a CRD defines configuration values for the Keptn Lifecycle Toolkit. Currently, it can be used to configure the URL of the OpenTelemetry collector. +Additionally, it can be used to set the time interval in which automatic app discovery +searches for workloads to put into the same auto-generated `KeptnApp`. +When the parameter is not set, the default value is 30 seconds. A `KeptnConfig` looks like the following: @@ -495,6 +500,7 @@ metadata: name: keptnconfig-sample spec: OTelCollectorUrl: 'otel-collector:4317' + keptnAppCreationRequestTimeoutSeconds: 30 ``` ## Install a dev build diff --git a/docs/content/en/docs/concepts/evaluations/_index.md b/docs/content/en/docs/concepts/evaluations/_index.md index fd4887dfa9..488e0fdd09 100644 --- a/docs/content/en/docs/concepts/evaluations/_index.md +++ b/docs/content/en/docs/concepts/evaluations/_index.md @@ -16,34 +16,24 @@ as part of pre- and post-analysis phases of a workload or application. A Keptn evaluation definition looks like the following: ```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 +apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnEvaluationDefinition metadata: name: my-prometheus-evaluation + namespace: example spec: source: prometheus objectives: - - name: query-1 - query: "xxxx" - evaluationTarget: <20 - - name: query-2 - query: "yyyy" - evaluationTarget: >4 + - keptnMetricRef: + name: available-cpus + namespace: example + evaluationTarget: ">1" + - keptnMetricRef: + name: cpus-throttling + namespace: example + evaluationTarget: "<0.01" ``` -### Keptn Evaluation Provider - -A `KeptnEvaluationProvider` is a CRD used to define evaluation provider, which will provide data for the -pre- and post-analysis phases of a workload or application. - -A Keptn evaluation provider looks like the following: - -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnEvaluationProvider -metadata: - name: prometheus -spec: - targetServer: "http://prometheus-k8s.monitoring.svc.cluster.local:9090" - secretName: prometheusLoginCredentials -``` +A `KeptnEvaluationDefinition` references one or more [`KeptnMetric`s](../metrics/). +If multiple `KeptnMetric`s are used, the Keptn Lifecycle Toolkit will consider the +evaluation successful if **all** metrics are respecting their `evaluationTarget`. diff --git a/docs/content/en/docs/concepts/keptnConfig/_index.md b/docs/content/en/docs/concepts/keptnConfig/_index.md index 6a515199ed..fbf7ef8e42 100644 --- a/docs/content/en/docs/concepts/keptnConfig/_index.md +++ b/docs/content/en/docs/concepts/keptnConfig/_index.md @@ -12,6 +12,9 @@ hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html A `KeptnConfig` CRD defines configuration values for the Keptn Lifecycle Toolkit. Currently, it can be used to configure the URL of the OpenTelemetry collector. +Additionally, it can be used to set the time interval in which automatic app discovery +searches for workloads to put into the same auto-generated `KeptnApp`. +When the parameter is not set, the default value is 30 seconds. A `KeptnConfig` looks like the following: @@ -22,4 +25,5 @@ metadata: name: keptnconfig-sample spec: OTelCollectorUrl: 'otel-collector:4317' + keptnAppCreationRequestTimeoutSeconds: 30 ``` diff --git a/docs/content/en/docs/concepts/tasks/_index.md b/docs/content/en/docs/concepts/tasks/_index.md index b9635e657d..b49f8ee3c3 100644 --- a/docs/content/en/docs/concepts/tasks/_index.md +++ b/docs/content/en/docs/concepts/tasks/_index.md @@ -11,6 +11,8 @@ hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html A `KeptnTaskDefinition` is a CRD used to define tasks that can be run by the Keptn Lifecycle Toolkit as part of pre- and post-deployment phases of a deployment. +`KeptnTaskDefinition` resource can be created in the namespace where the application is running, or +in the default KLT namespace, which will be the fallback option for the system to search. The task definition is a [Deno](https://deno.land/) script Please, refer to the [function runtime](https://github.com/keptn/lifecycle-toolkit/tree/main/functions-runtime) for more information about the runtime. diff --git a/docs/content/en/docs/getting-started/orchestrate/_index.md b/docs/content/en/docs/getting-started/orchestrate/_index.md index cf8c4a9a39..b87b7241bd 100644 --- a/docs/content/en/docs/getting-started/orchestrate/_index.md +++ b/docs/content/en/docs/getting-started/orchestrate/_index.md @@ -1,5 +1,5 @@ --- -title: Getting started with the Lifecycle Toolkit +title: Orchestrate deployment checks description: Learn how the Keptn Lifecycle Toolkit can orchestrate deployment checks. weight: 55 --- diff --git a/docs/content/en/docs/snippets/tasks/install.md b/docs/content/en/docs/snippets/tasks/install.md index 9872a7e721..2e7dcd78c8 100644 --- a/docs/content/en/docs/snippets/tasks/install.md +++ b/docs/content/en/docs/snippets/tasks/install.md @@ -48,7 +48,7 @@ with a command like the following: ```shell -kubectl apply -f https://github.com/keptn/lifecycle-toolkit/releases/download/v0.7.0/manifest.yaml +kubectl apply -f https://github.com/keptn/lifecycle-toolkit/releases/download/v0.7.1/manifest.yaml kubectl wait --for=condition=Available deployment/lifecycle-operator -n keptn-lifecycle-toolkit-system --timeout=120s ``` diff --git a/examples/support/keptn/keptnconfig.yaml b/examples/support/keptn/keptnconfig.yaml index df781d6967..989c75ddbd 100644 --- a/examples/support/keptn/keptnconfig.yaml +++ b/examples/support/keptn/keptnconfig.yaml @@ -4,3 +4,4 @@ metadata: name: keptnconfig-sample spec: OTelCollectorUrl: 'otel-collector:4317' + keptnAppCreationRequestTimeoutSeconds: 30 diff --git a/helm/chart/Chart.yaml b/helm/chart/Chart.yaml index 8b3bca5791..f7eef2bf58 100644 --- a/helm/chart/Chart.yaml +++ b/helm/chart/Chart.yaml @@ -47,4 +47,4 @@ version: 0.2.1 # 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.7.0" # x-release-please-version +appVersion: "v0.7.1" # x-release-please-version diff --git a/helm/chart/README.md b/helm/chart/README.md index 84fe35b421..5da5d16f37 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.keptn.sh/keptn/scheduler` | -| `scheduler.scheduler.image.tag` | set image tag for scheduler | `v0.7.0` | +| `scheduler.scheduler.image.tag` | set image tag for scheduler | `v0.7.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 | | @@ -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.keptn.sh/keptn/certificate-operator` | -| `certificateOperator.manager.image.tag` | select tag for manager container | `v0.7.0` | +| `certificateOperator.manager.image.tag` | select tag for manager container | `v0.7.1` | | `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` | @@ -91,9 +91,9 @@ 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 task runtime | `ghcr.keptn.sh/keptn/functions-runtime:v0.7.0` | +| `lifecycleOperator.manager.env.functionRunnerImage` | specify image for task runtime | `ghcr.keptn.sh/keptn/functions-runtime:v0.7.1` | | `lifecycleOperator.manager.image.repository` | specify registry for manager image | `ghcr.keptn.sh/keptn/lifecycle-operator` | -| `lifecycleOperator.manager.image.tag` | select tag for manager image | `v0.7.0` | +| `lifecycleOperator.manager.image.tag` | select tag for manager image | `v0.7.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 | | @@ -146,7 +146,7 @@ checks | `metricsOperator.manager.containerSecurityContext.runAsUser` | | `65532` | | `metricsOperator.manager.containerSecurityContext.seccompProfile.type` | | `RuntimeDefault` | | `metricsOperator.manager.image.repository` | specify registry for manager image | `ghcr.keptn.sh/keptn/metrics-operator` | -| `metricsOperator.manager.image.tag` | select tag for manager image | `v0.7.0` | +| `metricsOperator.manager.image.tag` | select tag for manager image | `v0.7.1` | | `metricsOperator.manager.env.exposeKeptnMetrics` | enable metrics exporter | `true` | | `metricsOperator.manager.env.metricsControllerLogLevel` | sets the log level of Metrics Controller | `0` | | `metricsOperator.manager.livenessProbe` | custom livenessprobe for manager container | | diff --git a/klt-cert-manager/Makefile b/klt-cert-manager/Makefile index 1bc6b26376..0531d87b33 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?="v0.7.0" # x-release-please-version +TAG?="v0.7.1" # x-release-please-version RELEASE_IMAGE:=certificate-operator:$(TAG) CHART_APPVERSION?="" diff --git a/metrics-operator/Makefile b/metrics-operator/Makefile index 3a9bfa0753..5852ff5548 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.7.0" # x-release-please-version +TAG?="v0.7.1" # x-release-please-version RELEASE_IMAGE:=metrics-operator:$(TAG) CHART_APPVERSION?="" diff --git a/operator/Makefile b/operator/Makefile index c4bea0e54a..a80f58ffde 100644 --- a/operator/Makefile +++ b/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.7.0" # x-release-please-version +TAG?="v0.7.1" # x-release-please-version RELEASE_IMAGE:=lifecycle-operator:$(TAG) CHART_APPVERSION?="" diff --git a/operator/config/manager/manager.yaml b/operator/config/manager/manager.yaml index 607a54e530..1558e8c7a0 100644 --- a/operator/config/manager/manager.yaml +++ b/operator/config/manager/manager.yaml @@ -68,7 +68,7 @@ spec: fieldRef: fieldPath: metadata.name - name: FUNCTION_RUNNER_IMAGE - value: ghcr.keptn.sh/keptn/functions-runtime:v0.7.0 # x-release-please-version + value: ghcr.keptn.sh/keptn/functions-runtime:v0.7.1 # x-release-please-version - name: OTEL_COLLECTOR_URL value: otel-collector:4317 - name: KEPTN_APP_CONTROLLER_LOG_LEVEL diff --git a/operator/controllers/common/helperfunctions.go b/operator/controllers/common/helperfunctions.go index e4a5f2e2e7..053e8c63e1 100644 --- a/operator/controllers/common/helperfunctions.go +++ b/operator/controllers/common/helperfunctions.go @@ -1,16 +1,21 @@ package common import ( + "context" "fmt" + "github.com/go-logr/logr" klcv1alpha3 "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3" apicommon "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3/common" "github.com/keptn/lifecycle-toolkit/operator/controllers/lifecycle/interfaces" + k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/record" "sigs.k8s.io/controller-runtime/pkg/client" ) +const KLTNamespace = "keptn-lifecycle-toolkit-system" + // GetItemStatus retrieves the state of the task/evaluation, if it does not exists, it creates a default one func GetItemStatus(name string, instanceStatus []klcv1alpha3.ItemStatus) klcv1alpha3.ItemStatus { for _, status := range instanceStatus { @@ -81,3 +86,20 @@ func copyMap[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](dst M1, src M2) { dst[k] = v } } + +func GetTaskDefinition(k8sclient client.Client, log logr.Logger, ctx context.Context, definitionName string, namespace string) (*klcv1alpha3.KeptnTaskDefinition, error) { + definition := &klcv1alpha3.KeptnTaskDefinition{} + err := k8sclient.Get(ctx, types.NamespacedName{Name: definitionName, Namespace: namespace}, definition) + if err != nil { + log.Error(err, "Failed to get KeptnTaskDefinition from application namespace") + if k8serrors.IsNotFound(err) { + if err := k8sclient.Get(ctx, types.NamespacedName{Name: definitionName, Namespace: KLTNamespace}, definition); err != nil { + log.Error(err, "Failed to get KeptnTaskDefinition from default KLT namespace") + return nil, err + } + return definition, nil + } + return nil, err + } + return definition, nil +} diff --git a/operator/controllers/common/helperfunctions_test.go b/operator/controllers/common/helperfunctions_test.go index 6ab884271c..3ac3c8bba2 100644 --- a/operator/controllers/common/helperfunctions_test.go +++ b/operator/controllers/common/helperfunctions_test.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" klcv1alpha3 "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3" @@ -8,7 +9,10 @@ import ( "github.com/stretchr/testify/require" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/kubernetes/scheme" + ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/client/fake" ) func Test_GetItemStatus(t *testing.T) { @@ -402,3 +406,84 @@ func Test_setAnnotations(t *testing.T) { }) } } + +func Test_GetTaskDefinition(t *testing.T) { + tests := []struct { + name string + taskDef *klcv1alpha3.KeptnTaskDefinition + taskDefName string + taskDefNamespace string + out *klcv1alpha3.KeptnTaskDefinition + wantError bool + }{ + { + name: "taskDef not found", + taskDef: &klcv1alpha3.KeptnTaskDefinition{ + ObjectMeta: v1.ObjectMeta{ + Name: "taskDef", + Namespace: "some-other-namespace", + }, + }, + taskDefName: "taskDef", + taskDefNamespace: "some-namespace", + out: nil, + wantError: true, + }, + { + name: "taskDef found", + taskDef: &klcv1alpha3.KeptnTaskDefinition{ + ObjectMeta: v1.ObjectMeta{ + Name: "taskDef", + Namespace: "some-namespace", + }, + }, + taskDefName: "taskDef", + taskDefNamespace: "some-namespace", + out: &klcv1alpha3.KeptnTaskDefinition{ + ObjectMeta: v1.ObjectMeta{ + Name: "taskDef", + Namespace: "some-namespace", + }, + }, + wantError: false, + }, + { + name: "taskDef found in default KLT namespace", + taskDef: &klcv1alpha3.KeptnTaskDefinition{ + ObjectMeta: v1.ObjectMeta{ + Name: "taskDef", + Namespace: KLTNamespace, + }, + }, + taskDefName: "taskDef", + taskDefNamespace: "some-namespace", + out: &klcv1alpha3.KeptnTaskDefinition{ + ObjectMeta: v1.ObjectMeta{ + Name: "taskDef", + Namespace: KLTNamespace, + }, + }, + wantError: false, + }, + } + + err := klcv1alpha3.AddToScheme(scheme.Scheme) + require.Nil(t, err) + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + client := fake.NewClientBuilder().WithObjects(tt.taskDef).Build() + d, err := GetTaskDefinition(client, ctrl.Log.WithName("testytest"), context.TODO(), tt.taskDefName, tt.taskDefNamespace) + if tt.out != nil && d != nil { + require.Equal(t, tt.out.Name, d.Name) + require.Equal(t, tt.out.Namespace, d.Namespace) + } else if tt.out != d { + t.Errorf("want: %v, got: %v", tt.out, d) + } + if tt.wantError != (err != nil) { + t.Errorf("want error: %t, got: %v", tt.wantError, err) + } + + }) + } +} diff --git a/operator/controllers/common/providers/keptnmetric/keptnmetric.go b/operator/controllers/common/providers/keptnmetric/keptnmetric.go index 0593c7c497..fd08879a7b 100644 --- a/operator/controllers/common/providers/keptnmetric/keptnmetric.go +++ b/operator/controllers/common/providers/keptnmetric/keptnmetric.go @@ -7,6 +7,7 @@ import ( "github.com/go-logr/logr" metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha2" klcv1alpha3 "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3" + "github.com/keptn/lifecycle-toolkit/operator/controllers/common" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -16,8 +17,6 @@ type KeptnMetricProvider struct { K8sClient client.Client } -const KLTNamespace = "keptn-lifecycle-toolkit-system" - // FetchData fetches the SLI values from KeptnMetric resource func (p *KeptnMetricProvider) FetchData(ctx context.Context, objective klcv1alpha3.Objective, namespace string) (string, []byte, error) { metric, err := p.GetKeptnMetric(ctx, objective, namespace) @@ -45,8 +44,8 @@ func (p *KeptnMetricProvider) GetKeptnMetric(ctx context.Context, objective klcv } else { if err := p.K8sClient.Get(ctx, types.NamespacedName{Name: objective.KeptnMetricRef.Name, Namespace: namespace}, metric); err != nil { p.Log.Error(err, "Failed to get KeptnMetric from KeptnEvaluation resource namespace") - if err := p.K8sClient.Get(ctx, types.NamespacedName{Name: objective.KeptnMetricRef.Name, Namespace: KLTNamespace}, metric); err != nil { - p.Log.Error(err, "Failed to get KeptnMetric from "+KLTNamespace+" namespace") + if err := p.K8sClient.Get(ctx, types.NamespacedName{Name: objective.KeptnMetricRef.Name, Namespace: common.KLTNamespace}, metric); err != nil { + p.Log.Error(err, "Failed to get KeptnMetric from "+common.KLTNamespace+" namespace") return nil, err } } diff --git a/operator/controllers/common/providers/keptnmetric/keptnmetric_test.go b/operator/controllers/common/providers/keptnmetric/keptnmetric_test.go index 713f9c3b97..e05cb5919a 100644 --- a/operator/controllers/common/providers/keptnmetric/keptnmetric_test.go +++ b/operator/controllers/common/providers/keptnmetric/keptnmetric_test.go @@ -6,6 +6,7 @@ import ( metricsapi "github.com/keptn/lifecycle-toolkit/metrics-operator/api/v1alpha2" klcv1alpha3 "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3" + "github.com/keptn/lifecycle-toolkit/operator/controllers/common" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" @@ -170,14 +171,14 @@ func Test_Getkeptnmetric(t *testing.T) { metric: &metricsapi.KeptnMetric{ ObjectMeta: metav1.ObjectMeta{ Name: "metric", - Namespace: KLTNamespace, + Namespace: common.KLTNamespace, }, }, namespace: "my-other-namespace", out: &metricsapi.KeptnMetric{ ObjectMeta: metav1.ObjectMeta{ Name: "metric", - Namespace: KLTNamespace, + Namespace: common.KLTNamespace, }, }, wantError: false, diff --git a/operator/controllers/common/taskhandler.go b/operator/controllers/common/taskhandler.go index 16e90e7c5a..c34641dff5 100644 --- a/operator/controllers/common/taskhandler.go +++ b/operator/controllers/common/taskhandler.go @@ -159,8 +159,7 @@ func (r TaskHandler) setupTasks(taskCreateAttributes CreateTaskAttributes, piWra } func (r TaskHandler) handleTaskNotExists(ctx context.Context, phaseCtx context.Context, taskCreateAttributes CreateTaskAttributes, taskName string, piWrapper *interfaces.PhaseItemWrapper, reconcileObject client.Object, task *klcv1alpha3.KeptnTask, taskStatus *klcv1alpha3.ItemStatus) error { - definition := &klcv1alpha3.KeptnTaskDefinition{} - err := r.Client.Get(ctx, types.NamespacedName{Name: taskName, Namespace: piWrapper.GetNamespace()}, definition) + definition, err := GetTaskDefinition(r.Client, r.Log, ctx, taskName, piWrapper.GetNamespace()) if err != nil { r.Log.Error(err, "could not find KeptnTaskDefinition") return controllererrors.ErrCannotGetKeptnTaskDefinition diff --git a/operator/controllers/common/taskhandler_test.go b/operator/controllers/common/taskhandler_test.go index 1ee331f39e..6c319d9bef 100644 --- a/operator/controllers/common/taskhandler_test.go +++ b/operator/controllers/common/taskhandler_test.go @@ -87,6 +87,46 @@ func TestTaskHandler(t *testing.T) { getSpanCalls: 0, unbindSpanCalls: 0, }, + { + name: "task not started - taskDefinition in default KLT namespace", + object: &v1alpha3.KeptnAppVersion{ + ObjectMeta: v1.ObjectMeta{ + Namespace: "namespace", + }, + Spec: v1alpha3.KeptnAppVersionSpec{ + KeptnAppSpec: v1alpha3.KeptnAppSpec{ + PreDeploymentTasks: []string{"task-def"}, + }, + }, + }, + taskDef: &v1alpha3.KeptnTaskDefinition{ + ObjectMeta: v1.ObjectMeta{ + Namespace: KLTNamespace, + Name: "task-def", + }, + }, + taskObj: v1alpha3.KeptnTask{}, + createAttr: CreateTaskAttributes{ + SpanName: "", + Definition: v1alpha3.KeptnTaskDefinition{ + ObjectMeta: v1.ObjectMeta{ + Name: "task-def", + }, + }, + CheckType: apicommon.PreDeploymentCheckType, + }, + wantStatus: []v1alpha3.ItemStatus{ + { + DefinitionName: "task-def", + Status: apicommon.StatePending, + Name: "pre-task-def-", + }, + }, + wantSummary: apicommon.StatusSummary{Total: 1, Pending: 1}, + wantErr: nil, + getSpanCalls: 1, + unbindSpanCalls: 0, + }, { name: "task not started", object: &v1alpha3.KeptnAppVersion{ diff --git a/operator/controllers/lifecycle/keptntask/job_utils.go b/operator/controllers/lifecycle/keptntask/job_utils.go index 47563bf82b..a57874927b 100644 --- a/operator/controllers/lifecycle/keptntask/job_utils.go +++ b/operator/controllers/lifecycle/keptntask/job_utils.go @@ -16,7 +16,7 @@ import ( func (r *KeptnTaskReconciler) createJob(ctx context.Context, req ctrl.Request, task *klcv1alpha3.KeptnTask) error { jobName := "" - definition, err := r.getTaskDefinition(ctx, task.Spec.TaskDefinition, req.Namespace) + definition, err := controllercommon.GetTaskDefinition(r.Client, r.Log, ctx, task.Spec.TaskDefinition, req.Namespace) if err != nil { controllercommon.RecordEvent(r.Recorder, apicommon.PhaseCreateTask, "Warning", task, "TaskDefinitionNotFound", fmt.Sprintf("could not find KeptnTaskDefinition: %s ", task.Spec.TaskDefinition), "") return err @@ -129,7 +129,7 @@ func setupTaskContext(task *klcv1alpha3.KeptnTask) klcv1alpha3.TaskContext { func (r *KeptnTaskReconciler) handleParent(ctx context.Context, req ctrl.Request, task *klcv1alpha3.KeptnTask, definition *klcv1alpha3.KeptnTaskDefinition, params FunctionExecutionParams) error { var parentJobParams FunctionExecutionParams - parentDefinition, err := r.getTaskDefinition(ctx, definition.Spec.Function.FunctionReference.Name, req.Namespace) + parentDefinition, err := controllercommon.GetTaskDefinition(r.Client, r.Log, ctx, definition.Spec.Function.FunctionReference.Name, req.Namespace) if err != nil { controllercommon.RecordEvent(r.Recorder, apicommon.PhaseCreateTask, "Warning", task, "TaskDefinitionNotFound", fmt.Sprintf("could not find KeptnTaskDefinition: %s ", task.Spec.TaskDefinition), "") return err diff --git a/operator/controllers/lifecycle/keptntask/job_utils_test.go b/operator/controllers/lifecycle/keptntask/job_utils_test.go index 8ebd6ba9aa..3ed1e2c4b5 100644 --- a/operator/controllers/lifecycle/keptntask/job_utils_test.go +++ b/operator/controllers/lifecycle/keptntask/job_utils_test.go @@ -6,6 +6,7 @@ import ( klcv1alpha3 "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3" apicommon "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3/common" + "github.com/keptn/lifecycle-toolkit/operator/controllers/common" "github.com/stretchr/testify/require" batchv1 "k8s.io/api/batch/v1" v1 "k8s.io/api/core/v1" @@ -90,6 +91,80 @@ func TestKeptnTaskReconciler_createJob(t *testing.T) { }, resultingJob.Annotations) } +func TestKeptnTaskReconciler_createJob_withTaskDefInDefaultNamespace(t *testing.T) { + namespace := "default" + cmName := "my-cmd" + taskDefinitionName := "my-task-definition" + + cm := makeConfigMap(cmName, namespace) + + fakeClient := fake.NewClientBuilder().WithObjects(cm).Build() + + fakeRecorder := &record.FakeRecorder{} + + err := klcv1alpha3.AddToScheme(fakeClient.Scheme()) + require.Nil(t, err) + + taskDefinition := makeTaskDefinitionWithConfigmapRef(taskDefinitionName, common.KLTNamespace, cmName) + + err = fakeClient.Create(context.TODO(), taskDefinition) + require.Nil(t, err) + + taskDefinition.Status.Function.ConfigMap = cmName + err = fakeClient.Status().Update(context.TODO(), taskDefinition) + require.Nil(t, err) + + r := &KeptnTaskReconciler{ + Client: fakeClient, + Recorder: fakeRecorder, + Log: ctrl.Log.WithName("task-controller"), + Scheme: fakeClient.Scheme(), + } + + task := makeTask("my-task", namespace, taskDefinitionName) + + err = fakeClient.Create(context.TODO(), task) + require.Nil(t, err) + + req := ctrl.Request{ + NamespacedName: types.NamespacedName{ + Namespace: namespace, + }, + } + + // retrieve the task again to verify its status + err = fakeClient.Get(context.TODO(), types.NamespacedName{ + Namespace: namespace, + Name: task.Name, + }, task) + + require.Nil(t, err) + + err = r.createJob(context.TODO(), req, task) + require.Nil(t, err) + + require.NotEmpty(t, task.Status.JobName) + + resultingJob := &batchv1.Job{} + err = fakeClient.Get(context.TODO(), types.NamespacedName{Namespace: namespace, Name: task.Status.JobName}, resultingJob) + require.Nil(t, err) + + require.Equal(t, namespace, resultingJob.Namespace) + require.NotEmpty(t, resultingJob.OwnerReferences) + require.Len(t, resultingJob.Spec.Template.Spec.Containers, 1) + require.Len(t, resultingJob.Spec.Template.Spec.Containers[0].Env, 4) + require.Equal(t, map[string]string{ + "label1": "label2", + "keptn.sh/app": "my-app", + "keptn.sh/task-name": "my-task", + "keptn.sh/version": "", + "keptn.sh/workload": "my-workload", + }, resultingJob.Labels) + require.Equal(t, map[string]string{ + "annotation1": "annotation2", + }, resultingJob.Annotations) +} + func TestKeptnTaskReconciler_updateJob(t *testing.T) { namespace := "default" taskDefinitionName := "my-task-definition" diff --git a/operator/controllers/lifecycle/keptntask/task_utils.go b/operator/controllers/lifecycle/keptntask/task_utils.go deleted file mode 100644 index 08e6c4b623..0000000000 --- a/operator/controllers/lifecycle/keptntask/task_utils.go +++ /dev/null @@ -1,17 +0,0 @@ -package keptntask - -import ( - "context" - - klcv1alpha3 "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3" - "k8s.io/apimachinery/pkg/types" -) - -func (r *KeptnTaskReconciler) getTaskDefinition(ctx context.Context, definitionName string, namespace string) (*klcv1alpha3.KeptnTaskDefinition, error) { - definition := &klcv1alpha3.KeptnTaskDefinition{} - err := r.Client.Get(ctx, types.NamespacedName{Name: definitionName, Namespace: namespace}, definition) - if err != nil { - return definition, err - } - return definition, nil -} diff --git a/operator/test/component/task/task_test.go b/operator/test/component/task/task_test.go index 6e1b435fb3..9954f9f7d2 100644 --- a/operator/test/component/task/task_test.go +++ b/operator/test/component/task/task_test.go @@ -5,6 +5,7 @@ import ( klcv1alpha3 "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3" apicommon "github.com/keptn/lifecycle-toolkit/operator/apis/lifecycle/v1alpha3/common" + controllercommon "github.com/keptn/lifecycle-toolkit/operator/controllers/common" "github.com/keptn/lifecycle-toolkit/operator/test/component/common" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -34,12 +35,10 @@ var _ = Describe("Task", Ordered, func() { task *klcv1alpha3.KeptnTask ) Context("with an existing TaskDefinition", func() { - BeforeEach(func() { + It("should end up in a failed state if the created job fails", func() { taskDefinition = makeTaskDefinition(taskDefinitionName, namespace) task = makeTask(name, namespace, taskDefinition.Name) - }) - It("should end up in a failed state if the created job fails", func() { By("Verifying that a job has been created") Eventually(func(g Gomega) { @@ -79,7 +78,63 @@ var _ = Describe("Task", Ordered, func() { g.Expect(task.Status.Status).To(Equal(apicommon.StateFailed)) }, "10s").Should(Succeed()) }) + It("succeed task if taskDefiniton is present in default KLT namespace", func() { + By("create default KLT namespace") + + ns := &v1.Namespace{ + ObjectMeta: metav1.ObjectMeta{ + Name: controllercommon.KLTNamespace, + }, + } + err := k8sClient.Create(context.TODO(), ns) + Expect(err).To(BeNil()) + + taskDefinition = makeTaskDefinition(taskDefinitionName, controllercommon.KLTNamespace) + task = makeTask(name, namespace, taskDefinition.Name) + + By("Verifying that a job has been created") + + Eventually(func(g Gomega) { + err := k8sClient.Get(context.TODO(), types.NamespacedName{ + Namespace: namespace, + Name: task.Name, + }, task) + g.Expect(err).To(BeNil()) + g.Expect(task.Status.JobName).To(Not(BeEmpty())) + }, "10s").Should(Succeed()) + + createdJob := &batchv1.Job{} + + err = k8sClient.Get(context.TODO(), types.NamespacedName{ + Namespace: namespace, + Name: task.Status.JobName, + }, createdJob) + + Expect(err).To(BeNil()) + + By("Setting the Job Status to complete") + createdJob.Status.Conditions = []batchv1.JobCondition{ + { + Type: batchv1.JobComplete, + }, + } + + err = k8sClient.Status().Update(context.TODO(), createdJob) + Expect(err).To(BeNil()) + + Eventually(func(g Gomega) { + err := k8sClient.Get(context.TODO(), types.NamespacedName{ + Namespace: namespace, + Name: task.Name, + }, task) + g.Expect(err).To(BeNil()) + g.Expect(task.Status.Status).To(Equal(apicommon.StateSucceeded)) + }, "10s").Should(Succeed()) + }) It("should propagate labels and annotations to the job and job pod", func() { + taskDefinition = makeTaskDefinition(taskDefinitionName, namespace) + task = makeTask(name, namespace, taskDefinition.Name) + By("Verifying that a job has been created") Eventually(func(g Gomega) { @@ -126,7 +181,7 @@ var _ = Describe("Task", Ordered, func() { err = k8sClient.Delete(context.TODO(), &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: taskDefinition.Status.Function.ConfigMap, - Namespace: namespace, + Namespace: taskDefinition.Namespace, }, }) common.LogErrorIfPresent(err) diff --git a/scheduler/Makefile b/scheduler/Makefile index fcae7212d8..a7de6efa6c 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.7.0" # x-release-please-version +TAG?="v0.7.1" # x-release-please-version CHART_APPVERSION?="" LOCAL_REGISTRY=localhost:5000/scheduler-plugins