// WithConfigPath option for setting a custom path to kubeconfig
496677
func WithConfigPath(s string) source.Option {
	return func(o *source.Options) {
		if o.Context == nil {
			o.Context = context.Background()
		}
		o.Context = context.WithValue(o.Context, configPathKey{}, s)
	}
}
884398
func (o *PetUpdateURL) WithBasePath(bp string) *PetUpdateURL {
	o.SetBasePath(bp)
	return o
}
559297
func NewConfigPaths(baseCertDir string) *SecurityConfigPaths {
	return &SecurityConfigPaths{
		Node: CertPaths{
			Cert: filepath.Join(baseCertDir, nodeTLSCertFilename),
			Key:  filepath.Join(baseCertDir, nodeTLSKeyFilename)},
		RootCA: CertPaths{
			Cert: filepath.Join(baseCertDir, rootCACertFilename),
			Key:  filepath.Join(baseCertDir, rootCAKeyFilename)},
	}
}
292342
func ProjectConfigPath(c context.Context) string {
	return svcconfig.ProjectConfigPath(cfgclient.CurrentServiceName(c))
}
1335320
func WithConfigDir(ctx context.Context, cfgdir string) context.Context {
	return context.WithValue(ctx, ctxKeyConfigDir, cfgdir)
}
417787
func configurePath(g *libkb.GlobalContext, cl *libcmdline.CommandLine) error {
	if cl.IsService() {
		// this only runs on the client
		return nil
	}

	return client.SendPath(g)
}
396362
func GetKubeConfigPath() string {
	kubeconfig := os.Getenv(clientcmd.RecommendedConfigPathEnvVar)
	if kubeconfig == "" {
		kubeconfig = clientcmd.RecommendedHomeFile
	}
	logger.Debugf("The kubeconfig file path: %q", kubeconfig)
	return kubeconfig
}
596201
func ConfigDirPath(projectDirPath string) (string, error) {
	if projectDirPath == "" {
		return "", errors.Errorf("projectDirPath was empty")
	}
	wrapper, err := specdir.New(projectDirPath, layout.WrapperSpec(), nil, specdir.Validate)
	if err != nil {
		return "", err
	}
	return wrapper.Path(layout.WrapperConfigDir), nil
}
788805
func (o *GetTaskCommentsURL) WithBasePath(bp string) *GetTaskCommentsURL {
	o.SetBasePath(bp)
	return o
}
61121
func (o *GetHealthzURL) WithBasePath(bp string) *GetHealthzURL {
	o.SetBasePath(bp)
	return o
}
29364
func WithPath(path string) PrepareDecorator {
	return func(p Preparer) Preparer {
		return PreparerFunc(func(r *http.Request) (*http.Request, error) {
			r, err := p.Prepare(r)
			if err == nil {
				if r.URL == nil {
					return r, NewError("autorest", "WithPath", "Invoked with a nil URL")
				}
				if r.URL, err = parseURL(r.URL, path); err != nil {
					return r, err
				}
			}
			return r, err
		})
	}
}
626450
func (o *PatchEndpointIDLabelsURL) WithBasePath(bp string) *PatchEndpointIDLabelsURL {
	o.SetBasePath(bp)
	return o
}
403880
func (o *PetGetURL) WithBasePath(bp string) *PetGetURL {
	o.SetBasePath(bp)
	return o
}
1096744
func (o *PatchConfigParams) WithConfiguration(configuration *models.DaemonConfigurationSpec) *PatchConfigParams {
	o.SetConfiguration(configuration)
	return o
}
513529
func withConfig(c context.Context, cfg config.ConfigurationServer) context.Context {
	return context.WithValue(c, &cfgKey, cfg)
}
1204830
func (o *GetPetByIDURL) WithBasePath(bp string) *GetPetByIDURL {
	o.SetBasePath(bp)
	return o
}
791359
func ConfigFilePath() (configPath string, err error) {
	var usr *user.User

	if configPath = os.Getenv("GOCD_CONFIG_PATH"); configPath != "" {
		return
	}

	// @TODO Make it work for windows. Maybe...
	if usr, err = user.Current(); err != nil {
		return
	}

	configPath = strings.Replace(ConfigDirectoryPath, "~", usr.HomeDir, 1)
	return
}