use of io.stackgres.common.resource.SecretFinder in project stackgres by ongres.
the class Main method run.
@Override
@SuppressWarnings("deprecation")
public int run(String... args) throws Exception {
/*
* This is a hack to prevent empty arrays being added to json serializer in native image. For
* some reason when CRDs are being serialized in json, in the native image the annotation
*
* @JsonInclude(Include.NON_EMPTY) is ignored.
*/
Serialization.jsonMapper().disable(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS);
final CrdLoader crdLoader = new CrdLoaderImpl(kubernetesClientFactory);
final CustomResourceDefinitionFinder crdFinder = new CustomResourceDefinitionFinder(kubernetesClientFactory);
if (crdUpgrade) {
CrdInstaller crdInstaller = new CrdInstallerImpl(crdFinder, crdFinder, crdLoader);
crdInstaller.installCustomResourceDefinitions();
}
if (conversionWebhooks) {
final SecretFinder secretFinder = new SecretFinder(kubernetesClientFactory);
WebhookConfigurator webhookConfigurator = new WebhookConfiguratorImpl(secretFinder, crdFinder, crdFinder, crdLoader);
webhookConfigurator.configureWebhooks();
}
if (dbOpsJob) {
String dbOpsCrName = JobsProperty.DATABASE_OPERATION_CR_NAME.getString();
String jobsNamespace = JobsProperty.JOB_NAMESPACE.getString();
dbOpLauncher.launchDbOp(dbOpsCrName, jobsNamespace);
}
return 0;
}
Aggregations