crossplane / crossplane/upjet

Consider moving/removing adding default tags in Initialize step

Open
#222 1 comment 2 reactions 0 assignees View on GitHub
enhancement is:triaged v2
Dominant language
Go
Stars
481
Forks
131
Avg merge
2d 1h
Merged PRs (30d)
11

Description

### What problem are you facing?

With the [new granular management policies ](https://github.com/crossplane/crossplane/blob/952b124c6d8b75d827df84b77b6783c8c3f88ee0/design/one-pager-ignore-changes.md) users will be able, among others, to ignore changes in select fields by
skipping the late initialization through dropping the "LateInitialization" ManagementPolicy and/or setting initial fields
which are used only during the creation of the resource in `spec.initProvider`.

All in all, the goal is not to have the field we want to ignore changes for in the `spec.forProvider`.

But due to the special case of `tags` which are being added to `spec.forProvider` in the [Initialize step](https://github.com/crossplane/crossplane-runtime/blob/1316ae6695eec09cf47abdfd0bc6273aeaab1895/pkg/reconciler/managed/reconciler.go#L742) of the reconciler,
the tags are always present in the `spec.forProvider` which makes it impossible to ignore them.

[Upjet Initialize code](https://github.com/upbound/upjet/blob/645d7260d814cb67db2280e92988051d30774a09/pkg/config/resource.go#L227-L249)
[Example provider aws resource](https://github.com/crossplane-contrib/provider-aws/blob/37542c0fbb1f83f1fc18a099393bba18fddecc1d/pkg/controller/dynamodb/table/hooks.go#L142C78-L166)

Those tags are just some default tags that state:
`crossplane-kind`
`crossplane-name`
`crossplane-providerconfig`

I am not sure if those tags are just informational or used somewhere

### How could Upjet help solve your problem?

Depending on the importance of adding the default tags we could consider:
- drop adding the tags to `spec.forProvider` altogather
- move adding the default tags to the Create step, so we don't initialize them every reconciler run
- TBD

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.