Commit Graph

83 Commits

Author SHA1 Message Date
Hasan Turken 79ea2fe449
Add comment for linter and use types.UID for uid parameter
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-15 10:29:23 +03:00
Hasan Turken 80debfade8
Fix owner not being set for delete
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-11 22:34:48 +03:00
Hasan Turken ff57cdc7c4
Ensure secret owned by object before delete
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-11 10:29:34 +03:00
Hasan Turken 86fb15da2c
Extend Secret Store interface with more power
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-10 18:10:52 +03:00
Hasan Turken 867c9bb8e8
Track connection secret owner with label
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-10 09:56:04 +03:00
Hasan Turken 2f224692a9
Use store.KeyValue in connection.store package
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-09 14:46:59 +03:00
Hasan Turken c55240a2a2
Add PublishConnectionDetailsTo to Managed resource spec
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-09 12:43:52 +03:00
Hasan Turken d591b5e442
Vault ESS - resolve comments and add support for custom CA bundle
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-07 23:47:37 +03:00
Hasan Turken df72fd3089
Add unit tests for Vault KV client
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-02 21:00:04 +03:00
Hasan Turken 551b414fc8
Use metadata API with scheme
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-02 21:00:04 +03:00
Hasan Turken ac03ae3946
Add initial implementation Vault as Secret Store
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-02 21:00:04 +03:00
Hasan Turken ae55806eb4
Add token auth config to api
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-02 21:00:03 +03:00
Hasan Turken 31cce62ecf
Mark connection secret metadata fields as optional
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-02 09:20:08 +03:00
Hasan Turken 06c155d60b
Define scheme for connection secret metadata
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-01 14:20:15 +03: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 258add4288
Resolve first pass of comments in ESS foundation
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-17 16:28:52 +03:00
Hasan Turken 88c4d273a5
Remove publishConnectionDetailsTo from managed resource spec
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-16 11:32:34 +03:00
Hasan Turken 3c908b7855
Refactor naming and package structure
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-02-15 17:08:28 +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 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 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
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 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 ba474e81c6
Merge pull request #273 from negz/revupyourengines
Add composition revision support to XRs and XRCs
2021-08-11 19:00:58 -07:00
Alper Rifat Ulucinar 4d6ec580be
Do not append duplicate slice elements when MergeOptions.AppendSlice is set
- Move resource.WithMergeOptions to core Crossplane and unexport
- Move fieldpath.object functions to core Crossplane and unexport
- Move fieldpath.MergeValue & related functions to its own file
- Add tests for fieldpath.MergeValue

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
2021-08-04 21:38:43 +03:00
Alper Rifat Ulucinar e7b4a22e42
Add Paved.MargeValue method
- Add "fieldpath/object" package that deals with runtime.Objects
- Move MergeOptions struct to package "apis/common/v1".

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
2021-08-02 14:19:03 +03:00
Nic Cope cb68ff958f Add composition revision support to XRs and XRCs
Signed-off-by: Nic Cope <negz@rk0n.org>
2021-07-22 00:51:16 +00:00
Nic Cope 50745b7338 Have managed resource DeletionPolicy default to 'Delete'
Signed-off-by: Nic Cope <negz@rk0n.org>
2021-03-15 22:03:42 +00:00
Nic Cope 824eb6919d Use OpenAPI to set the default ProviderConfig
This allows us to avoid an extra update call to the API server when new managed
resources are created.

