Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions iib/workers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ class Config(object):
}
iib_opm_pprof_lock_required_min_version = "1.29.0"
iib_image_push_template: str = '{registry}/iib-build:{request_id}'
iib_index_db_artifact_registry: str = None
iib_index_db_imagestream_registry: str = None
iib_index_db_artifact_tag_template: str = '{image_name}-{tag}'
iib_index_db_artifact_template: str = '{registry}/index-db:{tag}'
# Whether to use OpenShift ImageStream cache for index.db artifacts
# Requires OpenShift cluster with ImageStream configured
iib_use_imagestream_cache: bool = False
Comment on lines +45 to +51
Copy link

Choose a reason for hiding this comment

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

suggestion (bug_risk): New config options default to None, which may cause runtime errors.

Please set appropriate default values or add validation to prevent runtime errors when these config options are accessed.

Suggested implementation:

    # Default registry for index.db artifacts (set to empty string if not configured)
    iib_index_db_artifact_registry: str = ''
    # Default registry for index.db ImageStream (set to empty string if not configured)
    iib_index_db_imagestream_registry: str = ''
    iib_index_db_artifact_tag_template: str = '{image_name}-{tag}'
    iib_index_db_artifact_template: str = '{registry}/index-db:{tag}'
    # Whether to use OpenShift ImageStream cache for index.db artifacts
    # Requires OpenShift cluster with ImageStream configured
    iib_use_imagestream_cache: bool = False

If these config options are accessed elsewhere in the code, you should add validation logic such as:

if not config.iib_index_db_artifact_registry:
    raise ValueError("iib_index_db_artifact_registry must be set in the configuration.")

wherever they are used and a value is required. Adjust the default values if you have a known default registry or imagestream registry.

iib_index_image_output_registry: Optional[str] = None
iib_index_configs_gitlab_tokens_map: Optional[Dict[str, Dict[str, str]]] = None
iib_log_level: str = 'INFO'
Expand Down Expand Up @@ -251,6 +258,8 @@ class DevelopmentConfig(Config):
"v4.14": "opm-v1.26.4",
"v4.15": "opm-v1.26.4",
"v4.16": "opm-v1.40.0",
"v4.17": "opm-v1.40.0",
"v4.18": "opm-v1.40.0",
}


Expand Down
Loading
Loading