-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc(KONFLUX-5695): explain Snapshots and their usage
* Added Working with Snapshots page which explains the meaning/usage of snapshot and each field * Grouped Snapshot-related pages in a separate subdirectory in the integration testing page Signed-off-by: dirgim <[email protected]> rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED
- Loading branch information
Showing
6 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...es/ROOT/pages/how-tos/testing/integration/snapshots/working-with-snapshots.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
= Working with Snapshots | ||
|
||
In {ProductName}, the central resource which is created, tested and released as a single unit is called the Snapshot. | ||
|
||
== What is a Snapshot? | ||
The Snapshot is a custom resource that contains the list of all Components of an {ProductName} Application with their Component Image digests and their sources. Once created, the list of Components with their images is immutable. The Integration service updates the status of the resource to reflect the testing outcome. The Release service releases the contents of the Snapshot via Release pipelines. | ||
|
||
Example Snapshot resource contents:: | ||
[source] | ||
---- | ||
apiVersion: appstudio.redhat.com/v1alpha1 | ||
kind: Snapshot | ||
metadata: | ||
name: snapshot-sample <.> | ||
namespace: ws-sample-tenant <.> | ||
spec: | ||
application: application-sample <.> | ||
components: | ||
- name: component-sample <.> | ||
containerImage: quay.io/redhat-user-workloads/ws-sample-tenant/application-sample/component-sample@sha256:0db0a473a6abf5c15c424ab07cfbd5c40c06622fe648d4fe6a6b6abc224a0d0c <.> | ||
source: <.> | ||
git: | ||
url: https://github.com/sample-org/sample-repo | ||
revision: fa8b89274a61ef0f1c257b7a84c37aa2ec844109 | ||
---- | ||
<.> The name of the Snapshot resource. | ||
<.> The namespace where the Snapshot exists. It should correspond to the user's tenant namespace. | ||
<.> The Application that the Snapshot belongs to. | ||
<.> The name of the individual Component of the Application. | ||
<.> The full image pull specification for the container image. The images need to be referenced by digest. | ||
<.> The component source containing the git URL and revision that the component's container image was built from. | ||
|
||
== Working with manual Snapshots | ||
|
||
Aside from the Snapshots which are created and processed automatically by the {ProductName} services, it is also possible to create manual Snapshots which can then be tested and released if they conform to the users requirements. | ||
|
||
== Prerequisites | ||
- You have completed the steps listed in the xref:/getting-started/cli.adoc[Getting started in the CLI] page. | ||
- You have an existing managed workspace such as `ws-sample`, an application such as `application-sample` and a component such as `component-sample`. | ||
|
||
== Procedures | ||
To create a manual snapshot, complete the following steps: | ||
|
||
. Identify the application and component images which you want tested and released. | ||
. In your preferred IDE, create a snapshot definition in a `.yaml` file. | ||
.. For example contents, see the example Snapshot section above. | ||
. Save the .yaml file and add the snapshot.yaml by running the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ kubectl create -f snapshot.yaml -n ws-sample-tenant | ||
---- | ||
This command adds the Snapshot to your workspace and integration service will test and potentially trigger a release of the Snapshot. | ||
|
||
== Verification | ||
After integration service processes the created manual snapshot, you may verify snapshot and component by the following steps: | ||
|
||
. Check if Snapshot passed all tests by getting the `.Status.Conditions.AppStudioTestSucceeded` condition with the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ kubectl get snapshot snapshot-sample -n ws-sample-tenant -o yaml | yq '.status.conditions.[] | select(.type =="AppStudioTestSucceeded")' | ||
lastTransitionTime: "2025-01-21T09:18:00Z" | ||
message: All Integration Pipeline tests passed | ||
reason: Passed | ||
status: "True" | ||
type: AppStudioTestSucceeded | ||
---- | ||
. If you have xref:/advanced-how-tos/releasing/create-release-plan.adoc[automatic Releases defined], you can check if Snapshot was auto-released getting the `.Status.Conditions.AutoReleased` condition with the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ kubectl get snapshot snapshot-sample -n ws-sample-tenant -o yaml | yq '.status.conditions.[] | select(.type =="AutoReleased")' | ||
lastTransitionTime: "2025-01-21T09:18:01Z" | ||
message: The Snapshot was auto-released | ||
reason: AutoReleased | ||
status: "True" | ||
type: AutoReleased | ||
---- |