use of com.github.zhenwei.core.asn1.x509.Certificate in project kubernetes-client by fabric8io.
the class V1alpha2CertificateCrudTest method shouldDeleteACertificate.
@Test
void shouldDeleteACertificate() {
Certificate certificate3 = new CertificateBuilder().withNewMetadata().withName("cert3").endMetadata().build();
client.v1alpha2().certificates().inNamespace("ns3").create(certificate3);
Boolean deleted = client.v1alpha2().certificates().inNamespace("ns3").withName("cert3").delete();
assertTrue(deleted);
}
use of com.github.zhenwei.core.asn1.x509.Certificate in project kubernetes-client by fabric8io.
the class V1beta1CertificateCrudTest method shouldDeleteACertificate.
@Test
void shouldDeleteACertificate() {
Certificate certificate3 = new CertificateBuilder().withNewMetadata().withName("cert3").endMetadata().build();
client.v1beta1().certificates().inNamespace("ns3").create(certificate3);
Boolean deleted = client.v1beta1().certificates().inNamespace("ns3").withName("cert3").delete();
assertTrue(deleted);
}
use of com.github.zhenwei.core.asn1.x509.Certificate in project kubernetes-client by fabric8io.
the class V1beta1CertificateCrudTest method shouldLoadCertificate.
@Test
void shouldLoadCertificate() {
String certificateDefinition = String.join("\n", Arrays.asList("apiVersion: cert-manager.io/v1beta1", "kind: Certificate", "metadata:", " name: ca-issuer", "spec:", " isCA: true", " secretName: ca-key-pair", " commonName: my-csi-app", " issuerRef:", " name: selfsigned-issuer", " kind: Issuer", " group: cert-manager.io"));
Certificate certificate = client.v1beta1().certificates().inNamespace("ns4").load(new ByteArrayInputStream(certificateDefinition.getBytes())).createOrReplace();
assertEquals("ca-issuer", certificate.getMetadata().getName());
assertEquals("ca-key-pair", certificate.getSpec().getSecretName());
assertEquals("my-csi-app", certificate.getSpec().getCommonName());
}
use of com.github.zhenwei.core.asn1.x509.Certificate 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);
}
}
use of com.github.zhenwei.core.asn1.x509.Certificate 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);
}
}
Aggregations