-
Notifications
You must be signed in to change notification settings - Fork 58
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 a new version of odf-operator #498
base: main-v2
Are you sure you want to change the base?
Conversation
operator-sdk init --domain openshift.io \ --repo github.com/red-hat-storage/odf-operator \ --license apache2 --owner "Red Hat OpenShift Data Foundation" Signed-off-by: Nitin Goyal <[email protected]>
operator-sdk create api --group odf \ --version v1alpha1 --kind StorageSystem --resource --controller Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: iamniting The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ce88e2d
to
6d69725
Compare
Signed-off-by: Nitin Goyal <[email protected]>
fea52eb
to
3636060
Compare
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
@iamniting: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Scheme: mgr.GetScheme(), | ||
Client: mgr.GetClient(), | ||
Scheme: mgr.GetScheme(), | ||
OperatorNamespace: "openshift-storage", |
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.
pls get the namespace via downward-api.
if err = (&odfwebhook.ClusterServiceVersionDefaulter{ | ||
Client: mgr.GetClient(), | ||
Decoder: admission.NewDecoder(mgr.GetScheme()), | ||
OperatorNamespace: "openshift-storage", |
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.
pls get the namespace via downward-api.
} | ||
|
||
//+kubebuilder:rbac:groups=odf.openshift.io,resources=storagesystems,verbs=get;list;watch;create;update;patch;delete | ||
//+kubebuilder:rbac:groups=odf.openshift.io,resources=storagesystems/status,verbs=get;update;patch | ||
//+kubebuilder:rbac:groups=odf.openshift.io,resources=storagesystems/finalizers,verbs=update | ||
//+kubebuilder:rbac:groups="",resources=services,verbs=get;list;watch;create;update;patch;delete |
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 don't think patch verb for svc is required here.
} | ||
|
||
//+kubebuilder:rbac:groups=odf.openshift.io,resources=storagesystems,verbs=get;list;watch;create;update;patch;delete | ||
//+kubebuilder:rbac:groups=odf.openshift.io,resources=storagesystems/status,verbs=get;update;patch | ||
//+kubebuilder:rbac:groups=odf.openshift.io,resources=storagesystems/finalizers,verbs=update | ||
//+kubebuilder:rbac:groups="",resources=services,verbs=get;list;watch;create;update;patch;delete | ||
//+kubebuilder:rbac:groups=admissionregistration.k8s.io,resources=mutatingwebhookconfigurations,verbs=get;list;watch;create;update;patch;delete |
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 don't think patch verb for webhook is required here.
// the user. | ||
// | ||
// For more details, check Reconcile and its Result here: | ||
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile | ||
func (r *StorageSystemReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { |
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.
will the reconcile for odf-console be added in another PR?
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.
We need to copy-paste the whole reconcile, I will do that as part of the other PR.
) | ||
|
||
const ( | ||
WebhookPath = "/mutate-operators-coreos-com-v1alpha1-clusterserviceversion" |
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.
this doesn't need to be GVK identifiable by any means, not user facing, longer names are prone to typos and short name would suffice, how about '/mutate-csv' or can expand csv.
) | ||
|
||
var ( | ||
ManagedPkgNames = []string{ |
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.
is this required outside of the package?
// base csvs | ||
"ocs-operator", | ||
"rook-ceph-operator", | ||
"ocs-client-operator", | ||
"mcg-operator", | ||
"noobaa-operator", | ||
"odf-csi-addons-operator", | ||
"csi-addons", | ||
"cephcsi-operator", | ||
"odf-prometheus-operator", | ||
"recipe", | ||
|
||
// extended csvs | ||
"ibm-storage-odf-operator", |
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.
why do we need it here? you can scale down any csv which isn't odf-operator (can be queried from OLM set env easily) in the namespace since we are managing the ns
the edge case is only operators installed in all namespaces and maybe we need to look at how to filter those out.
(or)
we might want to get this info during build time about all the csvs that we going to manage, wdyt?
r.logger = log.FromContext(r.context) | ||
r.logger.Info("Request received for ClusterServiceVersion review") | ||
|
||
instance := &opv1a1.ClusterServiceVersion{} |
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.
pls use the shortname, instance doesn't say anything. same in remaining places.
instance := &opv1a1.ClusterServiceVersion{} | |
csv := &opv1a1.ClusterServiceVersion{} |
if err := r.reconcileWebhookService(); err != nil { | ||
r.logger.Error(err, "unable to reconcile webhook service") | ||
return ctrl.Result{}, err | ||
} | ||
|
||
if err := r.reconcileSubscriptionValidatingWebhook(); err != nil { | ||
r.logger.Error(err, "unable to register subscription validating webhook") | ||
return ctrl.Result{}, err | ||
} |
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.
may I know what else be part of another PR? to name a few as below seems to be related to this PR only
- watches on webhook and service is missing
- addition and removal of finalizer on storagesystem is missing
- removal of webhook and service during uninstallation is missing
Signed-off-by: Nitin Goyal [email protected]