use of io.javaoperatorsdk.operator.Operator in project keycloak by keycloak.
the class ClusterOperatorTest method createRBACresourcesAndOperatorDeployment.
private static void createRBACresourcesAndOperatorDeployment() throws FileNotFoundException {
Log.info("Creating RBAC into Namespace " + namespace);
List<HasMetadata> hasMetadata = k8sclient.load(new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + deploymentTarget + ".yml")).inNamespace(namespace).get();
hasMetadata.stream().map(b -> {
if ("Deployment".equalsIgnoreCase(b.getKind()) && b.getMetadata().getName().contains("operator")) {
((Deployment) b).getSpec().getTemplate().getSpec().getContainers().get(0).setImagePullPolicy("Never");
}
return b;
}).forEach(c -> {
Log.info("processing part : " + c.getKind() + "--" + c.getMetadata().getName() + " -- " + namespace);
k8sclient.resource(c).inNamespace(namespace).createOrReplace();
});
}
use of io.javaoperatorsdk.operator.Operator in project keycloak by keycloak.
the class ClusterOperatorTest method createOperator.
private static void createOperator() {
operator = new Operator(k8sclient, configuration);
operator.getConfigurationService().getClientConfiguration().setNamespace(namespace);
}
Aggregations