Signed-off-by: Nic Cope <negz@rk0n.org>
2021-03-11 08:02:04 +00:00
hasheddan 10b4720142
Replace ProviderConfigSpec with embeddable CredentialsSelectors
To allow for more flexible credential methods, we provide common
selectors but do not enforce source enum or restrict from adding
additional selectors. The CredentialsSelectors are meant to be embedded
inline in a ProviderConfig's spec.credentials object.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2021-02-01 16:11:47 -06:00
hasheddan 52cc9b82b7
Move embedded API types to v1
Moves the core embedded API types out of the core/v1alpha1 directory and
into common/v1. These types are used by many mature APIs and are now
recognized as stable. This new package should be imported with alias
xpv1 by convention.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-11-19 20:01:01 -06:00
Nic Cope ab7ab7c7c2 Add docstring and enum validation for credentials secret source
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-07 15:20:16 -07:00
Nic Cope a0ec116066 Rename 'Native' credentials source to 'InjectedIdentity'
After some discussion amongst the community we felt this more accurately
represents a credentials source where credentials are derived from the
provider pod's identity (i.e. env vars, files, etc).

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-06 21:25:59 -07:00
Nic Cope 407dc9fa43 Introduce a distinct ProviderConfig credentials field
This field distinguishes credentials configuration from other (currently
hypothetical) aspects of provider configuration. It also introduces a
'spec.credentials.source' field that can be used to determine which credentials
source the provider intends to use.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-05 20:05:01 -07:00
Nic Cope 25ba6512d0 Set the 'Terminating' condition on blocking ProviderConfigs
This cocndition indicates that a ProviderConfig is being deleted, but blocking
because it still has users. The condition mirrors the similar PVC condition.
There is no inverse of 'Terminating', because a ProviderConfig cannot recover
from the condition.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-01 03:28:33 -07:00
Nic Cope be1324de71 Add a utility to track ProviderConfig usages
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-01 02:33:12 -07:00
Nic Cope 529fb076ce Add machinery for tracking ProviderConfig usage
This commit adds a reconciler and some utiltiies that allow Crossplane providers
to track the usage of their ProviderConfig resources. To do so, a provider must:

* Apply a ProviderConfigUsage each time a managed resource successfully connects
  to its external API using a ProviderConfig (or is reasonably expected to be
  about to do so). The Apply should be a no-op if there is an existing
  ProviderConfigUsage for the managed resource - the IsNotAllowed ApplyOption
  may be used to establish this.
* Start a controller that watches for ProviderConfigs and ProviderConfigUsages
  using the supplied providerconfig.Reconciler.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-01 02:03:41 -07:00
Nic Cope 95d71dbd91 Remove support for resource claims and classes
See https://github.com/crossplane/crossplane/issues/1670 for context.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-20 17:46:06 -07:00
Nic Cope 1121c851c5 Remove or relocate deprecated status conditions
The references resolved condition was marked deprecated in v0.8 and has no known
callers. The secret resolution success condition is only used by the target
controller.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-09 15:14:24 -07:00
Nic Cope 5b15db1f2a Make core status conditions CamelCase per API conventions
https://github.com/kubernetes/community/blob/493639d/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-09 14:47:24 -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
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 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 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
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
Nic Cope b9255d7fcc Simplify resource references, and introduce reference selection
This commit introduces managed.APISimpleReferenceResolver, which satisfies the
managed.ReferenceResolver interface. This variant requires much less plumbing
and reflection because it expects that managed resources expose a single
ResolveReferences method that will optionally select and then resolve any
resource references. It also adds a new pkg/reference which contains a library
that managed resource authors _may_ choose to use to avoid reimplementing common
reference selection and resolution logic.

The existing managed.APIReferenceResolver implementation remains the default,
but is marked deprecated and will be removed once all managed resources use the
APISimpleReferenceResolver. Notably, the "reference resolution" condition is no
longer set by managed.Reconciler - managed resources will report reference
resolution issues via the Synced condition (i.e. as a ReconcileError).

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-15 13:59:53 -07:00
Nic Cope 6bbfa9e0d6 Add Reference and Selector types
These will be used for cross resource references, though they could also be used
in other contexts.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-14 17:57:29 -07:00
hasheddan 7d845c0a81
Add TypedObjectReference and use in OAM reconcilers
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-03-18 21:49:28 -05:00