Search in sources :

Example 1 with PersistentVolumeClaimHandler

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

the class KubernetesAnnotationProcessor method generatePersistentVolumeClaim.

private void generatePersistentVolumeClaim(PersistentVolumeClaimModel volumeClaimModel, String balxFilePath, String outputDir) throws KubernetesPluginException {
    String balxFileName = KubernetesUtils.extractBalxName(balxFilePath);
    String configMapContent = new PersistentVolumeClaimHandler(volumeClaimModel).generate();
    try {
        KubernetesUtils.writeToFile(configMapContent, outputDir + File.separator + balxFileName + VOLUME_CLAIM_FILE_POSTFIX + YAML);
    } catch (IOException e) {
        throw new KubernetesPluginException("Error while writing volume claim content", e);
    }
}
Also used : IOException(java.io.IOException) KubernetesPluginException(org.ballerinax.kubernetes.exceptions.KubernetesPluginException) PersistentVolumeClaimHandler(org.ballerinax.kubernetes.handlers.PersistentVolumeClaimHandler)

Aggregations

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