From 35b602664d55db23818e65d7930d43daf476455e Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 21 Mar 2023 19:52:24 -0700 Subject: [PATCH 01/33] docs: KeptnTaskDefinition yaml CRD ref page Signed-off-by: Meg McRoberts --- docs/content/en/docs/api-ref/_index.md | 34 ++++ .../{crd-ref => api-ref}/lifecycle/_index.md | 0 .../lifecycle/v1alpha1/_index.md | 0 .../lifecycle/v1alpha2/_index.md | 0 .../lifecycle/v1alpha3/_index.md | 0 .../{crd-ref => api-ref}/metrics/_index.md | 0 .../metrics/v1alpha1/_index.md | 0 .../{crd-ref => api-ref}/options/_index.md | 0 .../options/v1alpha1/_index.md | 0 .../en/docs/crd-ref/TaskDefinition/index.md | 163 ++++++++++++++++++ docs/content/en/docs/crd-ref/_index.md | 8 +- docs/content/en/docs/crd-ref/crd-template | 33 ++++ 12 files changed, 235 insertions(+), 3 deletions(-) create mode 100644 docs/content/en/docs/api-ref/_index.md rename docs/content/en/docs/{crd-ref => api-ref}/lifecycle/_index.md (100%) rename docs/content/en/docs/{crd-ref => api-ref}/lifecycle/v1alpha1/_index.md (100%) rename docs/content/en/docs/{crd-ref => api-ref}/lifecycle/v1alpha2/_index.md (100%) rename docs/content/en/docs/{crd-ref => api-ref}/lifecycle/v1alpha3/_index.md (100%) rename docs/content/en/docs/{crd-ref => api-ref}/metrics/_index.md (100%) rename docs/content/en/docs/{crd-ref => api-ref}/metrics/v1alpha1/_index.md (100%) rename docs/content/en/docs/{crd-ref => api-ref}/options/_index.md (100%) rename docs/content/en/docs/{crd-ref => api-ref}/options/v1alpha1/_index.md (100%) create mode 100644 docs/content/en/docs/crd-ref/TaskDefinition/index.md create mode 100644 docs/content/en/docs/crd-ref/crd-template diff --git a/docs/content/en/docs/api-ref/_index.md b/docs/content/en/docs/api-ref/_index.md new file mode 100644 index 0000000000..13ab97bf81 --- /dev/null +++ b/docs/content/en/docs/api-ref/_index.md @@ -0,0 +1,34 @@ +--- +title: API Reference +description: Reference information about the KLT CRDs +weight: 100 +hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html +--- + +This section provides comprehensive reference information about the +[Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) +that are defined for the Keptn Lifecycle Toolkit. + +> **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 welcome your input!** + +Each CRD is an object of an API library. +Keptn APIs follow the Kubernetes API versioning scheme. +and are themselves composed of objects and sub-objects. +By introducing CRDs, Keptn is extending the base Kubernetes API with new objects and functionality. +Keptn APIs follow API versioning conventions recommended by Kubernetes. + +For more information, see the Kubernetes documentation: + +* [API Overview](https://kubernetes.io/docs/reference/using-api/) + +* [Custom Resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) + +* [API versioning](https://kubernetes.io/docs/reference/using-api/#api-versioning) + +* [Understanding Kubernetes Objects](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/) + + diff --git a/docs/content/en/docs/crd-ref/lifecycle/_index.md b/docs/content/en/docs/api-ref/lifecycle/_index.md similarity index 100% rename from docs/content/en/docs/crd-ref/lifecycle/_index.md rename to docs/content/en/docs/api-ref/lifecycle/_index.md diff --git a/docs/content/en/docs/crd-ref/lifecycle/v1alpha1/_index.md b/docs/content/en/docs/api-ref/lifecycle/v1alpha1/_index.md similarity index 100% rename from docs/content/en/docs/crd-ref/lifecycle/v1alpha1/_index.md rename to docs/content/en/docs/api-ref/lifecycle/v1alpha1/_index.md diff --git a/docs/content/en/docs/crd-ref/lifecycle/v1alpha2/_index.md b/docs/content/en/docs/api-ref/lifecycle/v1alpha2/_index.md similarity index 100% rename from docs/content/en/docs/crd-ref/lifecycle/v1alpha2/_index.md rename to docs/content/en/docs/api-ref/lifecycle/v1alpha2/_index.md diff --git a/docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md b/docs/content/en/docs/api-ref/lifecycle/v1alpha3/_index.md similarity index 100% rename from docs/content/en/docs/crd-ref/lifecycle/v1alpha3/_index.md rename to docs/content/en/docs/api-ref/lifecycle/v1alpha3/_index.md diff --git a/docs/content/en/docs/crd-ref/metrics/_index.md b/docs/content/en/docs/api-ref/metrics/_index.md similarity index 100% rename from docs/content/en/docs/crd-ref/metrics/_index.md rename to docs/content/en/docs/api-ref/metrics/_index.md diff --git a/docs/content/en/docs/crd-ref/metrics/v1alpha1/_index.md b/docs/content/en/docs/api-ref/metrics/v1alpha1/_index.md similarity index 100% rename from docs/content/en/docs/crd-ref/metrics/v1alpha1/_index.md rename to docs/content/en/docs/api-ref/metrics/v1alpha1/_index.md diff --git a/docs/content/en/docs/crd-ref/options/_index.md b/docs/content/en/docs/api-ref/options/_index.md similarity index 100% rename from docs/content/en/docs/crd-ref/options/_index.md rename to docs/content/en/docs/api-ref/options/_index.md diff --git a/docs/content/en/docs/crd-ref/options/v1alpha1/_index.md b/docs/content/en/docs/api-ref/options/v1alpha1/_index.md similarity index 100% rename from docs/content/en/docs/crd-ref/options/v1alpha1/_index.md rename to docs/content/en/docs/api-ref/options/v1alpha1/_index.md diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md new file mode 100644 index 0000000000..418971db1a --- /dev/null +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -0,0 +1,163 @@ +--- +title: KeptnTaskDefinition +description: Define tasks that can be run pre- or post-deployment +weight: 89 +--- + +A `KeptnTaskDefinition` defines tasks +that can be run by the Keptn Lifecycle Toolkit +as part of pre- and post-deployment phases of a deployment. + +## Yaml Synopsis + +```yaml +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnTaskDefinition +metadata: + name: +spec: + function: + inline: | httpRef | functionRef + [parameters: + map: + textMessage: "This is my configuration"] + [secureParameters: + secret: slack-token] +``` + +## Fields + +* **apiVersion** -- API version being used. + The default for KLT Release 0.5.0 is `lifecycle.keptn.sh/v1alpha2`. + * This must match + * Other information +` +* **kind** -- CRD type. Must be set to `KeptnTaskDefinition` + +* **name** -- Unique name of this task. + * Must be an alphanumeric string and, by convention, is all lowercase. + * Can include the special characters `_`, `-`, . + * Should not include spaces. + +* **function** -- Code to be executed, + expressed as a [Deno](https://deno.land/) script. + Refer to [function runtime](https://github.com/keptn/lifecycle-toolkit/tree/main/functions-runtime) + for more information about the runtime. + In the future, we intend to support additional runtimes, + especially running a container image directly. + + The `function` can be defined as one of the following: + + * **inline** - Include the actual executable code to execute. + This can be written as a full-fledged Deno script + that is included in this file. + For example: + + ```function: + inline: + code: | + console.log("Deployment Task has been executed"); + ``` + * **httpRef** - Specify a Deno script to be executed at runtime + from the remote webserver that is specified. + For example: + + ```yaml + name: hello-keptn-http + spec: + function: + httpRef: + url: + ``` + * **functionRef** -- Execute another `KeptnTaskDefinition` that has been defined. + Populate this field with the value of the `name` field + for the `KeptnTaskDefinition` to be called. + This is commonly used to call a general function + that is used in multiple places, possibly with different parameters. + An example is: + ```yaml + spec: + function: + functionRef: + name: slack-notification + ``` + + This can also be used to group a set of tasks + into a single `KeptnTaskDefinitions`, + such as defining a `KeptnTaskDefinition` for testing. + In this case, it calls a `KeptnTaskDefinition` + for each type of test to be run. + + + + + +## Examples + +This section can do any of the following: + +* Include annotated examples +* Link to formal `examples` that we provide; + include an annotation about what they illustrate. + In this case, it would be nice to point to examples + of the `inline`, `httpRef`, and `functionRef` code + for the `function` field. + +## Files + +* Link to source code file where this is defined. +* Should the links to the API Ref go here instead of "See also"? + +## Differences between versions + +## See also + +* Link to "use-case" guide pages that do something interesting with this CRD +* Link to reference pages for any related CRDs + +API Reference: + +* [KeptnTaskDefinition](../../api-ref/lifecycle/v1alpha3/#keptntaskdefinition) +* [KeptnTaskDefinitionList](../../api-ref/lifecycle/v1alpha3/#keptntaskdefinitionlist) +* [KeptnTaskDefinitionSpec](../../api-ref/lifecycle/v1alpha3/#keptntaskdefinitionspec) +* [FunctionReference](../../api-ref/lifecycle/v1alpha3/#functionreference) +* [FunctionSpec](../../api-ref/lifecycle/v1alpha3/#functionspec) +* [FunctionStatus](../../api-ref/lifecycle/v1alpha3/#functionstatus) +* [HttpReference](../../api-ref/lifecycle/v1alpha3/#httpreference) +* [Inline](../../api-ref/lifecycle/v1alpha3/#inline) diff --git a/docs/content/en/docs/crd-ref/_index.md b/docs/content/en/docs/crd-ref/_index.md index 13ab97bf81..60e803527d 100644 --- a/docs/content/en/docs/crd-ref/_index.md +++ b/docs/content/en/docs/crd-ref/_index.md @@ -1,11 +1,12 @@ --- -title: API Reference +title: CRD Reference description: Reference information about the KLT CRDs -weight: 100 +weight: 200 hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html --- This section provides comprehensive reference information about the +YAML files that create the [Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) that are defined for the Keptn Lifecycle Toolkit. @@ -15,7 +16,8 @@ Information that is published here has been reviewed for technical accuracy but the format and content is still evolving. We welcome your input!** -Each CRD is an object of an API library. +Each CRD is an object of an +[API library](../-ref). Keptn APIs follow the Kubernetes API versioning scheme. and are themselves composed of objects and sub-objects. By introducing CRDs, Keptn is extending the base Kubernetes API with new objects and functionality. diff --git a/docs/content/en/docs/crd-ref/crd-template b/docs/content/en/docs/crd-ref/crd-template new file mode 100644 index 0000000000..a4ec20f70a --- /dev/null +++ b/docs/content/en/docs/crd-ref/crd-template @@ -0,0 +1,33 @@ +--- +title: +description: +weight: +hidden: true +--- + +Copy this template to create a new CRD reference page. + +1. Replace the variable text in metadata with information for this page +1. Delete the `hidden: true` line +1. Delete these instructions from your file +1. Populate the page with appropriate content + +## Synopsis + +## Fields + + + +## Usage + + + + +## Examples + +## Files + +## Differences between versions + +## See also + From d7ee06f6e04c96c9573548a4848b24c8998a5942 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 21 Mar 2023 20:08:30 -0700 Subject: [PATCH 02/33] fix broken xref to API Ref Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/_index.md b/docs/content/en/docs/crd-ref/_index.md index 60e803527d..f35618bc3d 100644 --- a/docs/content/en/docs/crd-ref/_index.md +++ b/docs/content/en/docs/crd-ref/_index.md @@ -17,7 +17,7 @@ but the format and content is still evolving. We welcome your input!** Each CRD is an object of an -[API library](../-ref). +[API library](../../docs/api-ref/) Keptn APIs follow the Kubernetes API versioning scheme. and are themselves composed of objects and sub-objects. By introducing CRDs, Keptn is extending the base Kubernetes API with new objects and functionality. From 75585990fa3db7675a5611c777ccf0d570deabd0 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 21 Mar 2023 20:18:30 -0700 Subject: [PATCH 03/33] fix some markdown-linter errors Signed-off-by: Meg McRoberts --- docs/content/en/docs/api-ref/_index.md | 5 ----- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/content/en/docs/api-ref/_index.md b/docs/content/en/docs/api-ref/_index.md index 13ab97bf81..02a8de295b 100644 --- a/docs/content/en/docs/api-ref/_index.md +++ b/docs/content/en/docs/api-ref/_index.md @@ -24,11 +24,6 @@ Keptn APIs follow API versioning conventions recommended by Kubernetes. For more information, see the Kubernetes documentation: * [API Overview](https://kubernetes.io/docs/reference/using-api/) - * [Custom Resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) - * [API versioning](https://kubernetes.io/docs/reference/using-api/#api-versioning) - * [Understanding Kubernetes Objects](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/) - - diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index 418971db1a..de291d8a26 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -58,6 +58,7 @@ spec: code: | console.log("Deployment Task has been executed"); ``` + * **httpRef** - Specify a Deno script to be executed at runtime from the remote webserver that is specified. For example: @@ -69,12 +70,14 @@ spec: httpRef: url: ``` + * **functionRef** -- Execute another `KeptnTaskDefinition` that has been defined. Populate this field with the value of the `name` field for the `KeptnTaskDefinition` to be called. This is commonly used to call a general function that is used in multiple places, possibly with different parameters. An example is: + ```yaml spec: function: @@ -98,6 +101,7 @@ spec: as a JSON object. At the moment, multi-level maps are not supported. For example: + ```spec: parameters: map: @@ -124,10 +128,6 @@ A Task is responsible for executing the TaskDefinition of a workload. The execution is done by spawning a K8s Job to handle a single Task. In its state, it keeps track of the current status of the K8s Job created. - - - - ## Examples This section can do any of the following: From 3623ee19d6e62697d61baf1869f1a89fdfe357b2 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 23 Mar 2023 02:27:33 -0700 Subject: [PATCH 04/33] markdownlint auto fixes Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/_index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/content/en/docs/crd-ref/_index.md b/docs/content/en/docs/crd-ref/_index.md index f35618bc3d..f6f12c2328 100644 --- a/docs/content/en/docs/crd-ref/_index.md +++ b/docs/content/en/docs/crd-ref/_index.md @@ -32,5 +32,3 @@ For more information, see the Kubernetes documentation: * [API versioning](https://kubernetes.io/docs/reference/using-api/#api-versioning) * [Understanding Kubernetes Objects](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/) - - From 9f93537d1f2293fb29b41b17a1e6407f8adf0738 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Sun, 26 Mar 2023 18:47:38 -0700 Subject: [PATCH 05/33] Pull in all info from old write-tasks Signed-off-by: Meg McRoberts --- .../en/docs/crd-ref/TaskDefinition/index.md | 178 +++++++++++++++--- .../en/docs/tasks/write-tasks/_index.md | 113 ----------- 2 files changed, 147 insertions(+), 144 deletions(-) delete mode 100644 docs/content/en/docs/tasks/write-tasks/_index.md diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index de291d8a26..f2a70fa17a 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -6,12 +6,12 @@ weight: 89 A `KeptnTaskDefinition` defines tasks that can be run by the Keptn Lifecycle Toolkit -as part of pre- and post-deployment phases of a deployment. +as part of the pre- and post-deployment phases of a `KeptnApp`. ## Yaml Synopsis ```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 +apiVersion: kind: KeptnTaskDefinition metadata: name: @@ -28,9 +28,6 @@ spec: ## Fields * **apiVersion** -- API version being used. - The default for KLT Release 0.5.0 is `lifecycle.keptn.sh/v1alpha2`. - * This must match - * Other information ` * **kind** -- CRD type. Must be set to `KeptnTaskDefinition` @@ -88,18 +85,13 @@ spec: This can also be used to group a set of tasks into a single `KeptnTaskDefinitions`, such as defining a `KeptnTaskDefinition` for testing. - In this case, it calls a `KeptnTaskDefinition` - for each type of test to be run. - - +``` -* Link to source code file where this is defined. -* Should the links to the API Ref go here instead of "See also"? +See the +[sample-app/version-1](https://github.com/keptn-sandbox/lifecycle-toolkit-examples/blob/main/sample-app/version-1/app-pre-deploy.yaml). +PodtatoHead example for a more complete example. -## Differences between versions +**Example 3** calls another defined task, +illustrating how one `KeptnTaskDefinition` can build +on top of other `KeptnTaskDefinition`s. +In this case, it calls `slack-notification-dev`, +passing `parameters` and `secureParameters` to that other task: -## See also +```yaml +apiVersion: lifecycle.keptn.sh/v1alpha2 +kind: KeptnTaskDefinition +metadata: + name: slack-notification-dev +spec: + function: + functionRef: + name: slack-notification + parameters: + map: + textMessage: "This is my configuration" + secureParameters: + secret: slack-token +``` -* Link to "use-case" guide pages that do something interesting with this CRD -* Link to reference pages for any related CRDs +## Files API Reference: @@ -161,3 +267,13 @@ API Reference: * [FunctionStatus](../../api-ref/lifecycle/v1alpha3/#functionstatus) * [HttpReference](../../api-ref/lifecycle/v1alpha3/#httpreference) * [Inline](../../api-ref/lifecycle/v1alpha3/#inline) + +## Differences between versions + +The `KeptnTaskDefinition` is the same for +all `v1alpha?` library versions. + +## See also + +* Link to "use-case" guide pages that do something interesting with this CRD +* Link to reference pages for any related CRDs diff --git a/docs/content/en/docs/tasks/write-tasks/_index.md b/docs/content/en/docs/tasks/write-tasks/_index.md deleted file mode 100644 index 5480c12ce1..0000000000 --- a/docs/content/en/docs/tasks/write-tasks/_index.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: Write Keptn Tasks -description: Learn how to use the Keptn Lifecycle Toolkit and explore basic features. -icon: concepts -layout: quickstart -weight: 20 -hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html ---- - -## Keptn Task Definition - -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. The task definition is a [Deno](https://deno.land/) script. -In the future, we also intend to support other runtimes, especially running a container image directly. - -A task definition can be configured in three different ways: - -- inline -- referring to an HTTP script -- referring to another `KeptnTaskDefinition` - -An inline task definition looks like the following: - -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnTaskDefinition -metadata: - name: deployment-hello -spec: - function: - inline: - code: | - console.log("Deployment Task has been executed"); -``` - -In the code section, it is possible to define a full-fletched Deno script. - -The runtime can also fetch the script on the fly from a remote webserver. For this, the CRD should look like the -following: - -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnTaskDefinition -metadata: - name: hello-keptn-http -spec: - function: - httpRef: - url: -``` - -Finally, `KeptnTaskDefinition` can build on top of other `KeptnTaskDefinition`s. -This is a common use case where a general function can be re-used in multiple places with different parameters. - -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnTaskDefinition -metadata: - name: slack-notification-dev -spec: - function: - functionRef: - name: slack-notification - parameters: - map: - textMessage: "This is my configuration" - secureParameters: - secret: slack-token -``` - -As you might have noticed, Task Definitions also have the possibility to use input parameters. -The Lifecycle Toolkit passes the values defined inside the `map` field as a JSON object. -At the moment, multi-level maps are not supported. -The JSON object can be read through the environment variable `DATA` using `Deno.env.get("DATA");`. -Kubernetes secrets can also be passed to the function using the `secureParameters` field. - -Here, the `secret` value is the name of the K8s secret containing a field with the key `SECURE_DATA`. -The value of that field will then be available to the functions runtime via an environment variable called `SECURE_DATA`. - -For example, if you have a task function that should make use of secret data, you must first ensure that the secret -containing the `SECURE_DATA` key exists, as e.g.: - -```yaml -apiVersion: v1 -kind: Secret -metadata: - name: deno-demo-secret - namespace: default -type: Opaque -data: - SECURE_DATA: YmFyCg== # base64 encoded string, e.g. 'bar' -``` - -Then, you can make use of that secret as follows: - -```yaml -apiVersion: lifecycle.keptn.sh/v1alpha3 -kind: KeptnTaskDefinition -metadata: - name: deployment-hello - namespace: "default" -spec: - function: - secureParameters: - secret: deno-demo-secret - inline: - code: | - console.log("Deployment Hello Task has been executed"); - - let foo = Deno.env.get('SECURE_DATA'); - console.log(foo); - Deno.exit(0); -``` From 8894aca7787de092c0f22af69c29e0bca64e5c30 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Sun, 26 Mar 2023 18:55:34 -0700 Subject: [PATCH 06/33] force rebuild Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index f2a70fa17a..fab8a99065 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -5,7 +5,7 @@ weight: 89 --- A `KeptnTaskDefinition` defines tasks -that can be run by the Keptn Lifecycle Toolkit +that are run by the Keptn Lifecycle Toolkit as part of the pre- and post-deployment phases of a `KeptnApp`. ## Yaml Synopsis From 71b5eeada2d43109166a94bb1c39bd2a81a13c63 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Sun, 26 Mar 2023 19:15:01 -0700 Subject: [PATCH 07/33] update Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/lifecycle/_index.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 docs/content/en/docs/crd-ref/lifecycle/_index.md diff --git a/docs/content/en/docs/crd-ref/lifecycle/_index.md b/docs/content/en/docs/crd-ref/lifecycle/_index.md new file mode 100644 index 0000000000..c0fcb3d795 --- /dev/null +++ b/docs/content/en/docs/crd-ref/lifecycle/_index.md @@ -0,0 +1,4 @@ +--- +title: Lifecycle API +description: Reference information about the Lifecycle API +--- From f2e4b50d890542cdc738ad4b4050229eae42700d Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 00:58:19 -0700 Subject: [PATCH 08/33] Mo comments Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/api-ref/_index.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/content/en/docs/api-ref/_index.md b/docs/content/en/docs/api-ref/_index.md index 02a8de295b..4bda1b6dd5 100644 --- a/docs/content/en/docs/api-ref/_index.md +++ b/docs/content/en/docs/api-ref/_index.md @@ -15,11 +15,8 @@ Information that is published here has been reviewed for technical accuracy but the format and content is still evolving. We welcome your input!** -Each CRD is an object of an API library. -Keptn APIs follow the Kubernetes API versioning scheme. -and are themselves composed of objects and sub-objects. By introducing CRDs, Keptn is extending the base Kubernetes API with new objects and functionality. -Keptn APIs follow API versioning conventions recommended by Kubernetes. +Keptn APIs follow API versioning conventions recommended by Kubernetes and are themselves composed of objects and sub-objects. For more information, see the Kubernetes documentation: From 4ba83f54a85abfe2fdd9ec197e415865fc10591f Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 00:59:06 -0700 Subject: [PATCH 09/33] Mo comments -- description Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/api-ref/lifecycle/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/api-ref/lifecycle/_index.md b/docs/content/en/docs/api-ref/lifecycle/_index.md index c0fcb3d795..1086280488 100644 --- a/docs/content/en/docs/api-ref/lifecycle/_index.md +++ b/docs/content/en/docs/api-ref/lifecycle/_index.md @@ -1,4 +1,4 @@ --- title: Lifecycle API -description: Reference information about the Lifecycle API +description: Reference information about the Lifecycle API group --- From d3e58ce48799b8c9b91821ac02bf02a9ac12266e Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:00:17 -0700 Subject: [PATCH 10/33] Mo CRD -> Resource Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index fab8a99065..9b5bf7f737 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -29,7 +29,7 @@ spec: * **apiVersion** -- API version being used. ` -* **kind** -- CRD type. Must be set to `KeptnTaskDefinition` +* **kind** -- Resource type. Must be set to `KeptnTaskDefinition` * **name** -- Unique name of this task. * Must be an alphanumeric string and, by convention, is all lowercase. From 45be10d97ea7653e054377da7330d23e9bfcedd6 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:02:12 -0700 Subject: [PATCH 11/33] Mo format for code Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index 9b5bf7f737..a676848491 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -50,10 +50,11 @@ spec: that is included in this file. For example: - ```function: - inline: - code: | - console.log("Deployment Task has been executed"); + ```yaml + function: + inline: + code: | + console.log("Deployment Task has been executed"); ``` * **httpRef** - Specify a Deno script to be executed at runtime From 94d01e252ef37458a4b0fa97aa7feb9d2d0f9139 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:02:42 -0700 Subject: [PATCH 12/33] Mo -- show full URL Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index a676848491..d92efcfc0d 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -66,7 +66,7 @@ spec: spec: function: httpRef: - url: + url: "https://www.example.com/yourscript.js" ``` * **functionRef** -- Execute another `KeptnTaskDefinition` that has been defined. From 7f2a18378025a47be00db4bf76932b73c9977208 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:03:33 -0700 Subject: [PATCH 13/33] Mo - KeptnTaskDefinition (singular) Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index d92efcfc0d..ae970124b7 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -84,7 +84,7 @@ spec: ``` This can also be used to group a set of tasks - into a single `KeptnTaskDefinitions`, + into a single `KeptnTaskDefinition`, such as defining a `KeptnTaskDefinition` for testing. In this case, it other, existing `KeptnTaskDefinition`s for each type of test to be run, From 9c3ff2ec4e0203f8c7a83ebb26bb6d2d543bab7b Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:04:56 -0700 Subject: [PATCH 14/33] Mo - fix code formatting Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index ae970124b7..2c05fee6fb 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -95,11 +95,11 @@ spec: as a JSON object. For example: - ```spec: - parameters: - map: - textMessage: "This is my configuration" - ``` + ```yaml + spec: + parameters: + map: + textMessage: "This is my configuration" The JSON object can be read through the `DATA` environment variable using `Deno.env.get("DATA");`. From bcceba798a4a0d4492f30d3b1b78401aef077fcd Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:05:21 -0700 Subject: [PATCH 15/33] Mo fix code formatting Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index 2c05fee6fb..5e551ac0dc 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -118,9 +118,8 @@ spec: For example: ```yaml - secureParameters: - secret: slack-token - ``` + secureParameters: + secret: slack-token See [Create secret text](#create-secret-text) for details. From cc81eda4df837eccadcb826f99924c0632921448 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:06:23 -0700 Subject: [PATCH 16/33] Mo use latest API version Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index 5e551ac0dc..d036dff906 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -154,7 +154,7 @@ if (contextdata.objectType == "Workload") { ```yaml # kubectl create secret generic my-secret --from-literal=SECURE_DATA=foo -apiVersion: lifecycle.keptn.sh/v1alpha1 +apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnTaskDefinition metadata: name: dummy-task From ae06ae0e93aa097e2755f7dba5204549836a24aa Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:06:52 -0700 Subject: [PATCH 17/33] Mo -- latest API version Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index d036dff906..92caefe41d 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -176,7 +176,7 @@ by creating a Kubernetes secret with a JSON string: # kubectl create secret generic my-secret \ # --from-literal=SECURE_DATA="{\"foo\": \"bar\", \"foo2\": \"bar2\"}" -apiVersion: lifecycle.keptn.sh/v1alpha1 +apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnTaskDefinition metadata: name: dummy-task From 3b108dbc4b7bb0baad89ec37e937eba1cc5c4f10 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:07:42 -0700 Subject: [PATCH 18/33] full-fletched -> full-fledged Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index 92caefe41d..ee86a9c81e 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -195,7 +195,7 @@ spec: ## Examples -**Example 1** defines a full-fletched Deno script +**Example 1** defines a full-fledged Deno script within the `KeptnTaskDefinition` YAML file: ```yaml From 5203666e8452cda3bdce93037d3c2c573d9ed72c Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:08:07 -0700 Subject: [PATCH 19/33] Use v1alpha3 Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index ee86a9c81e..e77f545ce5 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -199,7 +199,7 @@ spec: within the `KeptnTaskDefinition` YAML file: ```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 +apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnTaskDefinition metadata: name: hello-keptn-inline From 48b2e44daf27a0a63e67fd12f524b486f8a1aff9 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:08:44 -0700 Subject: [PATCH 20/33] v1alpha3 Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index e77f545ce5..682e8053d3 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -219,7 +219,7 @@ spec: **Example 2** fetches the Deno script from a remote webserver at runtime: ```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 +apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnTaskDefinition metadata: name: hello-keptn-http From 83171e7fa2662145b80106ea04fba8ec81f5748b Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:09:16 -0700 Subject: [PATCH 21/33] remove extraneous . Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index 682e8053d3..f93a597f90 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -230,7 +230,7 @@ spec: ``` See the -[sample-app/version-1](https://github.com/keptn-sandbox/lifecycle-toolkit-examples/blob/main/sample-app/version-1/app-pre-deploy.yaml). +[sample-app/version-1](https://github.com/keptn-sandbox/lifecycle-toolkit-examples/blob/main/sample-app/version-1/app-pre-deploy.yaml) PodtatoHead example for a more complete example. **Example 3** calls another defined task, From fbdfa721c639ae2738931ff41d7a9296a7322844 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:10:05 -0700 Subject: [PATCH 22/33] v1alpha3 Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index f93a597f90..90ee81ba2c 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -240,7 +240,7 @@ In this case, it calls `slack-notification-dev`, passing `parameters` and `secureParameters` to that other task: ```yaml -apiVersion: lifecycle.keptn.sh/v1alpha2 +apiVersion: lifecycle.keptn.sh/v1alpha3 kind: KeptnTaskDefinition metadata: name: slack-notification-dev From 47ad95b51f093b8f08505d5d7fd96a4b70fcf623 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:11:17 -0700 Subject: [PATCH 23/33] YAML files that create... Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/_index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/_index.md b/docs/content/en/docs/crd-ref/_index.md index f6f12c2328..8ec9e33c69 100644 --- a/docs/content/en/docs/crd-ref/_index.md +++ b/docs/content/en/docs/crd-ref/_index.md @@ -6,7 +6,6 @@ hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.htm --- This section provides comprehensive reference information about the -YAML files that create the [Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) that are defined for the Keptn Lifecycle Toolkit. From f79b16a8b10f2fa98b0581ff3eb6beef2f6b06c3 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:11:58 -0700 Subject: [PATCH 24/33] Mo rewording of CRD explanation Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/_index.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/content/en/docs/crd-ref/_index.md b/docs/content/en/docs/crd-ref/_index.md index 8ec9e33c69..d28ac526ab 100644 --- a/docs/content/en/docs/crd-ref/_index.md +++ b/docs/content/en/docs/crd-ref/_index.md @@ -16,10 +16,9 @@ but the format and content is still evolving. We welcome your input!** Each CRD is an object of an -[API library](../../docs/api-ref/) -Keptn APIs follow the Kubernetes API versioning scheme. -and are themselves composed of objects and sub-objects. +[API group](../../docs/api-ref/). By introducing CRDs, Keptn is extending the base Kubernetes API with new objects and functionality. +Keptn APIs follow API versioning conventions recommended by Kubernetes and are themselves composed of objects and sub-objects. Keptn APIs follow API versioning conventions recommended by Kubernetes. For more information, see the Kubernetes documentation: From c09b38028e0df6c547a42643cc5cdfef9f490c1b Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 01:19:48 -0700 Subject: [PATCH 25/33] remove promise of alternatives to Deno scripts Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index fab8a99065..3fb8ab6ac0 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -40,8 +40,6 @@ spec: expressed as a [Deno](https://deno.land/) script. Refer to [function runtime](https://github.com/keptn/lifecycle-toolkit/tree/main/functions-runtime) for more information about the runtime. - In the future, we intend to support additional runtimes, - especially running a container image directly. The `function` can be defined as one of the following: From 570dc7aebca108265b6c7913cb74edf380644b13 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Mon, 27 Mar 2023 18:25:41 -0700 Subject: [PATCH 26/33] add link to config/samples directory Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 8 ++++++++ docs/content/en/docs/crd-ref/crd-template | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index e668240301..1aac772d12 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -253,6 +253,14 @@ spec: secret: slack-token ``` +**More examples** + +* See the [operator/config/samples](https://github.com/keptn/lifecycle-toolkit/tree/main/operator/config/samples) +directory for more example `KeptnTaskDefinition` YAML files. +Separate examples are provided for each library version. +For example, the `lifecycle_v1alpha3_keptntaskdefinition` file +contains examples for the `v1alpha3` library. + ## Files API Reference: diff --git a/docs/content/en/docs/crd-ref/crd-template b/docs/content/en/docs/crd-ref/crd-template index a4ec20f70a..157d0c9e31 100644 --- a/docs/content/en/docs/crd-ref/crd-template +++ b/docs/content/en/docs/crd-ref/crd-template @@ -25,6 +25,14 @@ Copy this template to create a new CRD reference page. ## Examples +**Example 1** + +* See the [operator/config/samples](https://github.com/keptn/lifecycle-toolkit/tree/main/operator/config/samples) +directory for more example `CRD` YAML files. +Separate examples are provided for each library version. +For example, the `lifecycle_v1alpha3_crd` file +contains examples for the `v1alpha3` library. + ## Files ## Differences between versions From 0333070cf5bf974115a7be7091dfe3369197a343 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 28 Mar 2023 02:04:15 -0700 Subject: [PATCH 27/33] library -> API Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index 1aac772d12..5396e74997 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -257,7 +257,7 @@ spec: * See the [operator/config/samples](https://github.com/keptn/lifecycle-toolkit/tree/main/operator/config/samples) directory for more example `KeptnTaskDefinition` YAML files. -Separate examples are provided for each library version. +Separate examples are provided for each API version. For example, the `lifecycle_v1alpha3_keptntaskdefinition` file contains examples for the `v1alpha3` library. From 507c89f2c723b6487f94a2c960d15bbf93b74a46 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 28 Mar 2023 02:04:54 -0700 Subject: [PATCH 28/33] library -> version of lifecycle API group Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index 5396e74997..588eac34db 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -259,7 +259,7 @@ spec: directory for more example `KeptnTaskDefinition` YAML files. Separate examples are provided for each API version. For example, the `lifecycle_v1alpha3_keptntaskdefinition` file -contains examples for the `v1alpha3` library. +contains examples for the `v1alpha3` version of the lifecycle API group. ## Files From 60d67f93954c052af44b509b30ff06c01b96ef86 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Tue, 28 Mar 2023 23:48:47 -0700 Subject: [PATCH 29/33] removed link to examples directory until we sort that out Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 8 -------- docs/content/en/docs/crd-ref/crd-template | 6 ------ 2 files changed, 14 deletions(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index 1aac772d12..e668240301 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -253,14 +253,6 @@ spec: secret: slack-token ``` -**More examples** - -* See the [operator/config/samples](https://github.com/keptn/lifecycle-toolkit/tree/main/operator/config/samples) -directory for more example `KeptnTaskDefinition` YAML files. -Separate examples are provided for each library version. -For example, the `lifecycle_v1alpha3_keptntaskdefinition` file -contains examples for the `v1alpha3` library. - ## Files API Reference: diff --git a/docs/content/en/docs/crd-ref/crd-template b/docs/content/en/docs/crd-ref/crd-template index 157d0c9e31..cc2f96dbfa 100644 --- a/docs/content/en/docs/crd-ref/crd-template +++ b/docs/content/en/docs/crd-ref/crd-template @@ -27,12 +27,6 @@ Copy this template to create a new CRD reference page. **Example 1** -* See the [operator/config/samples](https://github.com/keptn/lifecycle-toolkit/tree/main/operator/config/samples) -directory for more example `CRD` YAML files. -Separate examples are provided for each library version. -For example, the `lifecycle_v1alpha3_crd` file -contains examples for the `v1alpha3` library. - ## Files ## Differences between versions From 5f77bf609f8cbcb394c3742b41c85b6efd385001 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 29 Mar 2023 01:47:32 -0700 Subject: [PATCH 30/33] crd-ref -> api-ref for autogenerated ref pages Signed-off-by: Meg McRoberts --- .github/scripts/generate-crd-docs/generate-crd-docs.sh | 10 +++++----- .github/workflows/markdown-checks.yaml | 6 +++--- docs/.htmltest.yml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/scripts/generate-crd-docs/generate-crd-docs.sh b/.github/scripts/generate-crd-docs/generate-crd-docs.sh index 6efa5f1926..44bc42561b 100755 --- a/.github/scripts/generate-crd-docs/generate-crd-docs.sh +++ b/.github/scripts/generate-crd-docs/generate-crd-docs.sh @@ -7,7 +7,7 @@ # # Inputs: None -# renovate: datasource=github-releases depName=elastic/crd-ref-docs +# renovate: datasource=github-releases depName=elastic/api-ref-docs GENERATOR_VERSION=master API_DOMAIN="keptn.sh" API_ROOT='operator/apis/' @@ -16,13 +16,13 @@ RENDERER='markdown' RENDERER_CONFIG_FILE='.github/scripts/generate-crd-docs/crd-docs-generator-config.yaml' echo "Checking if code generator tool is installed..." -test -s crd-ref-docs || go install github.com/elastic/crd-ref-docs@${GENERATOR_VERSION} +test -s api-ref-docs || go install github.com/elastic/api-ref-docs@${GENERATOR_VERSION} echo "Running CRD docs auto-generator..." for api_group in "$API_ROOT"*; do sanitized_api_group="${api_group#$API_ROOT}" - INDEX_PATH="./docs/content/en/docs/crd-ref/$sanitized_api_group/_index.md" + INDEX_PATH="./docs/content/en/docs/api-ref/$sanitized_api_group/_index.md" if [ ! -f "$INDEX_PATH" ]; then echo "API group index file doesn't exist for group $sanitized_api_group. Creating it now..." @@ -36,7 +36,7 @@ for api_group in "$API_ROOT"*; do for api_version in "$api_group"/*; do sanitized_api_version="${api_version#$API_ROOT$sanitized_api_group/}" - OUTPUT_PATH="./docs/content/en/docs/crd-ref/$sanitized_api_group/$sanitized_api_version" + OUTPUT_PATH="./docs/content/en/docs/api-ref/$sanitized_api_group/$sanitized_api_version" echo "Arguments:" echo "TEMPLATE_DIR: $TEMPLATE_DIR" @@ -51,7 +51,7 @@ for api_group in "$API_ROOT"*; do mkdir -p "$OUTPUT_PATH" echo "Generating CRD docs for $sanitized_api_group.$API_DOMAIN/$sanitized_api_version..." - crd-ref-docs \ + api-ref-docs \ --templates-dir "$TEMPLATE_DIR" \ --source-path="./$api_version" \ --renderer="$RENDERER" \ diff --git a/.github/workflows/markdown-checks.yaml b/.github/workflows/markdown-checks.yaml index f86f1134a8..4b669b9174 100644 --- a/.github/workflows/markdown-checks.yaml +++ b/.github/workflows/markdown-checks.yaml @@ -73,18 +73,18 @@ jobs: - name: Copy old docs run: | - cp -R ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old + cp -R ./docs/content/en/docs/api-ref ./docs/content/en/docs/api-ref-old - name: Run docs generator run: ./.github/scripts/generate-crd-docs/generate-crd-docs.sh - name: Check if docs are up to date run: | - if ! diff -rq ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old &>/dev/null; then + if ! diff -rq ./docs/content/en/docs/api-ref ./docs/content/en/docs/api-ref-old &>/dev/null; then echo "The CRD docs have changes that are not reflected in the docs pages. Please use ./.github/scripts/generate-crd-docs/generate-crd-docs.sh to re-generate the docs." echo "" echo "=========== Diff ===========" - diff -ru ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old + diff -ru ./docs/content/en/docs/api-ref ./docs/content/en/docs/api-ref-old exit 1 else echo "" diff --git a/docs/.htmltest.yml b/docs/.htmltest.yml index 9f9ba77c85..a40d1e61fe 100644 --- a/docs/.htmltest.yml +++ b/docs/.htmltest.yml @@ -2,7 +2,7 @@ CheckDoctype: false IgnoreDirs: - favicons - - docs/crd-ref/lifecycle/ + - docs/api-ref/lifecycle/ IgnoreURLs: - "linkedin.com" - "localhost" From ee060e2a653e8730919248d3fcc93e3bb92b169c Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 29 Mar 2023 02:06:16 -0700 Subject: [PATCH 31/33] modify scripts to generate API docs Signed-off-by: Meg McRoberts --- .github/scripts/generate-crd-docs/generate-crd-docs.sh | 6 +++--- docs/content/en/docs/crd-ref/lifecycle/_index.md | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 docs/content/en/docs/crd-ref/lifecycle/_index.md diff --git a/.github/scripts/generate-crd-docs/generate-crd-docs.sh b/.github/scripts/generate-crd-docs/generate-crd-docs.sh index 44bc42561b..d9a830ec95 100755 --- a/.github/scripts/generate-crd-docs/generate-crd-docs.sh +++ b/.github/scripts/generate-crd-docs/generate-crd-docs.sh @@ -1,6 +1,6 @@ #!/bin/bash -# CRD docs auto generation script +# API docs auto generation script # # This script goes through all API definitions in the operator/apis folder # and generates docs from code for each API group and version @@ -18,7 +18,7 @@ RENDERER_CONFIG_FILE='.github/scripts/generate-crd-docs/crd-docs-generator-confi echo "Checking if code generator tool is installed..." test -s api-ref-docs || go install github.com/elastic/api-ref-docs@${GENERATOR_VERSION} -echo "Running CRD docs auto-generator..." +echo "Running API docs auto-generator..." for api_group in "$API_ROOT"*; do sanitized_api_group="${api_group#$API_ROOT}" @@ -50,7 +50,7 @@ for api_group in "$API_ROOT"*; do echo "Creating docs folder $OUTPUT_PATH..." mkdir -p "$OUTPUT_PATH" - echo "Generating CRD docs for $sanitized_api_group.$API_DOMAIN/$sanitized_api_version..." + echo "Generating API docs for $sanitized_api_group.$API_DOMAIN/$sanitized_api_version..." api-ref-docs \ --templates-dir "$TEMPLATE_DIR" \ --source-path="./$api_version" \ diff --git a/docs/content/en/docs/crd-ref/lifecycle/_index.md b/docs/content/en/docs/crd-ref/lifecycle/_index.md deleted file mode 100644 index c0fcb3d795..0000000000 --- a/docs/content/en/docs/crd-ref/lifecycle/_index.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Lifecycle API -description: Reference information about the Lifecycle API ---- From 3ee14f63c91e9f2f570cf78d2fb6919578c54f66 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Wed, 29 Mar 2023 02:33:14 -0700 Subject: [PATCH 32/33] tried to fix autogenerate script Signed-off-by: Meg McRoberts --- .github/scripts/generate-crd-docs/generate-crd-docs.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/generate-crd-docs/generate-crd-docs.sh b/.github/scripts/generate-crd-docs/generate-crd-docs.sh index d9a830ec95..a893df2b1a 100755 --- a/.github/scripts/generate-crd-docs/generate-crd-docs.sh +++ b/.github/scripts/generate-crd-docs/generate-crd-docs.sh @@ -7,7 +7,7 @@ # # Inputs: None -# renovate: datasource=github-releases depName=elastic/api-ref-docs +# renovate: datasource=github-releases depName=elastic/crd-ref-docs GENERATOR_VERSION=master API_DOMAIN="keptn.sh" API_ROOT='operator/apis/' @@ -16,7 +16,7 @@ RENDERER='markdown' RENDERER_CONFIG_FILE='.github/scripts/generate-crd-docs/crd-docs-generator-config.yaml' echo "Checking if code generator tool is installed..." -test -s api-ref-docs || go install github.com/elastic/api-ref-docs@${GENERATOR_VERSION} +test -s crd-ref-docs || go install github.com/elastic/crd-ref-docs@${GENERATOR_VERSION} echo "Running API docs auto-generator..." @@ -51,7 +51,7 @@ for api_group in "$API_ROOT"*; do mkdir -p "$OUTPUT_PATH" echo "Generating API docs for $sanitized_api_group.$API_DOMAIN/$sanitized_api_version..." - api-ref-docs \ + crd-ref-docs \ --templates-dir "$TEMPLATE_DIR" \ --source-path="./$api_version" \ --renderer="$RENDERER" \ From 5b91097b2033a9e3c9fceefbbcca62544f9ab209 Mon Sep 17 00:00:00 2001 From: Meg McRoberts Date: Thu, 30 Mar 2023 02:01:17 -0700 Subject: [PATCH 33/33] no colon after inline Signed-off-by: Meg McRoberts meg.mcroberts@dynatrace.com Co-authored-by: Moritz Wiesinger Signed-off-by: Meg McRoberts --- docs/content/en/docs/crd-ref/TaskDefinition/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/en/docs/crd-ref/TaskDefinition/index.md b/docs/content/en/docs/crd-ref/TaskDefinition/index.md index e668240301..597c41da64 100644 --- a/docs/content/en/docs/crd-ref/TaskDefinition/index.md +++ b/docs/content/en/docs/crd-ref/TaskDefinition/index.md @@ -17,7 +17,7 @@ metadata: name: spec: function: - inline: | httpRef | functionRef + inline | httpRef | functionRef: [parameters: map: textMessage: "This is my configuration"]