Commit Graph

956 Commits

Author SHA1 Message Date
hasheddan 76c547909e
Add FsReadCloser to implement io.ReadCloser for a filesystem
Implements io.ReadCloser for afero.Fs to allow passing it to a parser
that accepts an io.ReadCloser and reads from it.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-04 19:59:49 -05:00
Nic Cope d1a4dd4a56
Merge pull request #193 from negz/tool
Remove dependency on crossplane-tools
2020-09-04 17:46:14 -07:00
Nic Cope f5756503c5 Remove dependency on crossplane-tools
I'm not sure how we ended up with this, given it isn't used/

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-04 17:15:26 -07:00
Daniel Mangum 938e74dc71
Merge pull request #192 from hasheddan/fix-updater
Update with desired object in APIUpdatingApplicator
2020-09-04 13:48:39 -05:00
hasheddan a23862526f
Assert to resource.Object once in APIUpdatingApplicator
This eliminates an extraneous assertion to metav1.Object in the Apply
method of the APIUpdatingApplicator by asserting to resource.Object at
the beginning of the function.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-04 09:33:44 -05:00
hasheddan 2274effb45
Update with desired object in APIUpdatingApplicator
This modifies the behavior of the APIUpdatingApplicator to update with
the desired object by setting its resource version to that of the
current. This ensures that a successful update will result in the object
being modified to match the desired by default. Consumers of this
Applicator no longer are required to pass in an UpdateFn to avoid no-op
updates.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-03 22:37:14 -05:00
Daniel Mangum 1576699ee9
Merge pull request #190 from hasheddan/bump-k8s1.18.6
Bump controller-runtime to v0.6.2 and k8s deps to v0.18.6
2020-08-31 09:22:37 -05:00
hasheddan 1b41292ed2
Bump controller-runtime to v0.6.2 and k8s deps to v0.18.6
Updates controller-runtime and pins k8s dependencies to v0.18.6, which
is used by controller-runtime for the v0.6.2 release.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-08-28 16:26:52 -05:00
muvaffak onuş 29150890d4
Merge pull request #189 from muvaf/providemeconfig
Add reference for ProviderConfig objects and deprecate Provider reference
2020-08-27 16:49:51 +03:00
Muvaffak Onus 367fa803d9
Add reference for ProviderConfig objects and deprecate Provider references
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2020-08-27 14:59:31 +03:00
Nic Cope 7e3587dc0b
Merge pull request #187 from negz/claim-2-the-claimening
Rename 'requirement' to 'claim'
2020-08-19 10:14:34 -07:00
Nic Cope 76a692ce94 Don't require composite resources to be reclaimable
https://github.com/crossplane/crossplane-runtime/pull/186

This change should have been included in the above PR; composite resources
no longer have a reclaim policy and instead are immediately deleted when
their claim (nee requirement) is deleted.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-08-18 19:33:28 -07:00
Nic Cope dbf0f9af21 Rename 'requirement' to 'claim'
Crossplane composite resources are cluster scoped, but they can be 'published'
to create a namespaced proxy resource. We called this resource a 'requirement',
despite it being conceptually quite similar to our existing (and deprecated)
'resource claim' concept. We've found that the 'publish a requirement' concept
has not resonated with the community and have decided to switch our terminology.

Under this new approach platform builders may choose to enable platform operators
to 'offer' (not publish) a composite resource to their platform consumers. The
namespaced interface to these composite resources will be known as a 'claim' or
'composite resource claim'. Note that we think platform builders and operators
are the key audience for these concepts; platform consumers will simply think of
themselves as using the resource as its kind indicates - e.g. 'a Kubernetes
cluster' or 'an SQL instance', not 'an SQL instance claim'.

