Closed stevekuznetsov closed 1 year ago
/cc @davidfestal /assign @jmprusi
@ncdc we see this in the audit logs:
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "e4e88650-404e-49cb-9c4a-e622aae5a0ac",
"stage": "ResponseComplete",
"requestURI": "/apis/apps/v1/namespaces/test-syncer/deployments",
"verb": "create",
"userAgent": "syncer.test/v0.0.0 (linux/amd64) kubernetes/$Format",
"objectRef": {
"resource": "deployments",
"namespace": "test-syncer",
"name": "syncer-test",
"apiGroup": "apps",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 201
},
"requestObject": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"creationTimestamp": null,
"name": "syncer-test"
}
},
"responseObject": {
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"annotations": {
"kcp.dev/cluster": "root:e2e-org-9ps42:e2e-workspace-88h9q"
},
"creationTimestamp": "2022-10-27T23:29:49Z",
"generation": 1,
"name": "syncer-test",
"namespace": "test-syncer",
"resourceVersion": "13791",
"uid": "807b2835-4f7d-49cd-83e9-afc4bd110e8b"
}
},
}
This is leading us to believe that the *rest.Storage
created for this CRD in customresource_handler.go
at least temporarily is missing structural schemas or something. We're almost certain that the client is actually passing spec & status, the server is just ignoring them. We've added a logging PR kcp-dev/kcp#2279 to confirm that.
After merging: https://github.com/kcp-dev/kcp/pull/2279
Seems that the client is sending the correct information, and something is removing the spec:
=== CONT TestSyncerLifecycle
syncer_test.go:186: difference between what we sent and what we got: &v1.Deployment{
TypeMeta: v1.TypeMeta{
- Kind: "Deployment",
+ Kind: "",
- APIVersion: "apps/v1",
+ APIVersion: "",
},
ObjectMeta: v1.ObjectMeta{
Name: "syncer-test",
GenerateName: "",
- Namespace: "",
+ Namespace: "test-syncer",
SelfLink: "",
- UID: "",
+ UID: "b9a85a25-99fb-4f62-8802-1558d970abc1",
- ResourceVersion: "",
+ ResourceVersion: "12586",
- Generation: 0,
+ Generation: 1,
- CreationTimestamp: v1.Time{},
+ CreationTimestamp: v1.Time{Time: s"2022-10-28 13:39:37 +0000 UTC"},
DeletionTimestamp: nil,
DeletionGracePeriodSeconds: nil,
Labels: nil,
- Annotations: nil,
+ Annotations: map[string]string{"kcp.dev/cluster": "root:e2e-org-mt5c4:e2e-workspace-rxljt"},
OwnerReferences: nil,
Finalizers: nil,
... // 2 identical fields
},
Spec: v1.DeploymentSpec{
- Replicas: &1,
+ Replicas: nil,
- Selector: s"&LabelSelector{MatchLabels:map[string]string{app: nginx,},MatchExpressions:[]LabelSelectorRequirement{},}",
+ Selector: nil,
Template: v1.PodTemplateSpec{
ObjectMeta: v1.ObjectMeta{
... // 8 identical fields
DeletionTimestamp: nil,
DeletionGracePeriodSeconds: nil,
- Labels: map[string]string{"app": "nginx"},
+ Labels: nil,
Annotations: nil,
OwnerReferences: nil,
... // 3 identical fields
},
Spec: v1.PodSpec{
Volumes: nil,
InitContainers: nil,
- Containers: []v1.Container{
- {
- Name: "busybox",
- Image: "ghcr.io/distroless/busybox:latest",
- Command: []string{"/bin/sh", "-ec", "echo \"Going to sleep\"\ntail -f /d"...},
- },
- },
+ Containers: nil,
EphemeralContainers: nil,
RestartPolicy: "",
... // 31 identical fields
},
},
Strategy: {},
MinReadySeconds: 0,
... // 3 identical fields
},
Status: {},
}
syncer_test.go:190: Waiting for upstream deployment test-syncer/syncer-test to get the syncer finalizer
flaky test run: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/kcp-dev_kcp/2180/pull-ci-kcp-dev-kcp-main-e2e-shared/1585987621723574272
Suggest checking pruning mechanics maybe?
Parallelization is maybe an issue (load on server)
Maybe server side apply
@stevekuznetsov are you still looking into this?
I wanted you and I to dig into this - just need debugging in the CRD handlers to figure out the race.
Fixed by kcp-dev/kcp#2505
Describe the bug
https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/kcp-dev_kcp/2275/pull-ci-kcp-dev-kcp-main-e2e-shared/1585683386830163968
Steps To Reproduce
Run the CI :)
Expected Behaviour
No failure
Additional Context
Likely similar to https://github.com/kcp-dev/contrib-tmc/issues/104