Class ServiceBindingProcessor
- java.lang.Object
-
- io.quarkus.kubernetes.service.binding.buildtime.ServiceBindingProcessor
-
public class ServiceBindingProcessor extends Object
Processor that handles the generation of ServiceBinding resources. Generated ServiceBinding rules: 1. .metadata.name: When no user configuration is present then the combination [app.name] - [qualifier kind] - [qualifier name] will be used. Examples: - app-postgresql-default - app-mysql-default - app-mongodb-default 2. .spec.service[*].name: Since services are qualified using apiVersion, we don't need to carry over the [qualifier kind]. In this case the name is just [qualifier name].* Notes: The following pairs are equivalent: quarkus.kubernetes-service-binding.services.postgresql-default.xxx=yyy quarkus.kubernetes-service-binding.services.postgresql.xxx=yyy quarkus.kubernetes-service-binding.services.postgresql-persondb.xxx=yyy quarkus.kubernetes-service-binding.services.persondb.xxx=yyy When service are auto bound the minimal from (e.g. persondb) will be used. Users are still able to tune things using the [kind]-[name] combo to avoid naming clashes.
-
-
Constructor Summary
Constructors Constructor Description ServiceBindingProcessor()
-
Method Summary
-
-
-
Method Detail
-
registerServiceBindingAsOptional
public void registerServiceBindingAsOptional(BuildProducer<KubernetesOptionalResourceDefinitionBuildItem> optionalKinds)
-
createServiceBindingDecorators
public List<ServiceBindingRequirementBuildItem> createServiceBindingDecorators(ApplicationInfoBuildItem applicationInfo, KubernetesServiceBindingConfig config, List<ServiceBindingQualifierBuildItem> qualifiers)
-
createServiceBindingDecorators
public List<DecoratorBuildItem> createServiceBindingDecorators(KubernetesServiceBindingConfig serviceBindingConfig, List<ServiceBindingRequirementBuildItem> services, List<KubernetesResourceMetadataBuildItem> resources)
-
createRequirementFromConfig
protected static Optional<ServiceBindingRequirementBuildItem> createRequirementFromConfig(String applicationName, String serviceId, KubernetesServiceBindingConfig config)
- Parameters:
applicationName- The name of the application.serviceId- The key of the service.config- The config instance.- Returns:
- The service binding requirement that corresponds to the matching entry, or empty if no service with serviceId was found in config.
-
createRequirementFromConfig
protected static Optional<ServiceBindingRequirementBuildItem> createRequirementFromConfig(String applicationName, String defaultsLookupKey, String serviceId, String resourceName, KubernetesServiceBindingConfig config)
- Parameters:
applicationName- The name of the application.defaultsLookupKey- The key to use for looking up default apiVersion/kind).serviceId- The key of the service.resourceName- The name of the target resource.config- The config instance.- Returns:
- The service binding requirement that corresponds to the matching entry, or empty if no service with serviceId was found in config.
-
createRequirementFromQualifier
protected static Optional<ServiceBindingRequirementBuildItem> createRequirementFromQualifier(String applicationName, KubernetesServiceBindingConfig config, ServiceBindingQualifierBuildItem qualifier)
- Parameters:
applicationName- The name of the application.config- The config instance.qualifier- The qualifier that will be converted to a requirement.- Returns:
- The service binding requirement that corresponds to the config entry that matches the qualifier, or the defaults for the qualifier. Returns empty if none of the above was found.
-
-