|
| 1 | +# Development Workflow |
| 2 | + |
| 3 | +## Get the code |
| 4 | + |
| 5 | +``` |
| 6 | + $ git clone https://github.com/openshift/openshift-sdn.git |
| 7 | + $ git clone https://github.com/openshift/cluster-network-operator.git |
| 8 | +``` |
| 9 | + |
| 10 | +## Do your changes |
| 11 | + |
| 12 | +## Create the image |
| 13 | + |
| 14 | +``` |
| 15 | + $ make build-image-sdn-test |
| 16 | +``` |
| 17 | + |
| 18 | +This will call podman under the hood and it'll create an image with your |
| 19 | +changes for openshift/sdn |
| 20 | + |
| 21 | +## Push your image to quay.io |
| 22 | + |
| 23 | +``` |
| 24 | + $ podman push sdn-test quay.io/<your_quay_user>/sdn-test:latest |
| 25 | + Getting image source signatures |
| 26 | + Copying blob 5d372c8d2def done |
| 27 | + Copying blob f8c626b0e778 done |
| 28 | + Copying blob 660ab9198463 done |
| 29 | + Copying blob 9ed8d791092a done |
| 30 | + Copying blob b174dfe5972b done |
| 31 | + Copying blob 0ccfac04663b skipped: already exists |
| 32 | + Copying blob 577bed1928c2 done |
| 33 | + Copying blob d2af519c9d8e done |
| 34 | + Copying blob 25cd2a8f7dec done |
| 35 | + Copying blob 08fc1691d013 done |
| 36 | + Copying blob 95b8292eb455 done |
| 37 | + Copying config cff2b47201 done |
| 38 | + Writing manifest to image destination |
| 39 | + Copying config cff2b47201 [--------------------------------------] 0.0b / 4.5KiB |
| 40 | + Writing manifest to image destination |
| 41 | + Writing manifest to image destination |
| 42 | + Storing signatures |
| 43 | +``` |
| 44 | + |
| 45 | +## Deploy a cluster with your changes |
| 46 | + |
| 47 | +### Using Cluster Network Operator |
| 48 | + |
| 49 | + 1. Create a directory for your deployment |
| 50 | + |
| 51 | +``` |
| 52 | + $ mkdir /tmp/deployment |
| 53 | +``` |
| 54 | + |
| 55 | + 2. Get your openshift-install binary and your pull-secrets |
| 56 | + |
| 57 | + 3. Go to your Cluster Network Operator (CNO) Directory |
| 58 | + |
| 59 | + 4. Run hack/run-locally |
| 60 | + |
| 61 | +``` |
| 62 | + $ hack/run-locally.sh -i <your_openshift_install_path> \ |
| 63 | + -c <your_install_directory> -n <sdn|ovn> \ |
| 64 | + -m <your_quay_image_path> |
| 65 | +``` |
| 66 | + |
| 67 | +### Using Cluster-Bot |
| 68 | + |
| 69 | +This assumes you already have a PR around, and access to cluster-bot under the |
| 70 | +CoreOS Slack channel. |
| 71 | + |
| 72 | +Just query cluster-bot and send him a message with the following: |
| 73 | + |
| 74 | +``` |
| 75 | + launch openshift/sdn#<PR_NUMBER> aws |
| 76 | +``` |
| 77 | + |
| 78 | +## Update your CNO image without deleting your cluster |
| 79 | + |
| 80 | +``` |
| 81 | + update_cno () |
| 82 | + { |
| 83 | + oc patch clusterversion version --type json -p '[{"op":"add","path":"/spec/overrides","value":[{"kind":"Deployment","group":"apps","name":"network-operator","namespace":"openshift-network-operator","unmanaged":true}]}]' |
| 84 | + } |
| 85 | +
|
| 86 | + custom_sdn () |
| 87 | + { |
| 88 | + update_cno; |
| 89 | + oc -n openshift-network-operator delete deployment network-operator; |
| 90 | + oc -n openshift-sdn set image ds/sdn sdn=quay.io/<your_quay_user>/sdn-test |
| 91 | + } |
| 92 | +``` |
| 93 | + |
| 94 | +## Destroying your cluster once you're done |
| 95 | + |
| 96 | +### Using Openshift Installer |
| 97 | + |
| 98 | +``` |
| 99 | + $ openshift-install destroy cluster --dir <your_install_directory> |
| 100 | +``` |
| 101 | + |
| 102 | +### Using Cluster-Bot |
| 103 | + |
| 104 | +``` |
| 105 | + done |
| 106 | +``` |
0 commit comments