Search in sources :

Example 1 with ConfigMapHandler

use of org.ballerinax.kubernetes.handlers.ConfigMapHandler in project kubernetes by ballerinax.

the class KubernetesAnnotationProcessor method generateConfigMaps.

private void generateConfigMaps(ConfigMapModel configMapModel, String balxFilePath, String outputDir) throws KubernetesPluginException {
    String balxFileName = KubernetesUtils.extractBalxName(balxFilePath);
    String configMapContent = new ConfigMapHandler(configMapModel).generate();
    try {
        KubernetesUtils.writeToFile(configMapContent, outputDir + File.separator + balxFileName + CONFIG_MAP_FILE_POSTFIX + YAML);
    } catch (IOException e) {
        throw new KubernetesPluginException("Error while writing config map content", e);
    }
}
Also used : IOException(java.io.IOException) KubernetesPluginException(org.ballerinax.kubernetes.exceptions.KubernetesPluginException) ConfigMapHandler(org.ballerinax.kubernetes.handlers.ConfigMapHandler)

Aggregations

IOException (java.io.IOException)1 KubernetesPluginException (org.ballerinax.kubernetes.exceptions.KubernetesPluginException)1 ConfigMapHandler (org.ballerinax.kubernetes.handlers.ConfigMapHandler)1