mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
Co-authored-by: Simon Meng <simon.meng@portainer.io>
This commit is contained in:
parent
7848bcf2f4
commit
c9f68a4d8f
3 changed files with 45 additions and 38 deletions
|
@ -40,6 +40,11 @@ func NewClientFactory(signatureService portainer.DigitalSignatureService, revers
|
|||
}
|
||||
}
|
||||
|
||||
// Remove the cached kube client so a new one can be created
|
||||
func (factory *ClientFactory) RemoveKubeClient(endpoint *portainer.Endpoint) {
|
||||
factory.endpointClients.Remove(strconv.Itoa(int(endpoint.ID)))
|
||||
}
|
||||
|
||||
// GetKubeClient checks if an existing client is already registered for the endpoint and returns it if one is found.
|
||||
// If no client is registered, it will create a new client, register it, and returns it.
|
||||
func (factory *ClientFactory) GetKubeClient(endpoint *portainer.Endpoint) (portainer.KubeClient, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue