Search in sources :

Example 1 with ImagePullPolicy

use of io.strimzi.operator.cluster.model.ImagePullPolicy in project strimzi by strimzi.

the class ClusterOperatorConfig method fromMap.

/**
 * Loads configuration parameters from a related map and custom KafkaVersion.Lookup instance.
 * This is used for testing.
 *
 * @param map   map from which loading configuration parameters
 * @param lookup KafkaVersion.Lookup instance with the supported Kafka version information
 * @return  Cluster Operator configuration instance
 */
public static ClusterOperatorConfig fromMap(Map<String, String> map, KafkaVersion.Lookup lookup) {
    Set<String> namespaces = parseNamespaceList(map.get(STRIMZI_NAMESPACE));
    long reconciliationInterval = parseReconciliationInterval(map.get(STRIMZI_FULL_RECONCILIATION_INTERVAL_MS));
    long operationTimeout = parseTimeout(map.get(STRIMZI_OPERATION_TIMEOUT_MS), DEFAULT_OPERATION_TIMEOUT_MS);
    long connectBuildTimeout = parseTimeout(map.get(STRIMZI_CONNECT_BUILD_TIMEOUT_MS), DEFAULT_CONNECT_BUILD_TIMEOUT_MS);
    boolean createClusterRoles = parseCreateClusterRoles(map.get(STRIMZI_CREATE_CLUSTER_ROLES));
    boolean networkPolicyGeneration = parseNetworkPolicyGeneration(map.get(STRIMZI_NETWORK_POLICY_GENERATION));
    ImagePullPolicy imagePullPolicy = parseImagePullPolicy(map.get(STRIMZI_IMAGE_PULL_POLICY));
    List<LocalObjectReference> imagePullSecrets = parseImagePullSecrets(map.get(STRIMZI_IMAGE_PULL_SECRETS));
    String operatorNamespace = map.get(STRIMZI_OPERATOR_NAMESPACE);
    Labels operatorNamespaceLabels = parseLabels(map, STRIMZI_OPERATOR_NAMESPACE_LABELS);
    RbacScope rbacScope = parseRbacScope(map.get(STRIMZI_RBAC_SCOPE));
    Labels customResourceSelector = parseLabels(map, STRIMZI_CUSTOM_RESOURCE_SELECTOR);
    String featureGates = map.getOrDefault(STRIMZI_FEATURE_GATES, "");
    int operationsThreadPoolSize = parseInt(map.get(STRIMZI_OPERATIONS_THREAD_POOL_SIZE), DEFAULT_STRIMZI_OPERATIONS_THREAD_POOL_SIZE);
    int zkAdminSessionTimeout = parseInt(map.get(STRIMZI_ZOOKEEPER_ADMIN_SESSION_TIMEOUT_MS), DEFAULT_ZOOKEEPER_ADMIN_SESSION_TIMEOUT_MS);
    int dnsCacheTtlSec = parseInt(map.get(STRIMZI_DNS_CACHE_TTL), DEFAULT_STRIMZI_DNS_CACHE_TTL);
    return new ClusterOperatorConfig(namespaces, reconciliationInterval, operationTimeout, connectBuildTimeout, createClusterRoles, networkPolicyGeneration, lookup, imagePullPolicy, imagePullSecrets, operatorNamespace, operatorNamespaceLabels, rbacScope, customResourceSelector, featureGates, operationsThreadPoolSize, zkAdminSessionTimeout, dnsCacheTtlSec);
}
Also used : ImagePullPolicy(io.strimzi.operator.cluster.model.ImagePullPolicy) LocalObjectReference(io.fabric8.kubernetes.api.model.LocalObjectReference) Labels(io.strimzi.operator.common.model.Labels)

Example 2 with ImagePullPolicy

use of io.strimzi.operator.cluster.model.ImagePullPolicy in project strimzi-kafka-operator by strimzi.

the class ClusterOperatorConfig method fromMap.

/**
 * Loads configuration parameters from a related map and custom KafkaVersion.Lookup instance.
 * This is used for testing.
 *
 * @param map   map from which loading configuration parameters
 * @param lookup KafkaVersion.Lookup instance with the supported Kafka version information
 * @return  Cluster Operator configuration instance
 */
public static ClusterOperatorConfig fromMap(Map<String, String> map, KafkaVersion.Lookup lookup) {
    Set<String> namespaces = parseNamespaceList(map.get(STRIMZI_NAMESPACE));
    long reconciliationInterval = parseReconciliationInterval(map.get(STRIMZI_FULL_RECONCILIATION_INTERVAL_MS));
    long operationTimeout = parseTimeout(map.get(STRIMZI_OPERATION_TIMEOUT_MS), DEFAULT_OPERATION_TIMEOUT_MS);
    long connectBuildTimeout = parseTimeout(map.get(STRIMZI_CONNECT_BUILD_TIMEOUT_MS), DEFAULT_CONNECT_BUILD_TIMEOUT_MS);
    boolean createClusterRoles = parseCreateClusterRoles(map.get(STRIMZI_CREATE_CLUSTER_ROLES));
    boolean networkPolicyGeneration = parseNetworkPolicyGeneration(map.get(STRIMZI_NETWORK_POLICY_GENERATION));
    ImagePullPolicy imagePullPolicy = parseImagePullPolicy(map.get(STRIMZI_IMAGE_PULL_POLICY));
    List<LocalObjectReference> imagePullSecrets = parseImagePullSecrets(map.get(STRIMZI_IMAGE_PULL_SECRETS));
    String operatorNamespace = map.get(STRIMZI_OPERATOR_NAMESPACE);
    Labels operatorNamespaceLabels = parseLabels(map, STRIMZI_OPERATOR_NAMESPACE_LABELS);
    RbacScope rbacScope = parseRbacScope(map.get(STRIMZI_RBAC_SCOPE));
    Labels customResourceSelector = parseLabels(map, STRIMZI_CUSTOM_RESOURCE_SELECTOR);
    String featureGates = map.getOrDefault(STRIMZI_FEATURE_GATES, "");
    int operationsThreadPoolSize = parseInt(map.get(STRIMZI_OPERATIONS_THREAD_POOL_SIZE), DEFAULT_STRIMZI_OPERATIONS_THREAD_POOL_SIZE);
    int zkAdminSessionTimeout = parseInt(map.get(STRIMZI_ZOOKEEPER_ADMIN_SESSION_TIMEOUT_MS), DEFAULT_ZOOKEEPER_ADMIN_SESSION_TIMEOUT_MS);
    int dnsCacheTtlSec = parseInt(map.get(STRIMZI_DNS_CACHE_TTL), DEFAULT_STRIMZI_DNS_CACHE_TTL);
    return new ClusterOperatorConfig(namespaces, reconciliationInterval, operationTimeout, connectBuildTimeout, createClusterRoles, networkPolicyGeneration, lookup, imagePullPolicy, imagePullSecrets, operatorNamespace, operatorNamespaceLabels, rbacScope, customResourceSelector, featureGates, operationsThreadPoolSize, zkAdminSessionTimeout, dnsCacheTtlSec);
}
Also used : ImagePullPolicy(io.strimzi.operator.cluster.model.ImagePullPolicy) LocalObjectReference(io.fabric8.kubernetes.api.model.LocalObjectReference) Labels(io.strimzi.operator.common.model.Labels)

Aggregations

LocalObjectReference (io.fabric8.kubernetes.api.model.LocalObjectReference)2 ImagePullPolicy (io.strimzi.operator.cluster.model.ImagePullPolicy)2 Labels (io.strimzi.operator.common.model.Labels)2