-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
starting a developer readme and adding a seed data file for testing (#…
…107) * starting a developer readme and adding a seed data file for testing Signed-off-by: Adam D. Cornett <adc@redhat.com> * adding in updateStatusCondition for optional resources Signed-off-by: Adam D. Cornett <adc@redhat.com>
- Loading branch information
1 parent
8e32d15
commit 9e342e0
Showing
2 changed files
with
79 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Developer Documentation | ||
|
||
## Requirements | ||
|
||
Development and testing the operator requires that you have the following tools installed, | ||
functional, and in your path. | ||
|
||
| Name | Tool cli | Minimum version | | ||
|----------------- |:-----------------:| ---------------:| | ||
| OperatorSDK | `operator-sdk` | v1.15.0 | | ||
| OpenShift Client | `oc` | v4.7.13 | | ||
|
||
|
||
### Prerequisite - Install OpenShift Pipelines Operator | ||
This operator has the OpenShift Pipelines Operator as a dependency, which OLM manages when installing via a catalog. However, | ||
for local development, this dependency must be installed before *Testing Locally* can occur. | ||
* Log into your cluster's OpenShift Console with cluster admin privileges | ||
* Use the left-hand menu to navigate to *Operators* | ||
* In the *Operators* submenu click on *OperatorHub* | ||
* Use the Filter/Search box to filter on *OpenShift Pipelines* | ||
* Click the *Red Hat OpenShift Pipelines* tile | ||
* In the flyout menu to the right click the *Install* button near the top | ||
* On the next screen "Install Operator" scroll to the bottom of the page and click *Install* | ||
|
||
|
||
## Testing Locally | ||
1. Have a cluster up and running | ||
2. Run `make install` to install `CRD's` | ||
3. Run `make run` to start the operator | ||
1. Or start the operator in your preferred manner | ||
4. Run `./docs/dev/seed.sh` to see all the configs/secrets in the cluster | ||
1. Depending on what reconciler you are working on feel free to comment out anything in the file not related |
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,47 @@ | ||
echo switching to openshift-operators namespace | ||
oc project openshift-operators | ||
|
||
echo exporting kubeconfig | ||
export KUBECONFIG=~/.kube/config | ||
|
||
echo creating kube secret in cluster | ||
oc create secret generic kubeconfig --from-file=kubeconfig=$KUBECONFIG | ||
|
||
echo creating github secret in cluster | ||
oc create secret generic github-api-token --from-literal GITHUB_TOKEN=123456789 | ||
|
||
#echo creating pyxis api key secret in cluster | ||
oc create secret generic pyxis-api-secret --from-literal pyxis_api_key=8675309 | ||
|
||
echo creating github ssh credentials secret in cluster | ||
oc apply -f - <<'EOF' | ||
kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: github-ssh-credentials | ||
data: | ||
id_rsa: | | ||
MTIzNDU2Nzg5 | ||
EOF | ||
|
||
echo creating docker-registry secret in cluster | ||
oc create secret docker-registry registry-dockerconfig-secret \ | ||
--docker-server=quay.io \ | ||
--docker-username=test \ | ||
--docker-password=123456 \ | ||
--docker-email=test@test.net | ||
|
||
echo creating OperatorPipeline | ||
oc apply -f - <<'EOF' | ||
apiVersion: certification.redhat.com/v1alpha1 | ||
kind: OperatorPipeline | ||
metadata: | ||
name: operatorpipeline-sample | ||
spec: | ||
operatorPipelinesRelease: main | ||
kubeconfigSecretName: "kubeconfig" | ||
gitHubSecretName: "github-api-token" | ||
pyxisSecretName: "pyxis-api-secret" | ||
dockerRegistrySecretName: "registry-dockerconfig-secret" | ||
githubSSHSecretName: "github-ssh-credentials" | ||
EOF |