Commit Graph

57 Commits

Author SHA1 Message Date
Nic Cope 0c7b1eb549 Bump golangci-lint, copy config from c/c
This copies the latest config from c/c and addresses all the linter
errors that config produces.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2024-02-20 03:45:27 -08:00
Nic Cope cf0dad7772 Remove pkg/test/integration
* https://github.com/crossplane/crossplane-runtime/pull/89
* https://github.com/search?q=%22github.com%2Fcrossplane%2Fcrossplane-runtime%2Fpkg%2Ftest%2Fintegration%22&type=code

This was added in the above PR, but we never really made use of it.
Based on the above GitHub search, I think every consumer of the package
(except https://github.com/vshn/crossplane-service-broker?) are ancient,
stale forks of kubevela, oam-kubernetes-runtime, or provider-gcp. Modern
versions of these packages no longer use this one.

If we wanted to be really conservative we could mark this deprecated,
but I lean toward just removing it.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-06-21 22:06:23 -07:00
Mateusz Puczyński 920e5b1ac6
bump sigs.k8s.io/controller-runtime to v0.15.0
Signed-off-by: Mateusz Puczyński <mati6095@gmail.com>
2023-05-26 17:29:45 +02:00
Philippe Scorsolini 511b39fa56
chore: address issues reported by revive
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
2023-04-05 12:03:27 +02:00
Philippe Scorsolini 57dafafdaf
chore(linter): switching from goimports to gci enforcing imports sorting
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
2023-03-29 09:23:07 +02:00
Nic Cope 9e69576057 Add a test for the new subresource Create method
Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-01-25 10:34:38 -08:00
Nic Cope 71190c3e9a Remove fake.MockStatus* type aliases
I thought this would help with compatibility, but unfortunately this
package has breaking changes that will affect anyone who was using these
types regardless.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-01-25 10:34:38 -08:00
Nic Cope 8b832430e9 Bump Kubernetes dependencies
This required some updates to our implementations of client.Client,
which now has a generic SubResource sub-client.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-01-25 10:34:37 -08:00
Nic Cope f0fcbc0af5 Update linter config to match c/c
This repo is a little out of date relative to our latest linting
practices.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-01-25 10:32:46 -08:00
Aditya Sharma cd68866501 Fix lints
Signed-off-by: Aditya Sharma <git@adi.run>
2022-07-21 22:01:32 -07:00
Hasan Turken 21f1473d10
Fix optional fields in connection details API
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-25 17:55:36 +03:00
Hasan Turken cfcec11142
Do not use unstructured client for StoreConfig
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-17 23:29:03 +03: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
Sascha Grunert 423918f457
Update controller runtime to v0.8.0
This updates the controller-runtime and all of its dependencies to the
latest release.

This includes a bunch of changes which break backwards compatibility
introduced by controller-runtime 0.7.0 and 0.8.0, for example:

> A number of methods that previously took runtime.Object & internally
> type-asserted them to metav1.Object now take client.Object (for non-list
> objects) or client.ObjectList (for lists). The practical upshot of this
> is more type-safety and clarity around what's required for particular
> methods.
> All concrete API types (anything that implements runtime.Object & has
> a metadata field) already implement client.Object or client.ObjectList,
> so practical impact should be limited to folks who pass around
> runtime.Object values instead of concrete types.

Signed-off-by: Sascha Grunert <mail@saschagrunert.de>
2021-01-21 13:29:16 +01:00
hasheddan 0b27607592
Update core/v1alpha1 imports to common/v1
Updates all core/v1alpha1 imports to the common/v1, which is the new
home of these embedded API types.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-11-19 20:03:48 -06:00
hasheddan efd76064c9
Delete CRDs in foreground at end of test run
This guards against subsequent tests failing because
they are installing the same CRDs that we being deleted.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-04-29 13:18:33 -05:00
Nic Cope 8fe8833cc3 Pin controller-runtime to master
https://github.com/kubernetes-sigs/controller-runtime/pull/863

We'd like to use the above PR, which is not yet included in a controller-runtime
release. Updating controller-runtime requires updating a few other dependencies,
which changed the signature of client-go clientset methods. This commit removes
the only two uses of clientset from crossplane-runtime. pkg/test/integration now
uses a controller-runtime client.Client. pkg/test.Env has been removed, as it no
longer has any known users.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-22 19:14:42 -07:00
hasheddan 8d3f52dd66
Format tmp dir hash as hex
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-04-04 10:00:47 -05:00
hasheddan 18caa604b9
Ignore previously cleaned up CRDs in integration tests
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-04-04 10:00:46 -05:00
hasheddan 16aa98bd07 Update go mod and refs with crossplane org name
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-02-18 18:17:32 -06:00
Nic Cope 2e53eb2645 Add package doc for packages that currently lack it.
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-01-15 12:27:16 -08:00
hasheddan c574b3dddd integration tests: use fnv over md5
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-12-10 18:43:08 -06:00
hasheddan 5304d0c8c6 integration tests: check hashing error
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-12-10 17:25:25 -06:00
hasheddan 9254132398 integration tests: one args for all path types
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-12-10 17:24:01 -06:00
hasheddan c9471f6288 integration tests: support downloading remote CRDs
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-12-10 17:24:01 -06:00
hasheddan 65b35a9566 test: clean up integration testing framework
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-11-25 23:10:51 -06:00
hasheddan 0ee25af7eb test: fix linter warnings
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-11-22 11:32:15 -06:00
hasheddan 5ba6fc5ef0 test: support variadic crd directory paths
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-11-21 16:14:38 -06:00
hasheddan 3e648dda92 test: add integration testing framework
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-11-21 16:13:03 -06:00
Nic Cope 54cc532c3a Add package doc for crossplane-runtime
Signed-off-by: Nic Cope <negz@rk0n.org>
2019-09-18 14:40:41 -07:00
hasheddan e4d61ee280 runtime migration: remove crds path
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-08-21 12:26:43 -05:00
hasheddan 7d786e2dff runtime migration: strip apis and update dependencies
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-08-20 09:27:20 -05:00
hasheddan a72525edae kubebuilderv2: update core packages and tooling
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Co-authored-by: Muvaffak Onus <onus.muvaffak@gmail.com>
Co-authored-by: Jared Watts <jbw976@gmail.com>
Co-authored-by: hasheddan <georgedanielmangum@gmail.com>
2019-08-13 17:39:59 -05:00
Nic Cope b3da55f2be Update all copyrights to 2019
This commit was generated via s/Copyright 2018/Copyright 2019/g

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-07-10 20:16:40 -07:00
Nic Cope 68a7580935 Add new resource claim reconciler.
Signed-off-by: Nic Cope <negz@rk0n.org>
2019-06-24 23:47:11 -07:00
Nic Cope b27d9df2c5 Update all API types to satisfy the Resource or Claim interfaces
There's _a lot_ going on in this commit. I've updated all resources to use the
embedded ResourceSpec, ResourceStatus, ResourceClaimSpec, etc structs and added
methods to ensure they satisfy the Resource and Claim interfaces.

I've also updated all controllers to suit. I've tried my best to limit the scope
of these changes to switching all controllers and their tests to:

* Use the new ConditionedStatus
* Use their WriteConnectionSecretTo field instead of generating a secret name
* Use the new ProviderReference field (which supports referencing Providers in
  a different namespace)

I also updated many tests to use the '-want, +got' style annotation. This came
into scope mostly for my own sanity, as it allows me to read all test output the
same way when updating tests across many packages.

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-06-24 16:10:18 -07:00
hasheddan 41f27d2ee2 test: removes log.Fatal and log.Panic
Logging altered for consistency across tests.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2019-05-19 19:38:58 -05:00
Nic Cope 177a831c9c Update tests for go-cmp compatibility
In all cases these updates address the fact that go-cmp requires the caller to
specify explicitly how it should handle unexported fields; cmp.Diff will
panic if it encounters an unexpected unexported field.

In many cases we encounter unexported fields while comparing errors types from
github.com/pkg/error. I've added an EquateErrors() comparer that maintains the
error comparison semantics of https://github.com/go-test/deep.

In most other cases I've also attempted to maintain the comparison semantics of
https://github.com/go-test/deep, which is to ignore unexported fields. In cases
where the test appeared to intend to compare the unexported fields of a type
under our control, and where comparing those unexported fields did not break the
test, I updated the test to compare unexported fields. In cases where the test
appeared to intend to compare unexported fields, but doing so broke the test, I
added a BUG comment.

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-05-06 17:44:44 -07:00
Nic Cope 9fac781a35 Add workload scheduler, application, and resource controllers
Note this refers to 'complex workloads' under the workload.crossplane.io API
group. An earlier version of the workload and scheduler controllers exists
under compute.crossplane.io.

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-05-01 13:40:55 -07:00
Illya Chekrygin b1abf78e87 Update (simplify) test environment in terms of handling: Schemas and go-client
Signed-off-by: Illya Chekrygin <illya.chekrygin@gmail.com>
2019-04-11 10:43:01 -07:00
Illya Chekrygin 64d1d97307 Update MockClient to complete with missing Mock functions
Signed-off-by: Illya Chekrygin <illya.chekrygin@gmail.com>
2019-03-26 16:30:38 -07:00
Nic Cope 426742395a Fix spelling mistakes detected by the misspell linter
Signed-off-by: Nic Cope <negz@rk0n.org>
2019-03-07 15:46:15 -08:00
Nic Cope 7c4f237826 Silence slice preallocation warnings
Both of these are false positives. We don't know exactly how long the slice will
be when we declare it. We should keep an eye on this linter to see how often it
catches real issues.

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-03-06 14:40:17 -08:00
Nic Cope cdc6baf200 Address unchecked error warnings
Signed-off-by: Nic Cope <negz@rk0n.org>
2019-03-06 14:40:17 -08:00
Nic Cope 274f45e80f Address stuttering type names
A name is said to 'stutter' when its name begins with the package name, so
callers would for example type `foo.FooClient` rather than `foo.Client`.

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-03-06 14:40:16 -08:00
Nic Cope bc90efad4f Address linter warnings about malformed or missing comments
This commit should only touch comments, or make types private to avoid them
needing a comment when they're not consumed outside their own package.

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-03-06 14:40:16 -08:00
Nic Cope 8c57a8bda5 Implement RedisCluster and CloudMemorystoreInstance controllers
I've experimented with a new pattern for the CloudMemorystore controller. My
goal was to achieve the testability of the existing blessed pattern (i.e.
replacable connect, create, sync, and delete methods), but with a stronger
decoupling of the components we'd like to test separately.

In my design Reconciler takes a connecter interface that knows how to return a
createsyncdeleter, i.e. an interface that can create, sync, and delete instances
with some external store. We instantiate a new createsyncdeleter on each
reconcile loop, allowing us to potentially use different credentials each run.

I also removed use of the Kubernetes clientset, which was used a few places in
other controllers despite (as best I can tell) being functionally equivalent to
the controller runtime client.Client.

Signed-off-by: Nic Cope <negz@rk0n.org>
2019-02-28 14:49:43 -08:00
Bassam Tabbara 2dde14c478 rename to crossplane
make build and make test now work.
2018-11-19 15:56:32 -08:00
ichekrygin 7567c89564 Implement Kubernetes Controllers 2018-11-10 20:53:49 -08:00