Commit Graph

48 Commits

Author SHA1 Message Date
Predrag Knezevic b5462b512d Add ability to expose resource reconciliation progress
* `status.observedGeneration` fields has been added to claim/composite/composed status,
  showing the latest metadata.generation which resulted in either a ready state,
  or stalled due to error it can not recover from without human intervention.
* `status.conditions[x].observedGeneration represents the .metadata.generation
  that the condition was set based upon

Signed-off-by: Predrag Knezevic <predrag.knezevic@upbound.io>
2024-04-09 11:04:31 +02:00
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
Dr. Stefan Schimanski 33981937cc
controller/engine: merge parent and local cache
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@upbound.io>
2023-10-13 11:48:06 +02:00
Predrag Knezevic 81b21d47fe fix(pkg/resource/composite) drop usage of ObjectReference in SetClaimReference
`spec.claimRef` schema is just subset of corev1.ObjectReference, and hence
`SetClaimReference` might get a reference that have more fields set, e.g. UID.
The fields that do not exist in claimRef schema must be not set on the underlying object,
otherwise K8s API server complains about non-existing field when client sends a patch request.

* Introduced `claim.Reference` type that corresponds to `spec.claimRef` schema.
* `composite.SetClaimReference` signature changed to accept an instance of `claim.Reference`
* appropriate tests updated/new tests added

Signed-off-by: Predrag Knezevic <predrag.knezevic@upbound.io>
2023-10-09 13:53:55 +02:00
Christopher Haar fd85873073 feat(remove): remove deprecated providerRef
Signed-off-by: Christopher Haar <christopher.haar@upbound.io>
2023-08-23 15:46:55 +02:00
lsviben 73a675c82c
implement granular managementPolicies
Signed-off-by: lsviben <sviben.lovro@gmail.com>
2023-07-13 13:43:34 +02:00
Mateusz Puczyński a5a6b69c4f
Add GetLogger method to fake.Manager
Signed-off-by: Mateusz Puczyński <mati6095@gmail.com>
2023-06-09 12:39:14 +02:00
Hasan Turken 79cb4c8ac1
Add management policy to managed
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2023-03-27 12:05:06 +03:00
Hasan Turken 112e9eda45
Add nolint directive for musttag on types used in unit tests
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2023-03-22 12:52:52 +03: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
ezgidemirel efc8702e31
Add composition revision selectors
Signed-off-by: ezgidemirel <ezgidemirel91@gmail.com>
2022-11-03 14:41:45 +03:00
Alper Rifat Ulucinar 31279534ed
Add omitempty json tag to fake.ConnectionDetailsLastPublishedTimer.Time field
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
2022-10-19 23:46:07 +03:00
Nic Cope bce61005a1
Merge pull request #355 from nokia/respect_finalizers
Support foreground cascading deletion
2022-10-11 18:39:34 -07:00
Bob Haddleton da77f4e104 Add blockOwnerDeletion: true and compositeDeletePolicy
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
2022-10-11 09:35:04 -05:00
Maximilian Blatt dfd468741d feat(composite): Add support for EnvironmentConfigs
Signed-off-by: Maximilian Blatt <maximilian.blatt-extern@deutschebahn.com>
(external expert on behalf of DB Netz AG)
2022-09-05 22:27:26 +02:00
Hasan Turken c8cc06c5fb
Implement ConnectionPropagator in connection.DetailsManager
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-09 12:43:53 +03:00
Hasan Turken 60059a2241
Add PublishConnectionDetailsTo to Composition types
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-09 12:43:53 +03:00
Hasan Turken 3ce0d92570
Refactor packages for connection details types and interfaces
Signed-off-by: Hasan Turken <turkenh@gmail.com>
2022-03-09 12:43:52 +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
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
Nic Cope cf744159e5 Allow XRs and XRCs to record when they last published connection details
This information is useful both for debugging XRs and XRCs, and for controllers
to watch for updates to connection details (i.e. if those details were stored in
an external system rather than in Secrets, which can themselves be watched).

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-11-05 04:12:20 +00:00
Nic Cope defa322852 Remove reconcilers and utilities pertaining to workloads
https://github.com/crossplane/crossplane/issues/1755

This removes support for the secret propagation and target controllers that each
Kubernetes Cluster managed resource implemented before workloads were deprecated.
See the above issue for context.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-16 19:54:18 -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 8f5be41347 Have GetCredentialsSecretReference operate on pointers
Credentials secrets are used by ProviderConfigs. They should be optional, since
a ProviderConfig may use a form of authentication that does not involve secrets.

This is a breaking API change, though I believe this interface was orphaned and
not actually in use anywhere.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-01 02:03:41 -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
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 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 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
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
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
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
Nic Cope da8cc179e7 Remove unused fake.Workload
This was for an OAM workload, that moved out to oam-kubernetes-runtime.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-24 12:06:27 -07:00
Nic Cope 477b9e592e Add fake composed, composite, and requirement resources.
We could also use pkg/resource/unstructured in tests, but I think this will
require a little less boilerplate to setup tests.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-23 21:34:33 -07:00
Nic Cope 357942c02d Add a "controller engine" that manages the lifecycles of controllers
A controller engine is somewhat like a controller "sub-manager", in that it's
effectively a group of controllers. Unlike a typical controller manager, the
lifecycle of the controllers an engine manages are not coupled to the lifecycle
of the engine itself. An engine may be used by a parent controller to start and
stop child controllers in accordance with configuration provided by the custom
resource that the parent controller watches.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-23 01:51:27 -07:00
Nic Cope 44099db82c Remove OAM code, which has moved to crossplane/oam-runtime
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-04-20 20:55:51 -07:00
hasheddan 57df15c56c
Make WorkloadReferencer use non-pointer types
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-03-19 16:54:20 -05: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
Muvaffak Onus 34f8959f86
Implement GetExternalTags to return Crossplane tags for managed resource controllers to tag their external resources
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2020-03-04 11:18:24 +03: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
Daniel Mangum 5ece4af54b Implement Target interface and reconciler (#103)
Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-01-14 12:36:41 -08:00
Muvaffak Onus 5a3ce4f6c8
Removed Mock word from mocks in package fake.
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2019-12-12 15:02:06 +03:00
Muvaffak Onus 3cf4bd1275
Move MockManager into fake package
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2019-12-11 16:06:14 +03:00