Coder Social home page Coder Social logo

Comments (3)

JorTurFer avatar JorTurFer commented on June 9, 2024

After some tries, that helper doesn't work IDK and I'm a bit lost inside goja to troubleshoot the panic :/
nvm, I have modified a bit the current code to check if we are in-cluster if kubeconfig = "" and now it's working perfectly. This is my patch:

func getClientConfig(options KubeConfig) (*rest.Config, error) {
	kubeconfig := options.ConfigPath
	if kubeconfig == "" {
		// are we in-cluster?
		config, err := restclient.InClusterConfig()
		if err == nil {
			return config, nil
		}
		// we aren't in-cluster
		home := homedir.HomeDir()
		if home == "" {
			return nil, errors.New("home directory not found")
		}
		kubeconfig = filepath.Join(home, ".kube", "config")
	}
	return clientcmd.BuildConfigFromFlags("", kubeconfig)
}

If it's possible, I'd like to draft a PR fixing this instead of having to fork and maintain the repo from my side. Do you want the PR? (I hope so, but maybe there is any good reason that IDK for not supporting in-cluster)
FYI @javaducky

I can try to go further with the controller-runtime helper if you prefer that approach (but maybe I need some help)

from xk6-kubernetes.

javaducky avatar javaducky commented on June 9, 2024

@JorTurFer, please submit a PR with what you've got working. I'll take a look at it as well.

from xk6-kubernetes.

JorTurFer avatar JorTurFer commented on June 9, 2024

@JorTurFer, please submit a PR with what you've got working. I'll take a look at it as well.

Sure, this is the PR: #101
It's a really small change, but it allows to run this extension inside the cluster using k6-operator. I had to create all the RBAC stuff obviously, but with this change + RBAC changes, I had been able to run the load tests using k6-operator

from xk6-kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.