def prepare_additional_configmaps()

in mysqloperator/controller/innodbcluster/cluster_objects.py [0:0]


def prepare_additional_configmaps(spec: AbstractServerSetSpec, logger: Logger) -> List[Dict]:
    configmaps = []
    prefix = ''
    for subsystem in spec.get_configmaps_cbs:
        for cb in spec.get_configmaps_cbs[subsystem]:
            if cms := cb(prefix, logger):
              for (cm_name, cm) in cms:
                  if cm:
                      configmaps.append(cm)

    # TODO: This should use the CB mechanism like other CMs above
    if isinstance(spec, InnoDBClusterSpec):
        clusterspec = cast(InnoDBClusterSpec, spec)
        if  (clusterspec.initDB and clusterspec.initDB.meb) \
                or any(getattr(profile, 'meb', None) for profile in clusterspec.backupProfiles):

            if spec.edition != config.Edition.enterprise:
                raise kopf.TemporaryError("A BackupProfile requires MySQL Enterprise Backup, but the cluster doesn't use Enterprise Edition")

            configmaps.append(backup_objects.prepare_meb_code_configmap(clusterspec))

    return configmaps