@@ -67,3 +67,42 @@ To reduce memory usage, you can remove some non-essential components from the cl
67
67
```
68
68
export HACK_MINIMIZE=1
69
69
```
70
+
71
+ ### Developing with a local copy of openshift-sdn
72
+
73
+ Origin images are difficult to build correctly. If you want to test some binary changes with openshift-sdn, there's an easier way.
74
+
75
+ #### One-time setup:
76
+ 1 . Set up your API credentials:
77
+ - Log on to https://api.ci.openshift.org/ with your GitHub credentials
78
+ - On the top right, click copy login command. Execute it in a terminal
79
+ - Execute ` oc registry login ` , which will install credentials for your local podman and docker clients
80
+ 2 . Create the following dockerfile in your origin repo:
81
+ ```
82
+ cat <<EOF > Dockerfile.node-hacking
83
+ FROM docker.io/openshift/origin-node:v4.0.0
84
+ COPY _output/local/bin/linux/amd64/openshift-sdn /usr/bin/openshift-sdn
85
+ EOF
86
+ ```
87
+
88
+ #### Building a development sdn image
89
+ 1 . Pick a registry. You can use the Openshift CI one if you are a member of the organization.
90
+ ```
91
+ export REGISTRY=registry.svc.ci.openshift.org/<YOUR-GITHUB-USERNAME>
92
+ ```
93
+
94
+ 2 . Build the sdn process
95
+ ```
96
+ make WHAT=./cmd/openshift-sdn
97
+ ```
98
+
99
+ 3 . Build and push the node image
100
+ ```
101
+ podman build -t ${REGISTRY}/origin-node:latest -f Dockerfile.node-hacking .
102
+ podman push ${REGISTRY}/origin-node:latest
103
+ ```
104
+
105
+ 4 . Follow the steps above, but override the node image reference in step 3.
106
+ ```
107
+ echo "NODE_IMAGE=${REGISTRY}/origin-node:latest" >> ${CLUSTER_DIR}/env.sh
108
+ ```
0 commit comments