Skip to content

Commit

Permalink
fix: issue a warning if CRD couldn't be applied
Browse files Browse the repository at this point in the history
Fixes #981

Signed-off-by: Chris Laprun <[email protected]>
  • Loading branch information
metacosm committed Oct 30, 2024
1 parent 84fa541 commit 6e73ff8
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static void applyCRD(KubernetesClient client, CRDGenerationInfo crdInfo,
}
});
} catch (Exception exception) {
LOGGER.debugv(exception, "Couldn't apply ''{0}'' CRD", crdName);
LOGGER.warnv(exception, "Couldn't apply ''{0}'' CRD", crdName);
}
}

Expand Down Expand Up @@ -61,13 +61,10 @@ private static void apply(KubernetesClient client, String v, Object crd) {
}

private static Class<?> getCRDClassFor(String v) {
switch (v) {
case "v1":
return CustomResourceDefinition.class;
case "v1beta1":
return io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition.class;
default:
throw new IllegalArgumentException("Unknown CRD version: " + v);
}
return switch (v) {
case "v1" -> CustomResourceDefinition.class;
case "v1beta1" -> io.fabric8.kubernetes.api.model.apiextensions.v1beta1.CustomResourceDefinition.class;
default -> throw new IllegalArgumentException("Unknown CRD version: " + v);
};
}
}

0 comments on commit 6e73ff8

Please sign in to comment.