Search in sources :

Example 1 with SecretHandler

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

the class KubernetesAnnotationProcessor method generateSecrets.

private void generateSecrets(SecretModel secretModel, String balxFilePath, String outputDir) throws KubernetesPluginException {
    String balxFileName = KubernetesUtils.extractBalxName(balxFilePath);
    String secretContent = new SecretHandler(secretModel).generate();
    try {
        KubernetesUtils.writeToFile(secretContent, outputDir + File.separator + balxFileName + SECRET_FILE_POSTFIX + YAML);
    } catch (IOException e) {
        throw new KubernetesPluginException("Error while writing secret content", e);
    }
}
Also used : SecretHandler(org.ballerinax.kubernetes.handlers.SecretHandler) IOException(java.io.IOException) KubernetesPluginException(org.ballerinax.kubernetes.exceptions.KubernetesPluginException)

Aggregations

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