io.fabric8.kubernetes.api.model.SecretList Java Examples

The following examples show how to use io.fabric8.kubernetes.api.model.SecretList. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SecretsController.java    From rabbitmq-operator with Apache License 2.0 4 votes vote down vote up
@Override
protected MixedOperation<Secret, SecretList, DoneableSecret, Resource<Secret, DoneableSecret>> operation() {
    return getClient().secrets();
}
 
Example #2
Source File: Fabric8KubernetesClient.java    From styx with Apache License 2.0 4 votes vote down vote up
@Override
public SecretList listSecrets() {
  return client.secrets().list();
}
 
Example #3
Source File: SecretOperator.java    From strimzi-kafka-operator with Apache License 2.0 4 votes vote down vote up
@Override
protected MixedOperation<Secret, SecretList, DoneableSecret, Resource<Secret, DoneableSecret>> operation() {
    return client.secrets();
}
 
Example #4
Source File: SecretOperatorTest.java    From strimzi-kafka-operator with Apache License 2.0 4 votes vote down vote up
@Override
protected AbstractResourceOperator<KubernetesClient, Secret, SecretList, DoneableSecret, Resource<Secret, DoneableSecret>> createResourceOperations(Vertx vertx, KubernetesClient mockClient) {
    return new SecretOperator(vertx, mockClient);
}
 
Example #5
Source File: SecretCrudTest.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Test
public void testCrud() {
  KubernetesClient client = server.getClient();

  Secret secret1 = new SecretBuilder()
    .withNewMetadata().withName("secret1").addToLabels("foo", "bar").endMetadata()
    .addToData("username", "guccifer")
    .addToData("password", "shadowgovernment")
    .addToData("secret1", "SECRET1")
    .build();

  Secret secret2 = new SecretBuilder()
    .withNewMetadata().withName("secret2").addToLabels("foo", "bar").endMetadata()
    .addToData("one", "1")
    .build();

  client.secrets().inNamespace("ns1").create(secret1);
  client.secrets().inNamespace("ns2").create(secret2);

  SecretList aSecretList = client.secrets().list();
  assertNotNull(aSecretList);
  assertEquals(0, aSecretList.getItems().size());

  aSecretList = client.secrets().inAnyNamespace().list();
  assertNotNull(aSecretList);
  assertEquals(2, aSecretList.getItems().size());

  aSecretList = client.secrets().inNamespace("ns1").list();
  assertNotNull(aSecretList);
  assertEquals(1, aSecretList.getItems().size());

  aSecretList = client.secrets().inAnyNamespace().withLabels(Collections.singletonMap("foo", "bar")).list();
  assertNotNull(aSecretList);
  assertEquals(2, aSecretList.getItems().size());

  boolean bDeleted = client.secrets().inNamespace("ns1").withName("secret1").delete();
  aSecretList = client.secrets().inNamespace("ns1").list();
  assertTrue(bDeleted);
  assertNotNull(aSecretList);
  assertEquals(0, aSecretList.getItems().size());

  secret2 = client.secrets().inNamespace("ns2").withName("secret2").edit().removeFromData("one").done();
  assertNotNull(secret2);
  assertEquals(null, secret2.getData());
}
 
Example #6
Source File: AutoAdaptableKubernetesClient.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
public MixedOperation<Secret, SecretList, DoneableSecret, Resource<Secret, DoneableSecret>> secrets() {
  return delegate.secrets();
}
 
Example #7
Source File: DefaultKubernetesClient.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
@Override
public MixedOperation<Secret, SecretList, DoneableSecret, Resource<Secret, DoneableSecret>> secrets() {
  return new SecretOperationsImpl(httpClient, getConfiguration());
}
 
Example #8
Source File: ManagedKubernetesClient.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public MixedOperation<Secret, SecretList, DoneableSecret, Resource<Secret, DoneableSecret>> secrets() {
  return delegate.secrets();
}
 
Example #9
Source File: KubernetesClient.java    From kubernetes-client with Apache License 2.0 2 votes vote down vote up
/**
 * API entrypoint for Secret related operations. Secret (core/v1)
 *
 * @return MixedOperation object for Secret related operations.
 */
MixedOperation<Secret, SecretList, DoneableSecret, Resource<Secret, DoneableSecret>> secrets();
 
Example #10
Source File: Fabric8KubernetesClient.java    From styx with Apache License 2.0 votes vote down vote up
SecretList listSecrets();