Commit Graph

1104 Commits

Author SHA1 Message Date
Hasan Turken bc23452656
Use seperate interfaces to keep existing MRs compiling
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-10 16:34:29 +03:00
Hasan Turken 936e12174d
Add fake store for unit tests
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-10 15:50:45 +03:00
Hasan Turken 19034f22d1
Fetch secret store config and complete connection manager
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-10 00:27:55 +03:00
Hasan Turken 31c8287de6
Remove reviewable and check-diff from Makefile
- To fix overriding target warnings in make output logs
- In favor of the ones in build submodule

Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-10 00:22:33 +03:00
Hasan Turken 8cc6436606
Add connection secret manager
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-08 18:25:32 +03:00
Hasan Turken cb4062f9c3
Add a placeholder Vault secret store
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-08 18:24:10 +03:00
Hasan Turken 05fff0ec25
Add kubernetes secret store
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-08 18:21:19 +03:00
Hasan Turken 300dc3127f
Define secret store interface
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-08 18:20:47 +03:00
Hasan Turken 4b082d3585
Extend managed resource with new API
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-08 18:19:57 +03:00
Hasan Turken 28d33bf0db
Add initial types for External Secret Store
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-08 18:18:43 +03:00
muvaffak onuş 428b7c3903
Merge pull request #308 from muvaf/upd-go
Update Go to 1.17 and k8s libraries to 1.23
2022-01-06 17:01:06 +03:00
Muvaffak Onus 2c8369b865
update k8s libraries to latest
Signed-off-by: Muvaffak Onus <me@muvaf.com>
2022-01-06 16:50:45 +03:00
Muvaffak Onus 65392c8c35
add changes coming with go 1.17
Signed-off-by: Muvaffak Onus <me@muvaf.com>
2022-01-06 16:49:33 +03:00
Muvaffak Onus 5452374109
update go to v1.17.5
Signed-off-by: Muvaffak Onus <me@muvaf.com>
2022-01-06 16:44:15 +03:00
Nic Cope d43d510ec5
Merge pull request #306 from negz/dc
Tweak ExternalDisconnecter implementation
2021-12-02 15:09:00 -08:00
Nic Cope 295de4764e Tweak ExternalDisconnecter implementation
The primary functional change here is to avoid setting a status condition when a
deferred disconnect fails. We don't want to overwrite the original status
condition that may have been written if we're returning from Reconcile because
we hit an error. Emitting an event and a debug log should be sufficient.

This commit also tweaks a bit of grammar and updates the NopConnectDisconnecter
implementation to more closely match its docstring description.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-12-02 22:37:02 +00:00
Nic Cope 5cc9857410
Merge pull request #296 from vaspahomov/feature/disconnect-in-reconcile
Add Disconnect call in Reconcile
2021-12-02 14:16:43 -08:00
Nic Cope 21928d24c8
Merge pull request #303 from fahedouch/add-nop-finalizer
add NewNopFinalizer()
2021-11-22 10:13:03 -08:00
fahed dorgaa 7b45316e5b add NewNopFinalizer
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
2021-11-08 12:49:03 +01:00
Daniel Mangum c72bcdd922
Merge pull request #300 from hasheddan/better-parse
Only attempt object scheme parsing if object is not registered in meta
2021-10-29 17:13:07 -04:00
hasheddan f3ea898989
Use Wrapf for annotating parser errors
Updates error annotation formatting to use errors.Wrapf.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2021-10-29 17:00:55 -04:00
hasheddan cc6f044e79
Only attempt object scheme parsing if object is not registered in meta
Updates the package parsing logic to only attempt decoding with the
object scheme in the case that the error from decoding in the meta
scheme is due to the GVK not being registered. This does not change the
definition of a valid package, but does result in more informative
errors being returned when a package is invalid due to a malformed meta
type.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2021-10-29 15:51:06 -04:00
vaspahomov a5ff67d5a0
remove named returns; disconnect error should not requeue reconcile
Signed-off-by: vaspahomov <vas2142553@gmail.com>
2021-10-28 15:25:12 +05:00
vaspahomov bf53464ca5
Add Disconnect call in Reconcile
Signed-off-by: vaspahomov <vas2142553@gmail.com>
2021-10-28 15:20:56 +05:00
Nic Cope 67edf4ae83
Merge pull request #294 from negz/re-re-re-reconcile
Support true global reconcile rate limiting
2021-10-25 12:33:55 -07:00
Nic Cope bf5d5512c2
Merge pull request #298 from negz/contextual
Plumb up reconciler contexts
2021-10-14 13:49:50 -07:00
Nic Cope ee4131e543 Plumb up reconciler contexts
I believe the Reconcile method started including a context in controller-runtime
v0.8.0, but it was never plumbed up. If I follow the contexts correctly the one
passed to Reconcile can be traced back to the one passed to mgr.Start, which is
typically a context that is cancelled on SIGTERM or SIGINT.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-10-14 00:36:16 +00:00
muvaffak onuş 579c1833b5
Merge pull request #297 from turkenh/pave-with-wildcards
Add wildcard expand method to fieldpath.Paved
2021-10-04 18:08:27 +03:00
Hasan Turken 47bff13a91
Proper printing for wildcards
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2021-10-04 15:46:39 +03:00
Hasan Turken 77b66f3d77
Add unit tests for paved.ExpandWildcards
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2021-10-04 15:11:37 +03:00
Hasan Turken aefd94be9f
Add expand wildcards to Paved
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2021-10-03 23:07:28 +03:00
muvaffak onuş d566121073
Merge pull request #295 from muvaf/finalize-it-now
managed: make finalizer name string public
2021-09-30 12:53:26 +03:00
Muvaffak Onus d6c9f3e919
managed: make finalizer name string public so that it can be used in NewAPIFinalizer calls outside of package managed
Signed-off-by: Muvaffak Onus <me@muvaf.com>
2021-09-30 00:27:45 +03:00
Nic Cope 70a386a588 Return, don't mutate, a rate limited *rest.Config
Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-25 03:07:12 +00:00
Nic Cope f7ed086985 Don't rate limit requests that are already delayed by rate limiting
Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-25 02:41:39 +00:00
Nic Cope 277dabb3df Support true global reconcile rate limiting
This PR tweaks how ratelimiters are applied to support _actual_ global reconcile
rate limiting - that is all reconcile triggers are rate limited, not just some.

