Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Putting examples in boxes, adding missing verification steps #1937

Merged
merged 12 commits into from
Apr 8, 2021
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="allowing-users-to-define-workspace-deployment-labels-and-annotations_{context}"]
= Allowing users to define workspace deployment labels and annotations
Expand All @@ -9,14 +9,17 @@ This section describes how to customize workspace deployment labels and annotati


.Prerequisites

* A running instance of {prod}. To install an instance of {prod}, see xref:installation-guide:installing-che.adoc[].
* A publicly accessible standalone `devfile.yaml` file. See xref:configuring-a-workspace-using-a-devfile.adoc[] for detailed information about creating and using devfiles.

.Procedure

. Open the workspace by navigating to the following URL: `pass:c,a,q[{prod-url}/f?url=https://__<hostURL>__/devfile.yaml&workspaceDeploymentLabels=__<url_encoded_comma_separated_key_values>__&workspaceDeploymentAnnotations=__<url_encoded_comma_separated_key_values override>__]`

.Example of overriding the `deployment labels`
.Example of overriding the `deployment labels`

====
Consider the following labels to add:

[subs="+quotes"]
Expand All @@ -37,7 +40,6 @@ The resulting workspace has the following deployment labels:

[subs="+quotes"]
----
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -57,9 +59,11 @@ metadata:
spec:
...
----
====

.Example of overriding the `deployment annotations`

====
Consider the following annotations to add:

[subs="+quotes"]
Expand All @@ -81,7 +85,6 @@ The resulting workspace has the following deployment annotations:

[subs="+quotes"]
----
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -100,3 +103,53 @@ metadata:
resourceVersion: "213191"
...
----
====

.Verification steps

To display the deployment labels and annotations:

. Get the name of the user's namespace:

pass:[<!-- vale Vale.Terms = NO -->]

.. Using {prod-short} Dashboard, move to the *Workspaces* tab and read the name of the {orch-name} Namespace field.

pass:[<!-- vale Vale.Terms = YES -->]

. Log in to the cluster:

.. Retrieve the {prod-short} cluster URL from the `checluster` CR (Custom Resource), run:
+
[options="nowrap",role=white-space-pre]
----
$ oc get checluster --output jsonpath='{.items[0].status.cheURL}'
----

.. Log in:
+
[subs="+attributes,+quotes"]
----
$ oc login -u _<username>_ -p _<password>_ _<cluster_URL>_
----

pass:[<!-- vale Vale.Terms = NO -->]

. Display the deployment labels and annotations for all deployments in the namespace using the {orch-name} Namespace name from the first step:
+
[subs="+attributes,+quotes"]
----
$ oc get deployment -n __<NAMESPACE>__ -o=custom-columns="NAMESPACE:.metadata.namespace,NAME:.metadata.name,LABELS:.metadata.labels,ANNOTATIONS:.metadata.annotations"
----


////
. To display the deployment labels and annotations for a specific deploymen:
+
[subs="+attributes,+quotes"]
----
$ oc get deployment/__<deployment-name>__ -n __<NAMESPACE>__ -o=custom-columns="NAMESPACE:.metadata.namespace,NAME:.metadata.name,LABELS:.metadata.labels,ANNOTATIONS:.metadata.annotations"
----
////

pass:[<!-- vale Vale.Terms = YES -->]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="creating-a-workspace-from-a-feature-branch-of-a-git-repository_{context}"]
= Creating a workspace from a feature branch of a Git repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="creating-a-workspace-from-the-default-branch-of-a-git-repository_{context}"]
= Creating a workspace from the default branch of a Git repository

This section describes how to start a {prod-short} workspace using a factory URL. The factory URL is a link pointing {prod-short} to a Git source repository containing a devfile.

The factory URL exist in two forms:

* the short form `/#$URL`
* long `/f?url=$URL` form that supports additional configuration parameters used in previous versions of {prod-short}

.Prerequisites

* A running instance of {prod}. See xref:installation-guide:installing-che.adoc[].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="creating-a-workspace-from-a-publicly-accessible-standalone-devfile-using-http_{context}"]
= Creating a workspace from a publicly accessible standalone devfile using HTTP
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Module included in the following assemblies:
//
// configuring-a-workspace-using-a-devfile
// creating-a-workspace-from-a-remote-devfile

[id="overriding-devfile-values-using-factory-parameters_{context}"]
= Overriding devfile values using factory parameters
Expand All @@ -13,19 +13,21 @@ Values in the following sections of a remote devfile can be overridden using spe
* `attributes`

.Prerequisites

* A running instance of {prod}. To install an instance of {prod}, see xref:installation-guide:installing-che.adoc[].
* A publicly accessible standalone `devfile.yaml` file. See xref:configuring-a-workspace-using-a-devfile.adoc[] for detailed information about creating and using devfiles.

.Procedure

. Open the workspace by navigating to the following URL: `pass:c,a,q[{prod-url}/f?url=https://__<hostURL>__/devfile.yaml&override.__<parameter.path>__=__<value>__]`

.Example of overriding the `generateName` property

====
Consider the following initial devfile:

[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: golang-
Expand All @@ -44,21 +46,21 @@ The resulting workspace has the following devfile model:

[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: myprefix
projects:
...
----
====

.Example of overriding project source branch property

====
Consider the following initial devfile:

[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: java-mysql-
Expand Down Expand Up @@ -92,16 +94,16 @@ projects:
branch: 1.0.x
...
----

====


.Example of overriding or creating an attribute value

====
Consider the following initial devfile:

[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: golang-
Expand Down Expand Up @@ -144,7 +146,6 @@ The resulting workspace has the following devfile model:

[subs="+quotes"]
----
---
apiVersion: 1.0.0
metadata:
generateName: golang-
Expand All @@ -153,3 +154,8 @@ attributes:
projects:
...
----
====

.Verification steps

. Using {prod-short} Dashboard, move to the *Devfile* tab of the newly created workspace and check its content.