Comments (20)
Yeah, I agree adding code to the envtest.Environment
to download the binaries if needed would be useful
from controller-runtime.
So far I've focused my efforts on lift-and-shifting the reusable packages from tools/setup-envtest
to pkg/envtest/setup
and re-implementing the workflows with proper error handling (rather than the panic-and-recover based stuff going on in the CLI code...). It's... a bit messy 😅
My plan is to
- re-implement the workflows as exported functions of the
pkg/envtest/setup
package - make the CLI just use those instead
- perhaps provide some convenience wrapper on an
envtest.Enviroment
(or just fallback code) that makes it as easy as possible to run this from tests
and I can easily add
- replace all usage of Afero with the stdlib fs abstractions
before I submit it for proper review.
from controller-runtime.
Sweet! Then I just have to find time to work on this, too 😅
from controller-runtime.
@tomasaschan Just a heads up. We have to migrate the envtest binaries from the GCS bucket to controller-tools releases. This will require some refactoring to setup-envtest to make it possible to pull from this new location. It should be mostly orthogonal to your work, but just wanted to let you know.
I'm working on this now. Probably the location change has to merge first as we probably want to backport it (we don't know at which point the old location will go away, because the GCS bucket is owned by Google and not the community)
from controller-runtime.
@sbueringer Ah, I see. I think that should be fine; I've moved the remote
package into controller-runtime
proper (so the dependency arrow is setup-envtest -> controller-runtime
, not the other way around) but I did it basically without changes, so it should be easy to rebase my changes on top of yours.
The main thing to keep in mind is that there should be a good way to configure a "default" client if the user provides no parameters.
from controller-runtime.
@sbueringer I opened a draft PR with my changes so far, so you can have a look at it if you'd like. Not a whole lot more work to do, but how much time I have to spend on this is a little unpredictable - I might be able to mark it ready for review later today, or not until in a couple of weeks 😅
from controller-runtime.
Agreed, this would definitely be useful!
from controller-runtime.
Also sounds useful to me, we just have to check what the impact on our dependencies is. setup-envtest today is a separate go module.
from controller-runtime.
@sbueringer I started porting code over in my fork, and while it's nowhere near ready to actually review yet (loads of local changes that are in a very unpolished - and uncommitted - state at the moment...) the go.mod
changes are probably near done already: there's a few version bumps, and a new dependency on github.com/spf13/afero. Does that sound like a blocker to you?
from controller-runtime.
Doesn't look like a showstopper to me. indirect dependency bumps look definitely fine
afero itself only has a few dependencies. Maybe it's worth looking into if we actually need afero. I'm mostly wondering if eventually we could end up in a situation that we don't find compile compatible combinations of k8s.io/* and afero transitive dependencies.
Today we're relatively safe as a vast majority of our dependencies are inherited from k/k. So whenever k/k is able to compile, CR is as well.
from controller-runtime.
Yeah I'd suggest using the stdlibs fs abstraction rather than afero to avoid the added deps
from controller-runtime.
@sbueringer Will the code remain in the same github repo, or move to its own? I just locally added a dependency from setup-envtest to the main controller-runtime module in order to make the cli use the new implementation; will that, in the long term, be an issue?
I guess the worst case is that my changes will end up needing PRs to multiple repos. We'll cross that bridge when we get there.
from controller-runtime.
Will the code remain in the same github repo, or move to its own?
Same repo, same packages. I'll just add an alternate implementation for the client stuff
from controller-runtime.
Very early prototype to give you an impression: https://github.com/kubernetes-sigs/controller-runtime/compare/main...sbueringer:controller-runtime:pr-setup-envtest-ct-rel?expand=1
(I'll try to get this done ASAP, hopefully within the next week or so there should be a PR up)
from controller-runtime.
Do we still need a separate module for setup-envtest? If it doesn' introduce any additional dependency anymore I would get rid of it entirely (so folks can do go install sigs.k8s.io/controller-runtime/tools/setup-envtest@<CR-version>
)
Today people have to pin to commits which is one reason why we were thinking about moving the binary into a separate repository. But If we can get rid of the additional module that all becomes easier.
from controller-runtime.
I don't particularly mind; we might as well use the same module for everything. I (and the kubebuilder init
-generated Makefile
, which I suppose is not insignificant in this context...) tend to use go install .../setup-envtest@latest
anyway... But a big part of my reason to do this work is to not have to install it at all, which makes it matter even less how the modules are structured.
I guess one argument for keeping them separate is that it makes it possible to add some dependencies to setup-envtest that don't have to bloat the dependency tree of controller-runtime itself. For example, the main method is currently quite bloated with both arg parsing and help text etc, and it might be nice to at some point port that to use something like Cobra; but Cobra is currently not a dependency for controller-runtime
, so if we keep the modules separate we can do that with smaller regard for CR itself.
from controller-runtime.
PR is ready for review: #2811
from controller-runtime.
#2811 is merged, so this work should be unblocked now
from controller-runtime.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle stale
- Close this issue with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
from controller-runtime.
remove-lifecycle stale
from controller-runtime.
Related Issues (20)
- Find one scalable pattern to wrap clients, and deprecate others
- Watch resources by GroupVersionKind not only by object HOT 4
- Support users options to export go schedule related runtime metrics
- Restmapper: Use aggregated discovery if available HOT 1
- cache contained <nil> HOT 5
- Informer fails to sync, timeout waiting for API HOT 1
- Bad log message HOT 11
- `pkg/manager/internal.go` - panic on log HOT 4
- controller_runtime_reconcile_errors_total metric value is not getting updated for reconcile errors
- Fake client does not preserve TypeMeta for PartialObjectMetadata after request HOT 5
- Controller-runtime does not compile with client-go 1.31 with version v0.18.5 HOT 17
- Feature: Allow ManagerOptions to be marshalled
- Does not compile with apimachinery 1.31 HOT 8
- How to use new Watches() function ? HOT 2
- When watching a resource in multiple namespaces, cluster-wide rbac is needed HOT 2
- Rely on API Priority and Fairness (APF) instead of client-side rate limiting HOT 2
- incorrect check for duplicate controller names HOT 5
- Cannot install @latest version v0.19.0 due to dependencies issues HOT 4
- Ability to watch resources in a particular namespace in predicate when cache is watching all namespaces HOT 2
- client.Status().Update() causes pod Metadata update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from controller-runtime.