See https://github.com/crossplane/crossplane/issues/2595 for details.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-24 21:29:00 +00:00
Nic Cope 658dfc7b41
Merge pull request #293 from negz/coopt
Add a `controller.Options` type
2021-09-21 20:54:08 -07:00
Nic Cope f2b0ca3026 Add DefaultOptions
I don't really expect these to be used in practice. They're mostly useful for
places like the XRD controllers where we need a default set of options to plumb
down to the XR and XRC controllers when none are passed to use (i.e. in tests).

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-21 03:47:25 +00:00
Nic Cope d89312be2f Make nil *feature.Flags somewhat usable
This will report that flags aren't enabled if *Flags is nil, rather than panicing.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-21 03:46:06 +00:00
Nic Cope efa7256648 Add a convenience function for deriving controller-runtime options
Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-21 03:12:43 +00:00
Nic Cope b7335472cd Add a controller.Options type
This type is intended to be passed as the argument to most Crossplane Setup
functions, for example:

```go
func Setup(mgr ctrl.Manager, o controller.Options) error
```

This allows us to add new options to be plumbed down to all or most controllers
without increasing the number of arguments provided to each Setup function. Sets
of controllers that require additional arguments (e.g. the pkg controllers from
crossplane/crossplane) can define their own Options struct that embeds this one.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-21 03:12:43 +00:00
Nic Cope 6ae31519f1 Switch ratelimiter package to more generic names
I'd like to reuse these existing ratelimiters for crossplane, where the names
'Provider' and 'Managed' don't make as much sense.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-21 03:12:43 +00:00
Nic Cope 4bd8016876 Add a feature flag package
https://github.com/crossplane/crossplane/tree/b7ce021e32/internal/feature
https://github.com/crossplane/crossplane/issues/2313.

This is a copy of the (almost) identical crossplane/crossplane package, which
will be removed in favor of this one. Moving to crossplane-runtime allows us to
use the same package in providers, e.g. to disable Alpha APIs per the above
issue.

The package is _almost_ identical because the Flag type has been changed from
int to string. This makes it easier to give flags string names, because the
stringer tool we previously used requires that types and instances be defined in
the same package.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-21 03:12:43 +00:00
Nic Cope 9f3f799fbd
Merge pull request #292 from negz/creation
Set `Creating` and `Deleting` conditions close to `Status().Update()` calls
2021-09-17 16:43:39 -07:00
Nic Cope f1ff9b11b7 Set Creating and Deleting conditions close to Status().Update() calls
https://github.com/crossplane/crossplane-runtime/issues/285

This approach causes us to repeat ourselves a bit, but prevents issues like the
above, where refactoring caused us to accidentally overwrite a pending status
update that we hadn't committed.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-17 23:35:29 +00:00
Nic Cope fe7e495016 Mark Target APIs as deprecated.
I don't believe these are used anywhere anymore.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-13 22:17:52 +00:00
Nic Cope 6a7a44ac50
Merge pull request #291 from negz/error
Add an `errors` package with a similar API to `github.com/pkg/errors`
2021-09-12 18:54:52 -07:00
Nic Cope 3aa81c43b1 Remove TODO about cmpopts.EquateErrors
I tried to address this TODO today, but found that I kind of prefer how our
implementation works. I've found from time to time while writing tests that
I was accidentally wrapping my errors with the wrong context (i.e. message),
which is not something the cmpopts variant tests for.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-09 07:50:57 +00:00
Nic Cope af4e148a11 Replace github.com/pkg/errors with our own pkg/errors.
Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-09 07:50:57 +00:00
Nic Cope 1a64750fcd Add an errors package with a similar API to github.com/pkg/errors
Go introduced a 'native' way to wrap errors back in v1.13. At that point we were
already using github.com/pkg/errors to 'wrap' errors with context, and we never
got around to migrating. In addition to pure inertia, I've personally avoided
making the switch because I prefer the github.com/pkg/errors API. Specifically I
like that errors.Wrap handles the "outer context: inner context" error format
that Go uses by convention, and that errors.Wrap will return nil when passed a
nil error.

Given that github.com/pkg/errors has long been in maintenance mode, and is (per
https://github.com/pkg/errors/issues/245) no longer used by its original author
now seems as good a time as any to migrate. This commit attempts to ease that
migration for the Crossplane project - and to retain the nice API - by adding a
package that acts as a small github.com/pkg/errors style shim layer around the
stdlib pkg/errors (and friends, like fmt.Errorf).

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-09-09 07:43:25 +00:00