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 karmadactl init can not read KUBECONFIG environment variable issue #1437

Merged
merged 1 commit into from Mar 14, 2022

Conversation

lonelyCZ
Copy link
Member

@lonelyCZ lonelyCZ commented Mar 7, 2022

Signed-off-by: lonelyCZ 531187475@qq.com

What type of PR is this?
/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #1430

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmadactl`: Fixed `init` can not read KUBECONFIG environment variable issue.

/cc @RainbowMango @XiShanYongYe-Chang @prodanlabs

@karmada-bot karmada-bot added kind/bug Categorizes issue or PR as related to a bug. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 7, 2022
@lonelyCZ
Copy link
Member Author

lonelyCZ commented Mar 7, 2022

/retest

@RainbowMango
Copy link
Member

@huone1 @XiShanYongYe-Chang
https://github.com/karmada-io/karmada/runs/5443201929?check_suite_focus=true

OverridePolicy with nil resourceSelectors
/home/runner/work/karmada/karmada/test/e2e/overridepolicy_test.go:235
  Deployment override testing
  /home/runner/work/karmada/karmada/test/e2e/overridepolicy_test.go:236
    deployment imageOverride testing
    /home/runner/work/karmada/karmada/test/e2e/overridepolicy_test.go:281
------------------------------
failover testing Deployment propagation testing 
  deployment failover testing
  /home/runner/work/karmada/karmada/test/e2e/failover_test.go:62
STEP: Creating PropagationPolicy(karmadatest-hvd/deploy-rwd)
STEP: Creating Deployment(karmadatest-hvd/deploy-rwd)
I0307 04:43:31.529947   37166 deployment.go:124] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) schedule result is: member1
STEP: set one cluster condition status to false
I0307 04:43:31.530207   37166 failover_test.go:73] Set cluster member1 to disable.
STEP: check whether deployment of failed cluster is rescheduled to other available cluster
I0307 04:45:06.912277   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:11.921584   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:16.929873   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:21.945206   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:26.96[1151](https://github.com/karmada-io/karmada/runs/5443201929?check_suite_focus=true#step:5:1151)   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:31.970542   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:36.991220   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:42.000291   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:47.008024   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:52.014640   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:45:57.023043   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:46:02.030664   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:46:07.039217   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:46:12.055902   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:46:17.066281   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:46:22.074774   37166 deployment.go:114] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) hasn't been scheduled.
I0307 04:46:27.087882   37166 deployment.go:124] The ResourceBinding(karmadatest-hvd/deploy-rwd-deployment) schedule result is: member1

• Failure [180.624 seconds]
failover testing
/home/runner/work/karmada/karmada/test/e2e/failover_test.go:27
  Deployment propagation testing
  /home/runner/work/karmada/karmada/test/e2e/failover_test.go:28
    deployment failover testing [It]
    /home/runner/work/karmada/karmada/test/e2e/failover_test.go:62

    Expected
        <bool>: true
    to be false

    /home/runner/work/karmada/karmada/test/e2e/failover_test.go:93
------------------------------
S

Summarizing 1 Failure:

[Fail] failover testing Deployment propagation testing [It] deployment failover testing 
/home/runner/work/karmada/karmada/test/e2e/failover_test.go:93

Ran 40 of 41 Specs in 927.083 seconds
FAIL! -- 39 Passed | 1 Failed | 0 Pending | 1 Skipped

@XiShanYongYe-Chang
Copy link
Member

Hi @lonelyCZ, can you rebase the latest code, we have solved the CI failed.

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

/lgtm

This pr will be conflict with #1455

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2022
@lonelyCZ
Copy link
Member Author

This pr will be conflict with #1455

Got it. Thanks. :)

@RainbowMango
Copy link
Member

Please add a release note on the PR description.

By the way, should we cherry-pick this to release branches?

cc @prodanlabs might want to know what we are going to do.

@karmada-bot karmada-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Mar 10, 2022
@prodanlabs
Copy link
Member

Please add a release note on the PR description.

By the way, should we cherry-pick this to release branches?

cc @prodanlabs might want to know what we are going to do.

I'll take a look when I'm free, I have no problem here. thx

@lonelyCZ
Copy link
Member Author

Do I need to cheery-pick this now? @RainbowMango

@RainbowMango
Copy link
Member

Do I need to cheery-pick this now? @RainbowMango

Hold on until this is merged to master. I haven't looked at this yet, will do it ASAP.

Comment on lines 95 to 99
// check config path of host kubernetes cluster
env := os.Getenv("KUBECONFIG")
if env != "" {
i.KubeConfig = env
}
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean KUBECONFIG environment would override --kubeconfig?

The kubectl get config according to following rules, that we can't violate :

  1. Via the command-line flag --kubeconfig
  2. Via the KUBECONFIG environment variable
  3. In your home directory as ~/.kube/config

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I will fix it as these rules.

@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 11, 2022
@lonelyCZ
Copy link
Member Author

Abide by the rules and the conflict has been fixed.

@RainbowMango
Copy link
Member

cc @XiShanYongYe-Chang

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/approve

Leave LGTM to @XiShanYongYe-Chang

retitle Fix karmadactl init can not read KUBECONFIG environment variable issue

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 14, 2022
@RainbowMango
Copy link
Member

/retitle Fix karmadactl init can not read KUBECONFIG environment variable issue

@karmada-bot karmada-bot changed the title Fix bug: [karmadactl init] can not read KUBECONFIG environment variable Fix karmadactl init can not read KUBECONFIG environment variable issue Mar 14, 2022
Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 14, 2022
@karmada-bot karmada-bot merged commit 0961767 into karmada-io:master Mar 14, 2022
@RainbowMango
Copy link
Member

Hi @lonelyCZ Would you like cherry-pick this patch to release-1.0 and release-1.1 branch?
You can do that by this cherry-pick script.

@lonelyCZ
Copy link
Member Author

Yes, thanks. I will try to do it.

karmada-bot added a commit that referenced this pull request Mar 15, 2022
…-upstream-release-1.1

Automated cherry pick of #1437: fix `karmadactl init` can not read KUBECONFIG environment variable issue
karmada-bot added a commit that referenced this pull request Mar 15, 2022
…-upstream-release-1.0

Automated cherry pick of #1437: fix `karmadactl init` can not read KUBECONFIG environment variable issue
@lonelyCZ lonelyCZ deleted the init-kubeconfig branch July 11, 2022 07:14
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[karmadactl init] can not read KUBECONFIG environment variable
5 participants