-
Notifications
You must be signed in to change notification settings - Fork 10
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
Create empty CRDs and Controllers structure #6
Create empty CRDs and Controllers structure #6
Conversation
// Important: Run "make" to regenerate code after modifying this file | ||
|
||
// Foo is an example field of WatcherApplier. Edit watcherapplier_types.go to remove/update | ||
Foo string `json:"foo,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so is the plan to merge this skeleton and then work on filling out each service?
or will you start iterating here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's my proposal, yes. Merge the empty skeleton and then filling out each service.
// SetupWithManager sets up the controller with the Manager. | ||
func (r *WatcherReconciler) SetupWithManager(mgr ctrl.Manager) error { | ||
return ctrl.NewControllerManagedBy(mgr). | ||
For(&watcherv1beta1.Watcher{}). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add the sub-resources (WatcherDecisionEngine
, etc) here since this is the top-level controller. i.e. something like this [1].
//+kubebuilder:rbac:groups=watcher.openstack.org,resources=watchers,verbs=get;list;watch;create;update;patch;delete | ||
//+kubebuilder:rbac:groups=watcher.openstack.org,resources=watchers/status,verbs=get;update;patch | ||
//+kubebuilder:rbac:groups=watcher.openstack.org,resources=watchers/finalizers,verbs=update | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optionally you could explicitly add annotations for the sub-resources here. Technically they are not needed because they already exist in the sub-resource controllers, but it might be beneficial for human readers to see that this controller is expected to have full access to the sub-sources. Something like this [1].
Using openstack-sdk: $ operator-sdk create api \ --group watcher \ --version v1beta1 \ --kind Watcher \ --resource \ --controller JIRA: OSPRH-11422
For consistency with other operators and with defaults in operators-sdk.
Intended to manage de watcher-decision-engine component of watcher service. Using openstack-sdk: $ operator-sdk create api \ --group watcher \ --version v1beta1 \ --kind WatcherDecisionEngine \ --resource \ --controller JIRA: OSPRH-11484
Intended to manage de watcher-applier component of watcher service. Using openstack-sdk: $ operator-sdk create api \ --group watcher \ --version v1beta1 \ --kind WatcherApplier \ --resource \ --controller JIRA: OSPRH-11485
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abays The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
953b0a8
into
openstack-k8s-operators:main
This PR is creating the empty structure of crds and controllers for the watcher operator architecture:
watcher:
watcherapi
watcher-decision-egine
watcher-applier
Related: OSPRH-11422
Related: OSPRH-11483
Related: OSPRH-11484
Related: OSPRH-11485