Class AbstractOperatorExtension

  • 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
    Direct Known Subclasses:
    ClusterDeployedOperatorExtension, LocallyRunOperatorExtension

    public abstract class AbstractOperatorExtension
    extends Object
    implements HasKubernetesClient, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.AfterEachCallback
    • Field Detail

      • MAX_NAMESPACE_NAME_LENGTH

        public static final int MAX_NAMESPACE_NAME_LENGTH
        See Also:
        Constant Field Values
      • DEFAULT_NAMESPACE_DELETE_TIMEOUT

        public static final int DEFAULT_NAMESPACE_DELETE_TIMEOUT
        See Also:
        Constant Field Values
      • infrastructure

        protected final List<io.fabric8.kubernetes.api.model.HasMetadata> infrastructure
      • infrastructureTimeout

        protected Duration infrastructureTimeout
      • oneNamespacePerClass

        protected final boolean oneNamespacePerClass
      • preserveNamespaceOnError

        protected final boolean preserveNamespaceOnError
      • waitForNamespaceDeletion

        protected final boolean waitForNamespaceDeletion
      • namespaceNameSupplier

        protected final Function<org.junit.jupiter.api.extension.ExtensionContext,​String> namespaceNameSupplier
      • perClassNamespaceNameSupplier

        protected final Function<org.junit.jupiter.api.extension.ExtensionContext,​String> perClassNamespaceNameSupplier
      • namespace

        protected String namespace
    • Constructor Detail

      • AbstractOperatorExtension

        protected AbstractOperatorExtension​(List<io.fabric8.kubernetes.api.model.HasMetadata> infrastructure,
                                            Duration infrastructureTimeout,
                                            boolean oneNamespacePerClass,
                                            boolean preserveNamespaceOnError,
                                            boolean waitForNamespaceDeletion,
                                            io.fabric8.kubernetes.client.KubernetesClient kubernetesClient,
                                            Function<org.junit.jupiter.api.extension.ExtensionContext,​String> namespaceNameSupplier,
                                            Function<org.junit.jupiter.api.extension.ExtensionContext,​String> perClassNamespaceNameSupplier)
    • Method Detail

      • beforeAll

        public void beforeAll​(org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
      • beforeEach

        public void beforeEach​(org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        beforeEach in interface org.junit.jupiter.api.extension.BeforeEachCallback
      • afterAll

        public void afterAll​(org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        afterAll in interface org.junit.jupiter.api.extension.AfterAllCallback
      • afterEach

        public void afterEach​(org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback
      • getNamespace

        public String getNamespace()
      • resources

        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> io.fabric8.kubernetes.client.dsl.NonNamespaceOperation<T,​io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,​io.fabric8.kubernetes.client.dsl.Resource<T>> resources​(Class<T> type)
      • get

        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T get​(Class<T> type,
                                                                             String name)
      • create

        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T create​(T resource)
      • create

        @Deprecated(forRemoval=true)
        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T create​(Class<T> type,
                                                                                T resource)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • replace

        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T replace​(T resource)
      • replace

        @Deprecated(forRemoval=true)
        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> T replace​(Class<T> type,
                                                                                 T resource)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • delete

        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> boolean delete​(T resource)
      • delete

        @Deprecated(forRemoval=true)
        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> boolean delete​(Class<T> type,
                                                                                      T resource)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • beforeAllImpl

        protected void beforeAllImpl​(org.junit.jupiter.api.extension.ExtensionContext context)
      • beforeEachImpl

        protected void beforeEachImpl​(org.junit.jupiter.api.extension.ExtensionContext context)
      • before

        protected void before​(org.junit.jupiter.api.extension.ExtensionContext context)
      • afterAllImpl

        protected void afterAllImpl​(org.junit.jupiter.api.extension.ExtensionContext context)
      • afterEachImpl

        protected void afterEachImpl​(org.junit.jupiter.api.extension.ExtensionContext context)
      • after

        protected void after​(org.junit.jupiter.api.extension.ExtensionContext context)
      • deleteOperator

        protected void deleteOperator()