Skip to content

Expose Kubernetes rest config#338

Merged
hasbro17 merged 1 commit intooperator-framework:masterfrom
nicolaferraro:syndesis-changes
Jul 10, 2018
Merged

Expose Kubernetes rest config#338
hasbro17 merged 1 commit intooperator-framework:masterfrom
nicolaferraro:syndesis-changes

Conversation

@nicolaferraro
Copy link
Copy Markdown
Contributor

I'd like to expose the rest configuration in order to be able to create custom clients e.g. a generic (non resource-scoped) dynamic client or a specific Openshift client in order to access some sub-resources (in my case, processing Openshift templates).

Can it be exposed?

@maleck13
Copy link
Copy Markdown

maleck13 commented Jul 6, 2018

This would be very useful for initializing other clients. At the moment I have recreate the code that is already in the SDK to get a new instance of the config to pass to my other clients

@hasbro17
Copy link
Copy Markdown
Contributor

hasbro17 commented Jul 9, 2018

@nicolaferraro Yes I think exposing the config should be alright since there's a legitimate use case.
Can you please update the CHANGELOG with:

The SDK exposes the Kubernetes rest config via `k8sclient.GetKubeConfig()` #338

Comment thread pkg/k8sclient/client.go Outdated

// GetKubeConfig returns the kubernetes rest configuration
func GetKubeConfig() *rest.Config {
return kubeConfig
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@nicolaferraro After #340 you might want to rebase and change this to:

func GetKubeConfig() *rest.Config {
	once.Do(newSingletonFactory)
	return singletonFactory.kubeConfig
}

@nicolaferraro
Copy link
Copy Markdown
Contributor Author

Thanks @hasbro17, I think it should be ok now.

@hasbro17 hasbro17 merged commit 2653bb5 into operator-framework:master Jul 10, 2018
m1kola pushed a commit to m1kola/operator-sdk that referenced this pull request Jun 7, 2024
…istency-openshift-4.15-openshift-enterprise-helm-operator

OCPBUGS-19197: Updating openshift-enterprise-helm-operator images to be consistent with ART
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