In some cases our existing but deprecated resource claim concept has name
conflicts with this new take on the claim concept - i.e. the resource.Claim
interface. In those cases I've named the new type CompositeClaim to distinguish
it.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-08-18 19:33:28 -07:00
Nic Cope f70051c0e6
Merge pull request #186 from negz/reclamation
Remove reclaim policy from composite resources
2020-08-13 18:23:25 -07:00
Nic Cope e88567435c
Merge pull request #185 from negz/derp
Introduce a deletion policy, and deprecate the reclaim policy.
2020-08-13 11:29:28 -07:00
Nic Cope c7b7ea8043 Remove reclaim policy from composite resources
See https://github.com/crossplane/crossplane-runtime/issues/179 for context.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-08-12 17:09:59 -07:00
Nic Cope 8e173f4a75 Default to deleting, not retaining, external resources.
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-08-12 16:32:55 -07:00
Nic Cope 72cd5521e6 Rename the Deletable interface to Orphanable
This interface represents a resource with a deletion policy; i.e. a resource
whose underlying external resource may either be deleted or orphaned when the
it is deleted.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-08-12 13:03:51 -07:00
Nic Cope 5c5d8932d3 Introduce a deletion policy, and deprecate the reclaim policy.
The deletion policy is a more narrowly scoped variant of the reclaim policy. It
affects only whether exeternal resources are deleted or orphaned when their
corresponding managed resource is deleted, as opposed to the reclaim policy
which also affects whether the managed resource is deleted when its bound claim
is deleted.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-08-11 18:24:16 -07:00
Nic Cope 8c96c010f5 Mark additional references to the class and claim pattern deprecated.
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-08-11 11:27:08 -07:00
Daniel Mangum 9a9a434f73
Merge pull request #182 from hasheddan/scopedrefs
Use Reference type for provider references
2020-06-29 12:09:15 -05:00
hasheddan e130a99a00
Do not use pointer for Provider references
Provider reference is a required field for types that embed it. In
practice, accessing the Name field of a Provider reference should never
result in a nil pointer dereference, but it is still an unsafe
operation. Changing the Provider reference to a non-pointer absolves the
user from checking for a nil reference each time it is used.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-06-26 10:19:28 -05:00
hasheddan c5b903fedd
Use Refernce type for provider references
We are currently using corev1.ObjectReference for provider resources.
This includes more information than needed and encourages
using helper methods that may depend on other fields in the type that we
do not intend to be utilized. This updates provider references
fields to use the Reference type, which only has a name field.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-06-25 14:59:52 -05:00
Jared Watts 4cb7486a71
Merge pull request #181 from jbw976/owners-update
governance: add OWNERS.md to define maintainers of this repo
2020-06-11 11:32:56 -07:00
Jared Watts 4ddb0c50f0
governance: add OWNERS.md to define maintainers of this repo
Signed-off-by: Jared Watts <jbw976@gmail.com>
2020-06-11 11:18:59 -07:00
Nic Cope 290de73499
Merge pull request #176 from hasheddan/resverauto
Update with object that is gotten in APIUpdatingApplicator
2020-05-12 13:45:08 -07:00
hasheddan a964b65a29
Add UpdateFn for mutating ApplyOptions
Add an UpdateFn wrapper around ApplyOption that simplifies
the interface for passing a mutating function to
APIUpdatingApplicator.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-05-12 15:35:54 -05:00
hasheddan 3420b651d6
Update with object that is gotten in APIUpdatingApplicator
This changes APIUpdatingApplicator to make its Update call
with the object it gets rather than the one passed so that
the default behavior is a no-op rather than a guaranteed
error on mismatched resource versions.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-05-12 15:15:27 -05:00
Nic Cope 926e1887b1
Merge pull request #175 from negz/somewhatbounded
Bind and unbind managed resources conservatively
2020-05-08 17:25:34 -07:00
Nic Cope 72789b40db Refuse to bind claims to controlled managed resources
This will ensure resource claims don't bind to managed resources that are part
of a composite resource while these two features live side by side. I suspect it
will also nesure resource claims don't bind to a managed resource produced by a
stack. As far as I know we don't have any use cases in which a stack creates a
managed resource that is expected to be claimable.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-05-08 15:42:08 -07:00
Nic Cope 8f8929a0a8 Ensure resources reference the claim that is trying to bind or unbind them
This gates against two possible issues:

1. Claim A dynamically provisions managed resource M. Claim B runs and wins a
   race against Claim A to bind to the newly provisioned and bindable M.
2. Claim A dynamically provisions managed resource M. Claim B explicitly sets
   its resource reference to M, and is then deleted, thereby deleting M which it
   was never bound to and did not dynamically provision.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-05-07 16:02:24 -07:00
Nic Cope 03cf9993f6
Merge pull request #174 from kasey/delete-hardest
Don't wait for IsBindable before calling AddFinalizer
2020-05-07 16:01:05 -07:00
Kasey Kirkham dccc18c2df AddFinalizer before we attempt to provision or bind to a managed resource.
Signed-off-by: Kasey Kirkham <kasey@upbound.io>
2020-05-07 14:20:15 -07:00
Nic Cope 21d9cb6ea9
Merge pull request #171 from hasheddan/4ground
Delete CRDs in foreground at end of test run
2020-04-29 12:51:44 -07:00
Nic Cope 16dbc007aa
Merge pull request #170 from muvaf/fakefix
Add missing field to fake.Composite
2020-04-29 11:47:24 -07: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
Muvaffak Onus 1ddc2c5d8d
Add missing field to fake.Composite to satisfy resource.Composite interface
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2020-04-29 17:11:34 +03:00
Nic Cope 05ca13f8ea
Merge pull request #169 from negz/strayedfromthepath
Make it possible to distinguish fieldpath.IsNotFound errors
2020-04-28 22:42:36 -07:00
Nic Cope bd09d0c8f4 Make it possible to distinguish fieldpath.IsNotFound errors
https://github.com/crossplane/crossplane/issues/1455

See the above issue for a use case; this will allow the composition patching
functionality to ignore this error.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-28 21:36:06 -07:00
Nic Cope 4e5f08ced5
Merge pull request #167 from muvaf/mockme
Export mock secret owner structs to be used in tests outside this repo
2020-04-28 19:19:25 -07:00
Nic Cope 30263ce18b
Merge pull request #168 from muvaf/ctrl-runtime-upd
Update controller-runtime dependency to the latest release
2020-04-28 19:18:06 -07:00
Muvaffak Onus b5206ecd68
Export mock secret owner structs to be used in tests outside this repo
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2020-04-29 03:36:46 +03:00
Muvaffak Onus cc12bb7b64
Update controller-runtime dependency to the latest release.
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2020-04-29 03:13:29 +03:00
Nic Cope 3dbd603092
Merge pull request #163 from negz/woof
Add a Reviewdog Github action
2020-04-26 17:16:31 -07:00
Nic Cope d3582bab01 Add a Reviewdog Github action
https://github.com/reviewdog/

This should cause a Reviewdog bot to comment on PRs with linter violations,
replacing the sunset https://golangci.com/ service.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-26 16:37:02 -07:00
Nic Cope 5622f15b70
Merge pull request #162 from negz/justatest
Add unit tests for pkg/resource/unstructured
2020-04-26 14:56:34 -07:00
Nic Cope 51ebec91a3 Add tests for unstructured wrappers.
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-25 21:32:29 -07:00
Nic Cope 6382f8b98c Add tests for unstructured.WrapperClient
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-25 20:03:59 -07:00
Nic Cope 100af7315c unstructured.WrapperClient nitpicks
Add a package docstring, and returns a concrete type rather than an interface
where possible.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-25 18:40:05 -07:00
Nic Cope 10ecf0f09a
Merge pull request #161 from negz/outofcontrol
Expand support for unstructured types
2020-04-24 14:32:13 -07:00