Skip to content

Generation number doesn't seem correctly set on cached builtin resources. #2935

Closed
kcp-dev/kubernetes
#132
@davidfestal

Description

@davidfestal

When completing the replication_test.go e2e cache test with replication scenarios of rbac resources (CR / CRB objects), the generation is not equal when comparing original and cached objects.

I added a TODO in the completed test:

// TODO(davidfestal): find out why the generation is not the same especially for rbacv1. Is it a characteristic of all
// internal KCP resources (which are not backed by CRDs) ?
if b.gvr.Group == rbacv1.SchemeGroupVersion.Group {
unstructured.RemoveNestedField(originalResource.Object, "metadata", "generation")
unstructured.RemoveNestedField(cachedResource.Object, "metadata", "generation")
}
unstructured.RemoveNestedField(cachedResource.Object, "metadata", "annotations", genericapirequest.AnnotationKey)
if cachedStatus, ok := cachedResource.Object["status"]; ok && cachedStatus == nil || (cachedStatus != nil && len(cachedStatus.(map[string]interface{})) == 0) {
// TODO: worth investigating:

Maybe the work done for CRD-backed resources in this PR should also be done for built-in resources that support replication ?

Metadata

Metadata

Assignees

Labels

lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions