Commit Graph

7 Commits

Author SHA1 Message Date
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
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 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
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 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
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