Skip to content

doc: clean up README and user-guide #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2018

Conversation

hasbro17
Copy link
Contributor

Description of the change:
README:

  • Change pre-alpha to alpha
  • Updated the workflow
  • Linked to ansible operator user-guide

user-guide:

  • Cleaned up some sections and added links to controller-runtime go-docs in the user-guide

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 26, 2018
@hasbro17 hasbro17 requested review from lilic and estroz October 26, 2018 00:16
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

A few cosmetic nits and one addition.

README.md Outdated

The project is currently pre-alpha and it is expected that breaking changes to the API will be made in the upcoming releases.
The project is currently alpha. The core APIs provided by the controller-runtime will most likely be unchanged. New features and APIs may still be added in the future.
Copy link
Member

Choose a reason for hiding this comment

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

Probably shouldn't mention controller-runtime before defining what it is below, or link it up here too.

Copy link
Member

Choose a reason for hiding this comment

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

Can we add a quick note what alpha means? There were questions about this on slack. See #608

Copy link
Member

Choose a reason for hiding this comment

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

There is talk about adding api breaking changes to the controller-runtime see just an FYI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@estroz I'm going to link it up here.

@shawn-hurley Thanks for pointing that out. That's why I used the phrase "most likely" but I'll try to make it clearer that there could still be breaking changes. Just hopefully nothing on the scale of what we're doing now. Most likely just function signature changes.

@lilic Alpha and beta are usually defined in the context of testing and missing features(and I might be wrong) but here's my understanding:

  • Alpha: Some features may still be missing(e.g metrics, csv generation) and incompatible changes may still be made.
  • Beta: All the features have been added and no backward incompatible changes will be made. Only changes expected are bug fixes.

I'll add a note on that.


To learn more about the operator-sdk, see the [user guide][guide].
The SDK also supports developing an operator using Ansible. See the [Ansible operator user guide][ansible_user_guide].
Copy link
Member

Choose a reason for hiding this comment

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

I would add a note about this in the Workflow section as well. Perhaps @shawn-hurley or another Ansible-focused team member could write a workflow in this or a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

I think we will add a follow up PR just to keep it easy

README.md Outdated
- High level APIs and abstractions to write the operational logic more intuitively
- Tools for scaffolding and code generation to bootstrap a new project fast
- Extensions to cover common operator use cases

## Workflow

The SDK provides the following workflow to develop a new operator:
The SDK provides the following workflow to develop a new operator in Go:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The SDK provides the following workflow to develop a new operator in Go:
The SDK provides workflows to develop operators in Go or Ansible.
The following workflow is for a new Go operator:

For this example replace the generated controller file `pkg/controller/memcached/memcached_controller.go` with the example [memcached_controller.go][memcached_controller] implementation.
This will scaffold a new Controller implementation under `pkg/controller/memcached/...`.

For this example replace the generated Controller file `pkg/controller/memcached/memcached_controller.go` with the example [memcached_controller.go][memcached_controller] implementation.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For this example replace the generated Controller file `pkg/controller/memcached/memcached_controller.go` with the example [memcached_controller.go][memcached_controller] implementation.
For this example replace the generated Controller file `pkg/controller/memcached/memcached_controller.go` with the example [`memcached_controller.go`][memcached_controller] implementation.

@@ -135,7 +139,7 @@ err := c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequest

### Reconcile loop

Every controller has a Reconciler object with a `Reconcile()` method that implements the reconcile loop. The reconcile loop is passed the `Request` argument which is a Namespace/Name key used to lookup the primary resource object, Memcached, from the cache:
Every Controller has a Reconciler object with a `Reconcile()` method that implements the reconcile loop. The reconcile loop is passed the [Request][request-go-doc] argument which is a Namespace/Name key used to lookup the primary resource object, Memcached, from the cache:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Every Controller has a Reconciler object with a `Reconcile()` method that implements the reconcile loop. The reconcile loop is passed the [Request][request-go-doc] argument which is a Namespace/Name key used to lookup the primary resource object, Memcached, from the cache:
Every Controller has a Reconciler object with a `Reconcile()` method that implements the reconcile loop. The reconcile loop is passed the [`Request`][request-go-doc] argument which is a Namespace/Name key used to lookup the primary resource object, Memcached, from the cache:

