Commit Graph

956 Commits

Author SHA1 Message Date
Daniel Mangum ae2a3820ee
Merge pull request #214 from wonderflow/test
add more test about periods
2020-10-09 07:11:43 -05:00
天元 9cfceb906e add more test about periods
Signed-off-by: 天元 <jianbo.sjb@alibaba-inc.com>
2020-10-09 19:38:33 +08:00
Nic Cope 51c117eff5
Merge pull request #212 from negz/pro
Introduce a distinct ProviderConfig credentials field
2020-10-07 23:55:23 -07: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 b7c00eed19
Merge pull request #213 from negz/referr
Clarify reference resolution errors slightly
2020-10-06 16:42:09 -07:00
Nic Cope ba53a74b97 Clarify reference resolution errors slightly
This makes it a little more obvious where errors are happening; i.e. during
reference selection or resolution.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-06 16:19:53 -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 8d3f2de53d Bump build submodule
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-05 17:31:22 -07:00
Daniel Mangum dc04a11d00
Merge pull request #211 from hasheddan/lintroller
Move common package linter functionality to crossplane-runtime
2020-10-05 09:01:16 -05:00
hasheddan 9918fd7907
Move common linter functionality to parser pkg
Downstream consumers may implement their own linter functions, but the
core linter loop can be generalized, as well as helper functions such as
Or.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-10-05 08:02:55 -05:00
hasheddan 94f307fb2a
Rename DefaultParser to PackageParser
DefaultParser is not descriptive of the Parser implementation's purpose.
PackageParser indicates the this parser is meant for parsing packages.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-10-03 09:56:13 -05:00
Nic Cope 3f1afd106a
Merge pull request #209 from negz/useful
Add a resource.Tracker interface
2020-10-01 16:43:08 -07:00
Nic Cope 47591b4556 Add a resource.Tracker interface
I was originally thinking this wouldn't be useful, but I'm starting to find some
places it could help with testing. It may also help switch out implementations
in future.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-01 16:35:40 -07:00
Nic Cope ac14aba9a2
Merge pull request #206 from negz/useful
Add machinery for tracking ProviderConfig usage
2020-10-01 15:40:39 -07:00
Nic Cope 4bbd106995
Merge pull request #208 from hasheddan/ci-bump
Bump golangci-lint timeout
2020-10-01 15:39:45 -07:00
hasheddan 48537c7b96
Bump golangci-lint timeout
Bumps the timeout for golangci-lint from the default 1m duration to
match the build submodule lint timeout, which is 10m.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-10-01 17:08:08 -05: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 2e97ada425 Rename UsageTracker to ProviderConfigUsageTracker
This name is a clearer to consumers than resource.UsageTracker.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-01 02:40:26 -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 fe70284573 Update user count when we're being deleted, too
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-10-01 02:03:41 -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 8a38602388
Merge pull request #207 from negz/lintastic
Match crossplane/crossplane build and GitHub configuration
2020-09-26 17:11:34 -07:00
Nic Cope 0a1513a2de Bump build package for new golangci-lint
Address a few (mostly) false positives introduced by the new linter.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-26 15:35:20 -07:00
Nic Cope 0d86652d2b Update .github to match crossplane/crossplane
This commit syncs our issue/PR templates and workflows with c/c.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-26 15:17:01 -07:00
muvaffak onuş 240dbf0821
Merge pull request #203 from muvaf/fix-provella
managed reconciler: external.Connect should be called after initializers and ref resolvers
2020-09-24 17:49:23 +03:00
Muvaffak Onus fa795a5625
managed reconciler: external.Connect should be called after initializers and reference resolvers
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2020-09-23 19:04:21 +03:00
muvaffak onuş e1fc0493b2
Merge pull request #202 from muvaf/providebydefault
Default ProviderConfig is automatically selected
2020-09-23 14:18:51 +03:00
Nic Cope 7ad38b523a
Merge pull request #201 from negz/rip
Remove support for resource claims and classes
2020-09-22 16:37:40 -07:00
Muvaffak Onus de46c556cf
add an initializer that will have managed resources without any ProviderConfig reference use the default one
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2020-09-21 21:01:37 +03: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 e7742464e4
Merge pull request #200 from negz/controlfreak
Indicate whether Apply errors are due to a resource being uncontrollable
2020-09-17 18:48:29 -07:00
Nic Cope b3fa859660 Indicate whether Apply errors are due to a resource being uncontrollable
This allows users of the MustBeControllableBy ApplyOptions to determine how to
handle the case in which a resource cannot be applied because it is not
controllable - e.g. to abort the apply operation without returning an error.

Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-17 18:27:27 -07:00
muvaffak onuş 23650e1146
Merge pull request #199 from muvaf/paveme
fieldpath: add GetInteger to retrieve int64 number
2020-09-14 21:25:58 +03:00
Muvaffak Onus c714c6dceb
fieldpath: update unit tests to use the same json marshal/unmarshaller as apimachinery
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2020-09-14 21:08:51 +03:00
Nic Cope 13ab859896
Merge pull request #197 from negz/derp
Mark Claim and KubeApp reconcilers deprecated.
2020-09-10 19:39:49 -07:00
Muvaffak Onus 9c0d784174
fieldpath: add GetInteger to retrieve int64 number
Signed-off-by: Muvaffak Onus <onus.muvaffak@gmail.com>
2020-09-10 18:31:51 +03:00
Nic Cope 9b321c2bc8
Merge pull request #196 from negz/reasonable
Remove unused conditions, and make the rest CamelCase
2020-09-09 15:52:16 -07:00
Nic Cope 1be4d27264 Mark Claim and KubeApp reconcilers deprecated.
Signed-off-by: Nic Cope <negz@rk0n.org>
2020-09-09 15:51:15 -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
Daniel Mangum c8aaffcea5
Merge pull request #195 from hasheddan/typedrefto
Add TypedReferenceTo meta utility
2020-09-09 11:37:03 -05:00
hasheddan abf412a469
Remove ObjectReference comment
Removes outdated comment suggesting using ObjectReference as function
parameters as we now prefer to use a more scoped reference type.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-09 11:24:33 -05:00
hasheddan 1d97e32d05
Accept TypedReference in AsOwner and AsController
This updates the AsOwner and AsController to use TypedReference, which
is a more scoped version of ObjectReference that still contains all
necessary fields to create a controller or owner reference for an
object.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-08 10:13:15 -05:00
hasheddan adb65bc635
Mark ReferenceTo as deprecated
ReferenceTo returns a pointer to an ObjectReference, which should be
avoided in favor of a more scoped reference type.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-07 16:27:42 -05:00
hasheddan c9515a5a0e
Add TypedReferenceTo meta utility
Adds a TypedReferenceTo utility function that matches the ReferenceTo
implementation for ObjectReference, but returns a TypedReference
instead.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-07 12:34:48 -05:00
Daniel Mangum 93d35e712a
Merge pull request #194 from hasheddan/parser
Add package parser
2020-09-06 17:28:23 -05:00
hasheddan 0920efd331
Accept ObjectCreaterTyper interface instead of runtime.Scheme directly
Because the parser eventually passes a runtime.Creater and runtime.Typer
to the underlying serializer, we only require that the passed schemes
implement those interfaces, rather than require that they be
*runtime.Scheme explicitly.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-06 17:08:31 -05:00
hasheddan 49da505413
Add package parser
Adds a package parser and a variety of backends that reads from a YAML
stream, accepting objects that are either part of the meta or object
runtime.Scheme and returning them as a Package.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-09-04 19:59:50 -05:00