Search in sources :

Example 1 with CertificateList

use of io.fabric8.certmanager.api.model.v1beta1.CertificateList in project kubernetes-client by fabric8io.

the class V1VerticalPodAutoscalerCrudTest method shouldListAndGetVerticalPodAutoscaler.

@Test
void shouldListAndGetVerticalPodAutoscaler() {
    VerticalPodAutoscaler vpa2 = new VerticalPodAutoscalerBuilder().withNewMetadata().withName("vpa2").endMetadata().build();
    client.v1().verticalpodautoscalers().inNamespace("ns2").create(vpa2);
    VerticalPodAutoscalerList certificateList = client.v1().verticalpodautoscalers().inNamespace("ns2").list();
    assertNotNull(certificateList);
    assertEquals(1, certificateList.getItems().size());
}
Also used : VerticalPodAutoscaler(io.fabric8.verticalpodautoscaler.api.model.v1.VerticalPodAutoscaler) VerticalPodAutoscalerList(io.fabric8.verticalpodautoscaler.api.model.v1.VerticalPodAutoscalerList) VerticalPodAutoscalerBuilder(io.fabric8.verticalpodautoscaler.api.model.v1.VerticalPodAutoscalerBuilder) Test(org.junit.jupiter.api.Test)

Example 2 with CertificateList

use of io.fabric8.certmanager.api.model.v1beta1.CertificateList in project kubernetes-client by fabric8io.

the class V1CertificateCrudTest method shouldListAndGetCertificate.

@Test
void shouldListAndGetCertificate() {
    Certificate certificate2 = new CertificateBuilder().withNewMetadata().withName("cert2").endMetadata().build();
    client.v1().certificates().inNamespace("ns2").create(certificate2);
    CertificateList certificateList = client.v1().certificates().inNamespace("ns2").list();
    assertNotNull(certificateList);
    assertEquals(1, certificateList.getItems().size());
}
Also used : CertificateBuilder(io.fabric8.certmanager.api.model.v1.CertificateBuilder) CertificateList(io.fabric8.certmanager.api.model.v1.CertificateList) Certificate(io.fabric8.certmanager.api.model.v1.Certificate) Test(org.junit.jupiter.api.Test)

Example 3 with CertificateList

use of io.fabric8.certmanager.api.model.v1beta1.CertificateList in project kubernetes-client by fabric8io.

the class V1beta1CertificateCrudTest method shouldReturnEmptyList.

@Test
void shouldReturnEmptyList() {
    CertificateList certificateList = client.v1beta1().certificates().inNamespace("ns1").list();
    assertNotNull(certificateList);
    assertTrue(certificateList.getItems().isEmpty());
}
Also used : CertificateList(io.fabric8.certmanager.api.model.v1beta1.CertificateList) Test(org.junit.jupiter.api.Test)

Example 4 with CertificateList

use of io.fabric8.certmanager.api.model.v1beta1.CertificateList in project kubernetes-client by fabric8io.

the class CertificateCreate method main.

public static void main(String[] args) {
    try (NamespacedCertManagerClient certManagerClient = new DefaultCertManagerClient()) {
        String namespace = "default";
        Certificate certificate = new CertificateBuilder().build();
        // Create Certificate
        certManagerClient.v1beta1().certificates().inNamespace(namespace).create(certificate);
        System.out.println("Created: " + certificate.getMetadata().getName());
        // List Certificate
        CertificateList certificateList = certManagerClient.v1beta1().certificates().inNamespace(namespace).list();
        System.out.println("There are " + certificateList.getItems().size() + " TaskRun objects in " + namespace);
    }
}
Also used : NamespacedCertManagerClient(io.fabric8.certmanager.client.NamespacedCertManagerClient) DefaultCertManagerClient(io.fabric8.certmanager.client.DefaultCertManagerClient) CertificateBuilder(io.fabric8.certmanager.api.model.v1beta1.CertificateBuilder) CertificateList(io.fabric8.certmanager.api.model.v1beta1.CertificateList) Certificate(io.fabric8.certmanager.api.model.v1beta1.Certificate)

Example 5 with CertificateList

use of io.fabric8.certmanager.api.model.v1beta1.CertificateList in project kubernetes-client by fabric8io.

the class CertificateCreate method main.

public static void main(String[] args) {
    try (NamespacedCertManagerClient certManagerClient = new DefaultCertManagerClient()) {
        String namespace = "default";
        Certificate certificate = new CertificateBuilder().build();
        // Create Certificate
        certManagerClient.v1().certificates().inNamespace(namespace).create(certificate);
        System.out.println("Created: " + certificate.getMetadata().getName());
        // List Certificate
        CertificateList certificateList = certManagerClient.v1().certificates().inNamespace(namespace).list();
        System.out.println("There are " + certificateList.getItems().size() + " TaskRun objects in " + namespace);
    }
}
Also used : NamespacedCertManagerClient(io.fabric8.certmanager.client.NamespacedCertManagerClient) DefaultCertManagerClient(io.fabric8.certmanager.client.DefaultCertManagerClient) CertificateBuilder(io.fabric8.certmanager.api.model.v1.CertificateBuilder) CertificateList(io.fabric8.certmanager.api.model.v1.CertificateList) Certificate(io.fabric8.certmanager.api.model.v1.Certificate)

Aggregations

CertificateList (org.bouncycastle.asn1.x509.CertificateList)13 IOException (java.io.IOException)9 Test (org.junit.jupiter.api.Test)9 CRLException (java.security.cert.CRLException)6 X509CRL (java.security.cert.X509CRL)5 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)5 X509CRLHolder (org.bouncycastle.cert.X509CRLHolder)5 OperationException (org.xipki.ca.api.OperationException)5 DefaultCertManagerClient (io.fabric8.certmanager.client.DefaultCertManagerClient)4 NamespacedCertManagerClient (io.fabric8.certmanager.client.NamespacedCertManagerClient)4 CertificateList (io.fabric8.certmanager.api.model.v1.CertificateList)3 CertificateList (io.fabric8.certmanager.api.model.v1alpha2.CertificateList)3 CertificateList (io.fabric8.certmanager.api.model.v1alpha3.CertificateList)3 CertificateList (io.fabric8.certmanager.api.model.v1beta1.CertificateList)3 BigInteger (java.math.BigInteger)3 Date (java.util.Date)3 CertificateList (com.beanit.asn1bean.compiler.pkix1explicit88.CertificateList)2 Certificate (io.fabric8.certmanager.api.model.v1.Certificate)2 CertificateBuilder (io.fabric8.certmanager.api.model.v1.CertificateBuilder)2 Certificate (io.fabric8.certmanager.api.model.v1alpha2.Certificate)2