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

Enhance kubeconfig loading #1075

Closed
wants to merge 1 commit into from

Conversation

bouskaJ
Copy link
Contributor

@bouskaJ bouskaJ commented Nov 22, 2019

Enable using HOME environment variable to load kubernetes config.

Previous code was causing issues when running client in docker container wit random userId.

See

panic: user: unknown userid 1102770000

goroutine 1 [running]:
github.com/apache/camel-k/pkg/client.initialize(0x0, 0x0)
	/home/jenkins/workspace/fuse-camel-k-install/pkg/client/client.go:147 +0x123
github.com/apache/camel-k/pkg/client.NewOutOfClusterClient(0x0, 0x0, 0x1ad7100, 0x15, 0xc00012c58b, 0x3)
	/home/jenkins/workspace/fuse-camel-k-install/pkg/client/client.go:74 +0x35
github.com/apache/camel-k/e2e.newTestClient(...)
	/home/jenkins/workspace/fuse-camel-k-install/e2e/test_support.go:82
github.com/apache/camel-k/e2e.init.1()
	/home/jenkins/workspace/fuse-camel-k-install/e2e/test_support.go:72 +0xfd
FAIL	github.com/apache/camel-k/e2e	0.268s
FAIL

@bouskaJ bouskaJ force-pushed the enhance_kubeconfig_loading branch from 781da57 to e49e57e Compare November 22, 2019 12:47
@bouskaJ
Copy link
Contributor Author

bouskaJ commented Nov 22, 2019

@bouskaJ bouskaJ closed this Nov 22, 2019
@nicolaferraro
Copy link
Member

@bouskaJ are you experiencing issues inside a container? I though that was fixed in 1.0.0-M4, including case of random user ID.

@bouskaJ
Copy link
Contributor Author

bouskaJ commented Nov 22, 2019

Hi @nicolaferraro. I have a special case. I am in OpenShift container and I would like to run Camel-K against different OpenShift. So I am "in Cluster" but I would like to use "out of cluster" initialization.

What I did.

  1. I have set KUBECONF ENV
    -> shouldUseContainerMode returns false (
    return false, nil
    )
    -> then I continue to
    kubeconfig, err = getDefaultKubeConfigFile()

    and here we are:
panic: user: unknown userid 1102770000

goroutine 1 [running]:
github.com/apache/camel-k/pkg/client.initialize(0x0, 0x0)
	/home/jenkins/workspace/fuse-camel-k-install/pkg/client/client.go:147 +0x123
github.com/apache/camel-k/pkg/client.NewOutOfClusterClient(0x0, 0x0, 0x1ad7100, 0x15, 0xc00012c58b, 0x3)
	/home/jenkins/workspace/fuse-camel-k-install/pkg/client/client.go:74 +0x35
github.com/apache/camel-k/e2e.newTestClient(...)
	/home/jenkins/workspace/fuse-camel-k-install/e2e/test_support.go:82
github.com/apache/camel-k/e2e.init.1()
	/home/jenkins/workspace/fuse-camel-k-install/e2e/test_support.go:72 +0xfd
FAIL	github.com/apache/camel-k/e2e	0.268s
FAIL

Maybe bouskaJ@104f8cd should fix it WDYT?

@bouskaJ
Copy link
Contributor Author

bouskaJ commented Nov 22, 2019

Moreover we should use KUBECONF variable provided by user to load configuration.

@nicolaferraro
Copy link
Member

Moreover we should use KUBECONF variable provided by user to load configuration.

Yes, that is what I expected.. if there's a KUBECONF that should take precedence and the code should not even look into the home directory

@bouskaJ
Copy link
Contributor Author

bouskaJ commented Nov 22, 2019

Thank you for your opinion. Here is my new PR #1076

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.

2 participants