Package io.jenkins.plugins.kubevirt
Class KubeVirtClientFactory
java.lang.Object
io.jenkins.plugins.kubevirt.KubeVirtClientFactory
Factory for creating
KubeVirt client instances.
Handles credentials lookup from Jenkins and client configuration.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateClient(KubeVirtCloudConfig config) Creates a new KubeVirt client using the provided cloud configuration.createClient(String serverUrl, String credentialsId, String namespace, boolean ignoreSsl) Creates a new KubeVirt client with the specified parameters.createClientWithTimeout(KubeVirtCloudConfig config, int connectionTimeoutMs, int requestTimeoutMs) Creates a new KubeVirt client with custom timeouts.
-
Constructor Details
-
KubeVirtClientFactory
public KubeVirtClientFactory()
-
-
Method Details
-
createClient
Creates a new KubeVirt client using the provided cloud configuration.- Parameters:
config- The cloud configuration containing connection details- Returns:
- A configured KubeVirt client instance (caller is responsible for closing)
- Throws:
IllegalStateException- if credentials cannot be found
-
createClient
public KubeVirt createClient(String serverUrl, String credentialsId, String namespace, boolean ignoreSsl) Creates a new KubeVirt client with the specified parameters.- Parameters:
serverUrl- The Kubernetes API server URLcredentialsId- The ID of the credentials for authenticationnamespace- The Kubernetes namespaceignoreSsl- Whether to ignore SSL certificate errors- Returns:
- A configured KubeVirt client instance (caller is responsible for closing)
- Throws:
IllegalStateException- if credentials cannot be found
-
createClientWithTimeout
public KubeVirt createClientWithTimeout(KubeVirtCloudConfig config, int connectionTimeoutMs, int requestTimeoutMs) Creates a new KubeVirt client with custom timeouts. Useful for connectivity checks where a shorter timeout is desired.- Parameters:
config- The cloud configuration containing connection detailsconnectionTimeoutMs- Connection timeout in millisecondsrequestTimeoutMs- Request timeout in milliseconds- Returns:
- A configured KubeVirt client instance (caller is responsible for closing)
- Throws:
IllegalStateException- if credentials cannot be found
-