-
Notifications
You must be signed in to change notification settings - Fork 189
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
Update to operator-sdk 0.1.1 #82
Update to operator-sdk 0.1.1 #82
Conversation
/hold |
/retest |
Refactor all the operator internals to use controller-runtime. This is necessary to unpin the operator from outdated kube dependencies. The refactor should be functionally transparent.
975b519
to
94ef6e2
Compare
/unhold |
@openshift/sig-network-edge PTAL /cc @bparees @shawn-hurley |
/hold cancel |
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.
Rest of the changes LGTM.
Looks like controller-runtime pkg gives us the needed scaffolding and provides flexibility in fetching and watching needed resources.
sdk "github.com/operator-framework/operator-sdk/pkg/sdk" | ||
k8sutil "github.com/operator-framework/operator-sdk/pkg/util/k8sutil" | ||
sdkVersion "github.com/operator-framework/operator-sdk/version" | ||
"github.com/operator-framework/operator-sdk/pkg/k8sutil" |
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.
Looking at the changes, operator-sdk pkg is used only here, mainly to get WATCH_NAMESPACE
env.
Why not use os.LookupEnv(...)
directly and get rid of operator-sdk pkg dependency?
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.
Good point. I'd actually also consider switching to a Cobra command and consuming this from flags anyway. In either case, seems like a followup?
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.
yes, that works
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: ironcladlou, pravisankar 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 |
Refactor all the operator internals to use controller-runtime. This is necessary to unpin the operator from outdated kube dependencies.
The refactor should be functionally transparent.
Unfortunately, my best advice right now for reasoning through these changes is to dive into the controller-runtime docs and source.
The new
OperatorManager
is (I think) the key abstraction which enables our class of operator (multi-namespaces) to make use of controller-runtime. There are ongoing discussions and prototypes upstream to try and support the use case — if and when those materialize, we can revisit our architecture.Replaces #70.