@@ -127,6 +127,13 @@ class Config(object):
127127 # The minimal version of OPM which requires setting the --migrate-level flag for migrate
128128 iib_opm_new_migrate_version = "v1.46.0"
129129
130+ # Konflux configuration for cross-cluster access
131+ iib_konflux_cluster_url : Optional [str ] = None
132+ iib_konflux_cluster_token : Optional [str ] = None
133+ iib_konflux_cluster_ca_cert : Optional [str ] = None
134+ iib_konflux_namespace : Optional [str ] = None
135+ iib_konflux_pipeline_timeout : int = 1800
136+
130137
131138class ProductionConfig (Config ):
132139 """The production IIB Celery configuration."""
@@ -326,6 +333,7 @@ def validate_celery_config(conf: app.utils.Settings, **kwargs) -> None:
326333
327334 _validate_multiple_opm_mapping (conf ['iib_ocp_opm_mapping' ])
328335 _validate_iib_org_customizations (conf ['iib_organization_customizations' ])
336+ _validate_konflux_config (conf )
329337
330338 if conf .get ('iib_aws_s3_bucket_name' ):
331339 if not isinstance (conf ['iib_aws_s3_bucket_name' ], str ):
@@ -481,6 +489,63 @@ def _validate_iib_org_customizations(
481489 )
482490
483491
492+ def _validate_konflux_config (conf : app .utils .Settings ) -> None :
493+ """
494+ Validate Konflux configuration variables.
495+
496+ :param celery.app.utils.Settings conf: the Celery application configuration to validate
497+ :raises iib.exceptions.ConfigError: if the configuration is invalid
498+ """
499+ konflux_url = conf .get ('iib_konflux_cluster_url' )
500+ konflux_token = conf .get ('iib_konflux_cluster_token' )
501+ konflux_ca_cert = conf .get ('iib_konflux_cluster_ca_cert' )
502+ konflux_namespace = conf .get ('iib_konflux_namespace' )
503+
504+ if any ([konflux_url , konflux_token , konflux_ca_cert , konflux_namespace ]):
505+ _validate_konflux_fields (konflux_url , konflux_token , konflux_ca_cert , konflux_namespace )
506+
507+
508+ def _validate_konflux_fields (
509+ konflux_url : Optional [str ],
510+ konflux_token : Optional [str ],
511+ konflux_ca_cert : Optional [str ],
512+ konflux_namespace : Optional [str ],
513+ ) -> None :
514+ """
515+ Validate Konflux configuration fields for presence, types, and formats.
516+
517+ :param str konflux_url: The Kubernetes cluster API URL
518+ :param str konflux_token: The authentication token for the cluster
519+ :param str konflux_ca_cert: The CA certificate for SSL verification
520+ :param str konflux_namespace: The namespace for Konflux operations
521+ :raises iib.exceptions.ConfigError: if the configuration is invalid
522+ """
523+ if (
524+ not konflux_url
525+ or not isinstance (konflux_url , str )
526+ or not konflux_url .startswith ('https://' )
527+ ):
528+ raise ConfigError (
529+ 'iib_konflux_cluster_url must be a valid HTTPS URL when using Konflux configuration'
530+ )
531+ if not konflux_token or not isinstance (konflux_token , str ):
532+ raise ConfigError (
533+ 'iib_konflux_cluster_token must be a string when using Konflux configuration'
534+ )
535+ if not konflux_ca_cert or not isinstance (konflux_ca_cert , str ):
536+ raise ConfigError (
537+ 'iib_konflux_cluster_ca_cert must be a string when using Konflux configuration'
538+ )
539+ if (
540+ not konflux_namespace
541+ or not isinstance (konflux_namespace , str )
542+ or not konflux_namespace .strip ()
543+ ):
544+ raise ConfigError (
545+ 'iib_konflux_namespace must be a non-empty string when using Konflux configuration'
546+ )
547+
548+
484549def get_worker_config () -> app .utils .Settings :
485550 """Return the Celery configuration."""
486551 # Import this here to avoid a circular import
0 commit comments