@@ -146,7 +150,8 @@ func (r *ReconcileMemcached) Reconcile(request reconcile.Request) (reconcile.Res
}
```

Based on the return value of `Reconcile()` the reconcile `Request` may be requeued and the loop may be triggered again:
Based on the return values, [Result][result_go_doc] and error, the `Request` may be requeued and the reconcile loop may be triggered again:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Based on the return values, [Result][result_go_doc] and error, the `Request` may be requeued and the reconcile loop may be triggered again:
Based on the return values, [`Result`][result_go_doc] and error, the `Request` may be requeued and the reconcile loop may be triggered again:

Copy link
Member

@lilic lilic left a comment

Choose a reason for hiding this comment

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

lgtm overall

README.md Outdated

The project is currently pre-alpha and it is expected that breaking changes to the API will be made in the upcoming releases.
The project is currently alpha. The core APIs provided by the controller-runtime will most likely be unchanged. New features and APIs may still be added in the future.
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a quick note what alpha means? There were questions about this on slack. See #608

- [kubectl][kubectl_tool] version v1.10.0+.
- Access to a kubernetes v.1.10.0+ cluster.
- [kubectl][kubectl_tool] version v1.11.0+.
- Access to a kubernetes v.1.11.0+ cluster.
Copy link
Member

Choose a reason for hiding this comment

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

How come it doesn't work on v.1.10.0 clusters anymore?

Copy link
Contributor

Choose a reason for hiding this comment

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

It should work on v1.10, but we don't test v1.10 anymore, only v1.11 (technically openshift v3.11)

@@ -61,7 +61,7 @@ By default this will be the namespace that the operator is running in. To watch
mgr, err := manager.New(cfg, manager.Options{Namespace: ""})
```

**// TODO:** Doc on manager options(Sync period, leader election, registering 3rd party types)
**// TODO:** Doc on leader election
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I would prefer opening an issue for documentation on leader election rather than having it in the README.

Copy link
Member

Choose a reason for hiding this comment

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

I would also like that we start publishing our API's on godoc and link to our docs there.

IIRC @mhrivnak added package level docs that were pretty extensive and I think that might be the correct way to document usage of packages. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shawn-hurley Agreed all of our APIs should have sufficient godocs. The leader election package is already quite well documented but the ToDo I have here is for an example on how to use our leader election pkg in the manager. And also an example on how to use the runtime's leader election pkg for comparison.

So either a separate doc that goes over both of those and links to the releavant godocs. Or we add the example to the godoc.
Either way I've created an issue for that #665

Copy link
Member

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

Just some thoughts and suggestions. LGTM though

README.md Outdated

The project is currently pre-alpha and it is expected that breaking changes to the API will be made in the upcoming releases.
The project is currently alpha. The core APIs provided by the controller-runtime will most likely be unchanged. New features and APIs may still be added in the future.
Copy link
Member

Choose a reason for hiding this comment

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

There is talk about adding api breaking changes to the controller-runtime see just an FYI


To learn more about the operator-sdk, see the [user guide][guide].
The SDK also supports developing an operator using Ansible. See the [Ansible operator user guide][ansible_user_guide].
Copy link
Member

Choose a reason for hiding this comment

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

I think we will add a follow up PR just to keep it easy

@@ -61,7 +61,7 @@ By default this will be the namespace that the operator is running in. To watch
mgr, err := manager.New(cfg, manager.Options{Namespace: ""})
```

**// TODO:** Doc on manager options(Sync period, leader election, registering 3rd party types)
**// TODO:** Doc on leader election
Copy link
Member

Choose a reason for hiding this comment

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

I would also like that we start publishing our API's on godoc and link to our docs there.

IIRC @mhrivnak added package level docs that were pretty extensive and I think that might be the correct way to document usage of packages. Thoughts?

@hasbro17
Copy link
Contributor Author

Addressed the above comments. PTAL.

Copy link
Member

@lilic lilic left a comment

Choose a reason for hiding this comment

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

lgtm

@hasbro17 hasbro17 merged commit a984491 into operator-framework:master Oct 29, 2018
@hasbro17 hasbro17 deleted the update-readme branch October 29, 2018 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants