Skip to content

Commit

Permalink
<fix>: fix #1981 (#1984)
Browse files Browse the repository at this point in the history
* <fix>: fix #1981

* <fix>: drop unused import

---------

Co-authored-by: machunxiao <[email protected]>
  • Loading branch information
xiaoma20082008 and machunxiao authored Jul 31, 2023
1 parent f185480 commit 02777e3
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.javaoperatorsdk.operator;

import java.util.Arrays;

import io.fabric8.kubernetes.api.model.Cluster;
import io.fabric8.kubernetes.api.model.Namespaced;
import io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinition;
Expand All @@ -18,7 +16,7 @@ private CustomResourceUtils() {}
* @throws OperatorException when the Custom Resource has validation error
*/
public static void assertCustomResource(Class<?> resClass, CustomResourceDefinition crd) {
var namespaced = Arrays.asList(resClass.getInterfaces()).contains(Namespaced.class);
var namespaced = Namespaced.class.isAssignableFrom(resClass);

if (!namespaced && Namespaced.class.getSimpleName().equals(crd.getSpec().getScope())) {
throw new OperatorException(
Expand Down

0 comments on commit 02777e3

Please sign in to comment.