Skip to content

Commit 20a8c70

Browse files
authored
Merge pull request #110 from hasbro17/haseeb/update-README
README: fix outputs and add logging
2 parents 853b25c + e3cbdc6 commit 20a8c70

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ Before creating any project, this guide has the following prerequisites:
2828

2929
Operator SDK CLI tool is used to manage development lifecycle.
3030

31-
Install the CLI tool:
31+
Checkout the desired release tag and install the SDK CLI tool:
3232
```
33+
git checkout tags/v0.0.1
3334
go install github.com/coreos/operator-sdk/commands/operator-sdk
3435
```
3536

@@ -117,7 +118,7 @@ Re-render the generated code for custom resource:
117118
operator-sdk generate k8s
118119
```
119120

120-
In `main.go`, modify `sdk.Watch` to watch on `Memcached` custom resource:
121+
In `cmd/memcached-operator/main.go`, modify `sdk.Watch` to watch on `Memcached` custom resource:
121122

122123
```Go
123124
func main() {
@@ -136,6 +137,7 @@ import (
136137
"github.com/coreos/operator-sdk/pkg/sdk/action"
137138
"github.com/coreos/operator-sdk/pkg/sdk/handler"
138139
"github.com/coreos/operator-sdk/pkg/sdk/types"
140+
"github.com/sirupsen/logrus"
139141
apps_v1 "k8s.io/api/apps/v1"
140142
"k8s.io/api/core/v1"
141143
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -145,6 +147,7 @@ func (h *Handler) Handle(ctx types.Context, event types.Event) []types.Action {
145147
var actions []types.Action
146148
switch obj := event.Object.(type) {
147149
case *v1alpha1.Memcached:
150+
logrus.Infof("Received Memcached: %v", obj.Name)
148151
ls := map[string]string{
149152
"app": "memcached",
150153
"name": obj.Name,
@@ -181,6 +184,7 @@ func (h *Handler) Handle(ctx types.Context, event types.Event) []types.Action {
181184
},
182185
},
183186
}
187+
logrus.Infof("Creating Deployment: %v", obj.Name)
184188
actions = append(actions, types.Action{
185189
Object: d,
186190
Func: action.KubeApplyFunc,
@@ -207,6 +211,7 @@ func (h *Handler) Handle(ctx types.Context, event types.Event) []types.Action {
207211
}},
208212
},
209213
}
214+
logrus.Infof("Creating Service: %v", obj.Name)
210215
actions = append(actions, types.Action{
211216
Object: svc,
212217
Func: action.KubeApplyFunc,
@@ -268,7 +273,7 @@ We can test the Memcached service by opening a telnet session and running comman
268273
```
269274
It should output:
270275
```
271-
VALUE foo 0 0 3
276+
VALUE foo 0 3
272277
bar
273278
```
274279

0 commit comments

Comments
 (0)