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

fix: In e2e test, fedcorev1a1.PropagationPolicySpec.Placements should be a DesiredPlacement type, not ClusterReference type #327

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

xiaoloongfang
Copy link
Contributor

In e2e test, fedcorev1a1.PropagationPolicySpec.Placements should be a DesiredPlacement type, not ClusterReference type

WHAT HAPPEND

When I run make e2e to test official given testcase, the following problem arises:

➜  kubeadmiral git:(main) ✗ make e2e                            
ginkgo run -race -tags=e2e  test/e2e -- --kubeconfig=/Users/fangxiaolong/.kube/kubeadmiral/kubeadmiral.config 
Failed to compile e2e:

# github.com/kubewharf/kubeadmiral/test/e2e/framework/policies
framework/policies/propagationpolicy.go:41:20: cannot use []fedcorev1a1.ClusterReference{} (value of type []"github.com/kubewharf/kubeadmiral/pkg/apis/core/v1alpha1".ClusterReference) as []"github.com/kubewharf/kubeadmiral/pkg/apis/core/v1alpha1".DesiredPlacement value in struct literal
framework/policies/propagationpolicy.go:46:59: cannot use fedcorev1a1.ClusterReference{…} (value of type "github.com/kubewharf/kubeadmiral/pkg/apis/core/v1alpha1".ClusterReference) as "github.com/kubewharf/kubeadmiral/pkg/apis/core/v1alpha1".DesiredPlacement value in argument to append


Ginkgo ran 1 suite in 36.335954166s

Test Suite Failed
make: *** [e2e] Error 1

This is obviously a type mismatch problem,it may be fixed by this PR.

In my env, this PR could fix the problem and work:

➜  kubeadmiral git:(main) ✗ EXTRA_GINKGO_FLAGS='' EXTRA_E2E_FLAGS='--cluster-provider kind' make e2e
ginkgo run -race -tags=e2e  test/e2e -- --kubeconfig=/Users/fangxiaolong/.kube/kubeadmiral/kubeadmiral.config --cluster-provider kind
Running Suite: KubeAdmiral E2E Tests - /Users/fangxiaolong/develop/kubeadmiral/test/e2e
=======================================================================================
Random Seed: 1718111501

Will run 3 of 3 specs
•••

Ran 3 of 3 Specs in 124.685 seconds
SUCCESS! -- 3 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS

Ginkgo ran 1 suite in 2m13.69917775s
Test Suite Passed

@SOF3 SOF3 requested a review from limhawjia June 12, 2024 02:44
@mrlihanbo
Copy link
Collaborator

@xiaoloongfang Thanks for your commit. Could you please rebase your code as we have merged new codes?

@xiaoloongfang
Copy link
Contributor Author

@xiaoloongfang Thanks for your commit. Could you please rebase your code as we have merged new codes?

Sure and done~

… be a DesiredPlacement type, not ClusterReference type
@mrlihanbo mrlihanbo merged commit c8f179f into kubewharf:main Jun 17, 2024
5 of 6 checks passed
@xiaoloongfang xiaoloongfang deleted the e2e_bug_fix branch June 17, 2024 09:45
@Bright-Hsu
Copy link

I am a beginner in k8s and I had a similar problem. I would like to ask where you get the configuration file(--kubeconfig=/Users/fangxiaolong/.kube/kubeadmiral/kubeadmiral.config) from. Could you give me a reference?

@xiaoloongfang
Copy link
Contributor Author

I am a beginner in k8s and I had a similar problem. I would like to ask where you get the configuration file(--kubeconfig=/Users/fangxiaolong/.kube/kubeadmiral/kubeadmiral.config) from. Could you give me a reference?

@Bright-Hsu I use the local-up script to set up my local env. In this case, I can find the config file path here

KUBECONFIG_PATH=${KUBECONFIG_PATH:-"${HOME}/.kube/kubeadmiral"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants