crossplane / crossplane/upjet

Up-to-date check is broken for resources that have a map to be late-initialized

Open
#84 1 comment 0 reactions 0 assignees View on GitHub
bug reconciler v2
Dominant language
Go
Stars
481
Forks
131
Avg merge
2d 1h
Merged PRs (30d)
11

Description

### What happened?

When a resource has a map field with at least one value, it's not late-initialized because the field [is considered](https://github.com/upbound/upjet/blob/9cfb1f0/pkg/resource/lateinit.go#L236) to have non-zero value, hence the user's desire about the field. However, in some cases, external APIs assign defaults to other fields of the same map. So, you end up with a map that is not late initialized but also doesn't match what's in the cloud API, so it repeatedly reports that `resource is not up to date`.

### How can we reproduce it?

`aws_backup_region_settings` resource gets to `Ready` and `Synced` states but it never marks `Test` state to be `True`, which is how we make sure resource gets into a stable state where there is no update needed. So, at every reconcile, it requests the update call to be made. The reason is that it has two maps under `spec.forProvider` and if you give only some of the fields, then it reports diff since it can't fill the rest with late-init.

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.