Class LocallyRunOperatorExtension

  • All Implemented Interfaces:
    HasKubernetesClient, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.Extension

    public class LocallyRunOperatorExtension
    extends AbstractOperatorExtension
    • Method Detail

      • applyCrd

        public static void applyCrd​(Class<? extends io.fabric8.kubernetes.api.model.HasMetadata> resourceClass,
                                    io.fabric8.kubernetes.client.KubernetesClient client)
      • applyCrd

        public static void applyCrd​(String resourceTypeName,
                                    io.fabric8.kubernetes.client.KubernetesClient client)
        Applies the CRD associated with the specified resource name to the cluster. Note that the CRD is assumed to have been generated in this case from the Java classes and is therefore expected to be found in the standard location with the default name for such CRDs and assumes a v1 version of the CRD spec is used. This means that, provided a given resourceTypeName, the associated CRD is expected to be found at META-INF/fabric8/resourceTypeName-v1.yml in the project's classpath.
        Parameters:
        resourceTypeName - the standard resource name for CRDs i.e. plural.group
        client - the kubernetes client to use to connect to the cluster
      • applyCrd

        public static void applyCrd​(io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinition crd,
                                    io.fabric8.kubernetes.client.KubernetesClient client)
      • parseCrds

        public static List<io.fabric8.kubernetes.api.model.apiextensions.v1.CustomResourceDefinition> parseCrds​(String path,
                                                                                                                io.fabric8.kubernetes.client.KubernetesClient client)
      • getFirstReconciler

        public Reconciler getFirstReconciler()
      • getReconcilerOfType

        public <T extends Reconciler> T getReconcilerOfType​(Class<T> type)
      • getOperator

        public Operator getOperator()
      • applyCrd

        public void applyCrd​(String resourceTypeName)