Skip to content

Commit

Permalink
filtering fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Mészáros <[email protected]>
  • Loading branch information
csviri committed Dec 5, 2023
1 parent d4029e1 commit 88e97bc
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,14 @@ private void addExplicitlyAddedKubernetesResources(File helmDir,
private List<HasMetadata> filterOutStandardResources(List<HasMetadata> list, ApplicationInfoBuildItem appInfo) {
return list.stream().filter(r -> {
if (r instanceof ClusterRole) {
return !r.getMetadata().getName().equals("simple-cluster-role") &&
!r.getMetadata().getName().equals("josdk-crd-validating-cluster-role");
return !r.getMetadata().getName().endsWith("-cluster-role");
}
if (r instanceof ClusterRoleBinding) {
return !r.getMetadata().getName().equals("simple-crd-validating-role-binding");
return !r.getMetadata().getName().endsWith("-crd-validating-role-binding");
}
if (r instanceof RoleBinding) {
return !r.getMetadata().getName().equals(appInfo.getName() + "-view") &&
!r.getMetadata().getName().equals("simple-role-binding");
!r.getMetadata().getName().endsWith("-role-binding");
}
if (r instanceof Service || r instanceof Deployment || r instanceof ServiceAccount) {
return !r.getMetadata().getName().equals(appInfo.getName());
Expand All @@ -128,7 +127,7 @@ private List<HasMetadata> filterOutStandardResources(List<HasMetadata> list, App
private void addResourceToHelmDir(File helmDir, List<HasMetadata> list) {
String yaml = kubernetesSerialization.asYaml(list);
try {
Files.writeString(Path.of(helmDir.getPath(), TEMPLATES_DIR, "deployment.yaml"), yaml);
Files.writeString(Path.of(helmDir.getPath(), TEMPLATES_DIR, "kubernetes.yml"), yaml);
} catch (IOException e) {
throw new IllegalStateException(e);
}
Expand Down

0 comments on commit 88e97bc

Please sign in to comment.