Commit Graph

9 Commits

Author SHA1 Message Date
Steven Borrelli 53155a2d18 update comments to match resource type
Signed-off-by: Steven Borrelli <steve@borrelli.org>
2024-05-20 14:03:52 -05:00
Steven Borrelli 434972f741 fix lint error
Signed-off-by: Steven Borrelli <steve@borrelli.org>
2024-05-20 13:59:50 -05:00
Steven Borrelli 8ff4cae190 add observedGeneration
Signed-off-by: Steven Borrelli <steve@borrelli.org>
2024-05-20 13:54:35 -05:00
Nic Cope 82371e39a6 Clear out empty object metadata if it exists after conversion
Without this change any resource that has no ObjectMeta will end up with
an empty metadata (like "metadata": {}) when rendered. This is because
json serialization adds the generation field. We then delete it,
resulting in an empty metadata object.

This isn't actually so bad because Crossplane will always add a few
labels, owner refs, etc before the metadata becomes part of the SSA
fully-specified intent. So in reality we'll never ask the API server to
make metadata an empty object. It is misleading in unit tests though.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-10-30 15:47:14 -07:00
Nic Cope 810689042b Use a runtime.Scheme to load GVK using From
I don't love the package-scoped state here but this seems like the
nicest API to offer callers.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-10-30 00:08:48 -07:00
Nic Cope 09f878b7bf Use go-json-experiment (and hacks) to trim empty fields
This is necessary for functions to be able to return JSON (as
structpb.Struct) that can be used as server side apply fully specified
intent. Without it we include empty structs that are non-nil, even if
they have the omitempty marker.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-10-30 00:08:48 -07:00
Steven Borrelli 66fe852bf9
Sync with upstream crossplane-runtime changes
* Bump crossplane-runtime
* Update GetInteger to handle floats locally
* Use new claim.Reference type

Signed-off-by: Steven Borrelli <steve@borrelli.org>
2023-10-24 14:16:20 -07:00
Nic Cope 391e26d51d Make GetInteger work with 'normal' non-Kubernetes JSON data
Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-09-28 22:12:58 -07:00
Nic Cope efcec9694a Automatically fieldpath.Pave composite and composed resources
This makes it more convenient and discoverable to get and set arbitrary
unstructured data from a composed or composite resource.

Signed-off-by: Nic Cope <nicc@rk0n.org>
2023-09-28 20:04:38 -07:00