Skip to content

Conversation

fanminshi
Copy link
Contributor

@fanminshi fanminshi commented Mar 28, 2018

change the default behavior of main.go to watch on the user defined custom resource.
change the default behavior of handler.go to create a busy-box pod when receiving a custom resource.
add auto-generation for the cr.yaml.

cc/ @hasbro17

@fanminshi fanminshi changed the title [WIP] pkg/generator: change main and handler generator for 0.0.2 milestone pkg/generator: change main and handler generator for 0.0.2 milestone Mar 28, 2018
@fanminshi
Copy link
Contributor Author

Manual Test:

$ operator-sdk new app-operator --api-version=app.example.com/v1alpha1 --kind=App
$ cd app-operator/
$ operator-sdk build quay.io/coreos/operator-sdk-dev:app-operator
$ docker push quay.io/coreos/operator-sdk-dev:app-operator
$ kubectl create -f deploy/operator.yaml
$ kubectl create -f deploy/cr.yaml

$ kubectl get po
NAME                          READY     STATUS    RESTARTS   AGE
app-operator-67c6b694-2qwj8   1/1       Running   0          4m
busy-box                      1/1       Running   0          4m

@fanminshi fanminshi changed the title pkg/generator: change main and handler generator for 0.0.2 milestone pkg/generator: change code generation on main.go and handler.go for 0.0.2 milestone Mar 28, 2018
kind: "{{.Kind}}"
metadata:
name: "example"
spec:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the spec field if it's just going to be empty by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good!

@hasbro17
Copy link
Contributor

hasbro17 commented Apr 1, 2018

LGTM after nit.

@fanminshi fanminshi merged commit b278881 into operator-framework:master Apr 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants