Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 clean up workspace e2e fixtures #2586

Merged
merged 9 commits into from
Jan 11, 2023

Conversation

sttts
Copy link
Member

@sttts sttts commented Jan 10, 2023

Change workspace fixture signature to return both the path and the workspace object:

func NewWorkspaceFixture(t *testing.T, server RunningServer, parent logicalcluster.Path, options ...UnprivilegedWorkspaceOption) (logicalcluster.Path, *tenancyv1beta1.Workspace) {

Implemented this convention in most places in e2e tests: fooClusterName, fooPath, fooWorkspace. The last is the object.

@sttts sttts changed the title 🌱 clean up workspace e2e fixtures WIP: 🌱 clean up workspace e2e fixtures Jan 10, 2023
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 10, 2023
@sttts sttts force-pushed the sttts-e2e-workspace-fixture branch from 05e3a75 to 340e249 Compare January 10, 2023 18:12
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 10, 2023
@sttts sttts force-pushed the sttts-e2e-workspace-fixture branch from 340e249 to 251fc3f Compare January 10, 2023 20:53
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 10, 2023
@sttts sttts changed the title WIP: 🌱 clean up workspace e2e fixtures 🌱 clean up workspace e2e fixtures Jan 10, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 10, 2023
@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 10, 2023
@sttts sttts force-pushed the sttts-e2e-workspace-fixture branch from 1ea629c to 38486b2 Compare January 10, 2023 21:26
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 10, 2023
@stevekuznetsov
Copy link
Contributor

Cowboy.wildwest.dev "cowboy-2-root:e2e-workspace-sz5n4:e2e-workspace-4cxbc" is invalid: metadata.name: Invalid value: "cowboy-2-root:e2e-workspace-sz5n4:e2e-workspace-4cxbc": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
    assertions.go:1691: Waiting for condition, but got: error while waiting to list sherriffs: forbidden: User "user-2" cannot get path "/services/apiexport/kh70w7mom58xefo0/today-cowboys/clusters/root:e2e-workspace-wg44j:tenant/apis/wild.wild.west/v1/sheriffs": Path not resolved to a valid virtual workspace

@sttts sttts force-pushed the sttts-e2e-workspace-fixture branch from cf60c22 to dcbc4a4 Compare January 11, 2023 10:15
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: stevekuznetsov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sttts
Copy link
Member Author

sttts commented Jan 11, 2023

/retest

@sttts sttts force-pushed the sttts-e2e-workspace-fixture branch from dcbc4a4 to 439db6e Compare January 11, 2023 13:44
@@ -303,7 +303,6 @@ func (c *controller) process(ctx context.Context, key string) error {
ObjectMeta: metav1.ObjectMeta{
Name: reconcilerapiexport.TemporaryComputeServiceExportName,
Annotations: map[string]string{
logicalcluster.AnnotationKey: clusterName.String(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We lose the cluster name in the logger this way :|

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh. That was the reason :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restored.

@sttts sttts force-pushed the sttts-e2e-workspace-fixture branch from 439db6e to ec6823a Compare January 11, 2023 13:47
@sttts sttts force-pushed the sttts-e2e-workspace-fixture branch from ec6823a to 9c49cc8 Compare January 11, 2023 14:16
@stevekuznetsov
Copy link
Contributor

@sttts

 E0111 14:01:49.683200   50054 runtime.go:77] Observed a panic: reflect: slice index out of range
        goroutine 24879 [running]:
        k8s.io/apimachinery/pkg/util/runtime.logPanic({0x2c1d260?, 0x38ec850})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/runtime/runtime.go:75 +0x99
        k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc004465ac0?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/runtime/runtime.go:49 +0x75
        panic({0x2c1d260, 0x38ec850})
        	/usr/local/go/src/runtime/panic.go:884 +0x212
        reflect.Value.Index({0x2b87f20?, 0xc00d2c62b8?, 0x4?}, 0x2cf0580?)
        	/usr/local/go/src/reflect/value.go:1412 +0x16d
        k8s.io/apimachinery/pkg/runtime.sliceToUnstructured({0x2b8bfa0?, 0xc006933798?, 0xc005050fd8?}, {0x2cf0580?, 0xc00d67efa0?, 0x2dd8da0?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:763 +0x785
        k8s.io/apimachinery/pkg/runtime.toUnstructured({0x2b8bfa0?, 0xc006933798?, 0x2?}, {0x2cf0580?, 0xc00d67efa0?, 0x98?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:688 +0x6cc
        k8s.io/apimachinery/pkg/runtime.structToUnstructured({0x30227c0?, 0xc006933680?, 0xc00cc68c00?}, {0x2d4c8c0?, 0xc005ff21a0?, 0x2b52b20?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:843 +0x905
        k8s.io/apimachinery/pkg/runtime.toUnstructured({0x30227c0?, 0xc006933680?, 0xc006933680?}, {0x2d4c8c0?, 0xc005ff21a0?, 0xc00cc68bd0?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:692 +0x7f4
        k8s.io/apimachinery/pkg/runtime.(*unstructuredConverter).ToUnstructured(0x54536b0, {0x31fc620?, 0xc006933680})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:586 +0x3ba
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.toUnstructured({0x31fc620, 0xc006933680})
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_reconcile_unstructured.go:213 +0x6c
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).reconcileObject(0xc001abb300, {0x3924798, 0xc00cc688d0}, {0xc002f453b5?, 0x203000?}, {{0x326d97b, 0x19}, {0x3239010, 0x2}, {0x3249b0d, ...}}, ...)
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_reconcile.go:177 +0x565
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).reconcile(0xc001abb300, {0x3924798, 0xc00cc688d0}, {0xc002f45380, 0x74})
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_reconcile.go:97 +0xe1a
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).processNextWorkItem(0xc001abb300, {0x3924798, 0xc0006f83f0})
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_controller.go:193 +0x2b1
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).startWorker(0xc008d90240?, {0x3924798, 0xc0006f83f0})
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_controller.go:180 +0x39
        k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1()
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:188 +0x25
        k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x1?)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:155 +0x3e
        k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x0?, {0x38f5880, 0xc008d90240}, 0x1, 0xc000f315c0)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:156 +0xb6
        k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x1a7eaf3?, 0x3b9aca00, 0x0, 0x0?, 0xc00241e060?)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:133 +0x89
        k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext({0x3924798, 0xc0006f83f0}, 0xc00018b190, 0x1a7e305?, 0xc0033da180?, 0x24?)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:188 +0x99
        k8s.io/apimachinery/pkg/util/wait.UntilWithContext({0x3924798?, 0xc0006f83f0?}, 0xc000bc8480?, 0xc00106bc20?)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:99 +0x2b
        created by github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).Start
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_controller.go:174 +0x345
        panic: reflect: slice index out of range [recovered]
        	panic: reflect: slice index out of range
        
        goroutine 24879 [running]:
        k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc004465ac0?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/runtime/runtime.go:56 +0xd7
        panic({0x2c1d260, 0x38ec850})
        	/usr/local/go/src/runtime/panic.go:884 +0x212
        reflect.Value.Index({0x2b87f20?, 0xc00d2c62b8?, 0x4?}, 0x2cf0580?)
        	/usr/local/go/src/reflect/value.go:1412 +0x16d
        k8s.io/apimachinery/pkg/runtime.sliceToUnstructured({0x2b8bfa0?, 0xc006933798?, 0xc005050fd8?}, {0x2cf0580?, 0xc00d67efa0?, 0x2dd8da0?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:763 +0x785
        k8s.io/apimachinery/pkg/runtime.toUnstructured({0x2b8bfa0?, 0xc006933798?, 0x2?}, {0x2cf0580?, 0xc00d67efa0?, 0x98?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:688 +0x6cc
        k8s.io/apimachinery/pkg/runtime.structToUnstructured({0x30227c0?, 0xc006933680?, 0xc00cc68c00?}, {0x2d4c8c0?, 0xc005ff21a0?, 0x2b52b20?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:843 +0x905
        k8s.io/apimachinery/pkg/runtime.toUnstructured({0x30227c0?, 0xc006933680?, 0xc006933680?}, {0x2d4c8c0?, 0xc005ff21a0?, 0xc00cc68bd0?})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:692 +0x7f4
        k8s.io/apimachinery/pkg/runtime.(*unstructuredConverter).ToUnstructured(0x54536b0, {0x31fc620?, 0xc006933680})
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/runtime/converter.go:586 +0x3ba
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.toUnstructured({0x31fc620, 0xc006933680})
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_reconcile_unstructured.go:213 +0x6c
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).reconcileObject(0xc001abb300, {0x3924798, 0xc00cc688d0}, {0xc002f453b5?, 0x203000?}, {{0x326d97b, 0x19}, {0x3239010, 0x2}, {0x3249b0d, ...}}, ...)
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_reconcile.go:177 +0x565
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).reconcile(0xc001abb300, {0x3924798, 0xc00cc688d0}, {0xc002f45380, 0x74})
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_reconcile.go:97 +0xe1a
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).processNextWorkItem(0xc001abb300, {0x3924798, 0xc0006f83f0})
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_controller.go:193 +0x2b1
        github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).startWorker(0xc008d90240?, {0x3924798, 0xc0006f83f0})
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_controller.go:180 +0x39
        k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1()
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:188 +0x25
        k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x1?)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:155 +0x3e
        k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x0?, {0x38f5880, 0xc008d90240}, 0x1, 0xc000f315c0)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:156 +0xb6
        k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x1a7eaf3?, 0x3b9aca00, 0x0, 0x0?, 0xc00241e060?)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:133 +0x89
        k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext({0x3924798, 0xc0006f83f0}, 0xc00018b190, 0x1a7e305?, 0xc0033da180?, 0x24?)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:188 +0x99
        k8s.io/apimachinery/pkg/util/wait.UntilWithContext({0x3924798?, 0xc0006f83f0?}, 0xc000bc8480?, 0xc00106bc20?)
        	/go/pkg/mod/github.com/kcp-dev/kubernetes/staging/src/k8s.io/apimachinery@v0.0.0-20230109113100-c493866a854f/pkg/util/wait/wait.go:99 +0x2b
        created by github.com/kcp-dev/kcp/pkg/reconciler/cache/replication.(*controller).Start
        	/go/src/github.com/kcp-dev/kcp/pkg/reconciler/cache/replication/replication_controller.go:174 +0x345

@stevekuznetsov
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 11, 2023
@openshift-merge-robot openshift-merge-robot merged commit 8568db4 into kcp-dev:main Jan 11, 2023
@sttts sttts deleted the sttts-e2e-workspace-fixture branch January 11, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants