This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(STONEINTG-892): add proc to create override snapshot
* add procedure to create override snapshot Signed-off-by: Hongwei Liu <[email protected]>
- Loading branch information
1 parent
ec0e3f3
commit bb0d988
Showing
3 changed files
with
74 additions
and
1 deletion.
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
70 changes: 70 additions & 0 deletions
70
...T/pages/how-to-guides/testing_applications/proc_creating_override_snapshot.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,70 @@ | ||
= Creating an override snapshot | ||
|
||
In {ProductName}, integration service provides the users with the ability to reset their component's Global Candidate List to a desired state with a manually created `override` snapshot which can then be a candidate for further promotion (release) if it passes all integration tests subsequently. | ||
|
||
== Prerequisites | ||
- You have CLI access to the specific OpenShift cluster. For information on obtaining CLI access, refer to xref:../../getting-started/getting_started_in_cli.adoc[Getting started in CLI] | ||
- You have an up-to-date kubectl binary. Alternatively, the `oc` binary is also compatible. | ||
- 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 an `override` snapshot, complete the following steps: | ||
|
||
. Identify the application and component that needs to be updated | ||
. In your preferred IDE, create an `override` snapshot in a `.yaml` file. | ||
+ | ||
Example snapshot.yaml file:: | ||
|
||
+ | ||
[source] | ||
---- | ||
apiVersion: appstudio.redhat.com/v1alpha1 | ||
kind: Snapshot | ||
metadata: | ||
name: snapshot-sample | ||
namespace: ws-sample-tenant | ||
labels: | ||
test.appstudio.openshift.io/type: override <1> | ||
spec: | ||
application: application-sample | ||
components: | ||
- name: component-sample <2> | ||
containerImage: quay.io/redhat-user-workloads/ws-sample-tenant/application-sample/component-sample@sha256:0db0a473a6abf5c15c424ab07cfbd5c40c06622fe648d4fe6a6b6abc224a0d0c <3> | ||
---- | ||
<1> The label `test.appstudio.openshift.io/type: override` that indicates this is an `override` snapshot. | ||
<2> The component name you will reset its Global Candidate List. | ||
<3> The container image with valid digest you will reset the component <2> to. | ||
|
||
|
||
. Save the .yaml file and add the snapshot.yaml by running the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc create -f snapshot.yaml -n ws-sample-tenant | ||
---- | ||
This command adds the `override` snapshot to your workspace and Integration service will processe the `override` snapshot and update the component `component-sample`'s `.Spec.ContainerImage` to `quay.io/redhat-user-workloads/ws-sample-tenant/application-sample/component-sample@sha256:0db0a473a6abf5c15c424ab07cfbd5c40c06622fe648d4fe6a6b6abc224a0d0c` | ||
|
||
== Verification | ||
After integration service processes the created `override` snapshot, you may verify snapshot and component by the following steps: | ||
|
||
. Check snapshot `.Status.Conditions` by the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc get snapshot snapshot-sample -n ws-sample-tenant -o yaml | yq '.status.conditions.[] | select(.type =="AddedToGlobalCandidateList")' | ||
lastTransitionTime: "2024-06-05T18:20:37Z" | ||
message: The Snapshot's component was added to the global candidate list | ||
reason: Added | ||
status: "True" | ||
type: AddedToGlobalCandidateList | ||
---- | ||
|
||
. Browse to the component you are updating and select the **Component details** tab. The updated container image is shown under **Image** column. | ||
|
||
. Check component `.Spec.ContainerImage` by the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc get component component-sample -n ws-sample-tenant -o yaml | yq .spec.containerImage | ||
quay.io/redhat-user-workloads/ws-sample-tenant/application-sample/component-sample@sha256:0db0a473a6abf5c15c424ab07cfbd5c40c06622fe648d4fe6a6b6abc224a0d0c | ||
---- |