Skip to content

Commit bd6ea65

Browse files
embano1estroz
authored andcommitted
Fix sed issue on OSX (#699)
* Fix sed issue on OSX On OSX `sed` throws an error if you do not specify a file extension when `-i` is given. Fixing the docs to address this on OSX. ``` -i extension Edit files in-place, saving backups with the specified extension. If a zero-length extension is given, no backup will be saved. It is not recommended to give a zero-length extension when in-place editing files, as you risk corruption or partial content in situations where disk space is exhausted, etc. ```
1 parent 48ba936 commit bd6ea65

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ $ operator-sdk add controller --api-version=app.example.com/v1alpha1 --kind=AppS
8181
$ operator-sdk build quay.io/example/app-operator
8282
$ docker push quay.io/example/app-operator
8383

84-
# Update the operator manifest to use the built image name
84+
# Update the operator manifest to use the built image name (if you are performing these steps on OSX, see note below)
8585
$ sed -i 's|REPLACE_IMAGE|quay.io/example/app-operator|g' deploy/operator.yaml
86+
# On OSX use:
87+
$ sed -i "" 's|REPLACE_IMAGE|quay.io/example/app-operator|g' deploy/operator.yaml
8688

8789
# Setup Service Account
8890
$ kubectl create -f deploy/service_account.yaml

doc/ansible/dev/developer_guide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,12 @@ deployment image in this file needs to be modified from the placeholder
370370
$ sed -i 's|REPLACE_IMAGE|quay.io/example/foo-operator:v0.0.1|g' deploy/operator.yaml
371371
```
372372

373+
**Note**
374+
If you are performing these steps on OSX, use the following command:
375+
```
376+
$ sed -i "" 's|REPLACE_IMAGE|quay.io/example/foo-operator:v0.0.1|g' deploy/operator.yaml
377+
```
378+
373379
Deploy the foo-operator:
374380

375381
```sh

doc/ansible/user-guide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ deployment image in this file needs to be modified from the placeholder
205205
$ sed -i 's|REPLACE_IMAGE|quay.io/example/memcached-operator:v0.0.1|g' deploy/operator.yaml
206206
```
207207

208+
**Note**
209+
If you are performing these steps on OSX, use the following command:
210+
```
211+
$ sed -i "" 's|REPLACE_IMAGE|quay.io/example/memcached-operator:v0.0.1|g' deploy/operator.yaml
212+
```
213+
208214
Deploy the memcached-operator:
209215

210216
```sh

doc/user-guide.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ $ sed -i 's|REPLACE_IMAGE|quay.io/example/memcached-operator:v0.0.1|g' deploy/op
193193
$ docker push quay.io/example/memcached-operator:v0.0.1
194194
```
195195

196+
**Note**
197+
If you are performing these steps on OSX, use the following command:
198+
```
199+
$ sed -i "" 's|REPLACE_IMAGE|quay.io/example/memcached-operator:v0.0.1|g' deploy/operator.yaml
200+
```
201+
196202
The Deployment manifest is generated at `deploy/operator.yaml`. Be sure to update the deployment image as shown above since the default is just a placeholder.
197203

198204
Setup RBAC and deploy the memcached-operator:
@@ -383,4 +389,4 @@ func main() {
383389
[manager_go_doc]: https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/manager#Manager
384390
[controller-go-doc]: https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg#hdr-Controller
385391
[request-go-doc]: https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/reconcile#Request
386-
[result_go_doc]: https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/reconcile#Result
392+
[result_go_doc]: https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/reconcile#Result

0 commit comments

Comments
 (0)