private void discoverFolderMounts() { List<VolumeMount> volumeMounts = zaleniumPod.getSpec().getContainers().get(0).getVolumeMounts(); List<VolumeMount> validMounts = new ArrayList<>(); volumeMounts.stream() .filter(volumeMount -> !Arrays.asList(PROTECTED_NODE_MOUNT_POINTS).contains(volumeMount.getMountPath())) .forEach(validMounts::add); // Look through the volume mounts to see if the shared folder is mounted if (!validMounts.isEmpty()) { List<Volume> volumes = zaleniumPod.getSpec().getVolumes(); for (VolumeMount validMount : validMounts) { volumes.stream() .filter(volume -> validMount.getName().equalsIgnoreCase(volume.getName())) .findFirst() .ifPresent(volume -> mountedSharedFoldersMap.put(validMount, volume)); } } }
private boolean isVolumeMountAlreadyExists(List<VolumeMount> volumes, String volumeName) { for (VolumeMount v : volumes) { if (volumeName.equals(v.getName())) { return true; } } return false; } });
private boolean isVolumeMountAlreadyExists(List<VolumeMount> volumes, String volumeName) { for (VolumeMount v : volumes) { if (volumeName.equals(v.getName())) { return true; } } return false; } });
private String getMountPath(List<Container> containers, String name){ for (Container container : containers) { List<VolumeMount> volumeMounts = container.getVolumeMounts(); if (volumeMounts != null) { for (VolumeMount volumeMount : volumeMounts) { if (name.equals(volumeMount.getName())){ return volumeMount.getMountPath(); } } } } throw new IllegalArgumentException("No matching volume mount found for volume "+ name); }
private String getMountPath(List<Container> containers, String name){ for (Container container : containers) { List<VolumeMount> volumeMounts = container.getVolumeMounts(); if (volumeMounts != null) { for (VolumeMount volumeMount : volumeMounts) { if (name.equals(volumeMount.getName())){ return volumeMount.getMountPath(); } } } } throw new IllegalArgumentException("No matching volume mount found for volume "+ name); }
protected List<VolumeMount> getVolumeMounts() { List<VolumeMount> volumeMountList = new ArrayList<>(1); volumeMountList.add(createVolumeMount(logAndMetricsConfigVolumeName, logAndMetricsConfigMountPath)); if (trustedCertificates != null && trustedCertificates.size() > 0) { for (CertSecretSource certSecretSource: trustedCertificates) { // skipping if a volume mount with same Secret name was already added if (!volumeMountList.stream().anyMatch(vm -> vm.getName().equals(certSecretSource.getSecretName()))) { volumeMountList.add(createVolumeMount(certSecretSource.getSecretName(), TLS_CERTS_BASE_VOLUME_MOUNT + certSecretSource.getSecretName())); } } } if (tlsAuthCertAndKey != null) { // skipping if a volume mount with same Secret name was already added if (!volumeMountList.stream().anyMatch(vm -> vm.getName().equals(tlsAuthCertAndKey.getSecretName()))) { volumeMountList.add(createVolumeMount(tlsAuthCertAndKey.getSecretName(), TLS_CERTS_BASE_VOLUME_MOUNT + tlsAuthCertAndKey.getSecretName())); } } else if (passwordSecret != null) { volumeMountList.add(createVolumeMount(passwordSecret.getSecretName(), PASSWORD_VOLUME_MOUNT + passwordSecret.getSecretName())); } volumeMountList.addAll(getExternalConfigurationVolumeMounts()); return volumeMountList; }
public VolumeMountBuilder( VolumeMountFluent<?> fluent , VolumeMount instance ){ this.fluent = fluent; fluent.withMountPath(instance.getMountPath()); fluent.withName(instance.getName()); fluent.withReadOnly(instance.getReadOnly()); } public VolumeMountBuilder( VolumeMount instance ){
public VolumeMountBuilder( VolumeMountFluent<?> fluent , VolumeMount instance ){ this.fluent = fluent; fluent.withMountPath(instance.getMountPath()); fluent.withName(instance.getName()); fluent.withReadOnly(instance.getReadOnly()); } public VolumeMountBuilder( VolumeMount instance ){
public VolumeMountBuilder( VolumeMount instance ){ this.fluent = this; this.withMountPath(instance.getMountPath()); this.withName(instance.getName()); this.withReadOnly(instance.getReadOnly()); }
public VolumeMountBuilder( VolumeMount instance ){ this.fluent = this; this.withMountPath(instance.getMountPath()); this.withName(instance.getName()); this.withReadOnly(instance.getReadOnly()); }
for (CertSecretSource certSecretSource: producer.getTls().getTrustedCertificates()) { if (!volumeMountList.stream().anyMatch(vm -> vm.getName().equals(certSecretSource.getSecretName()))) { volumeMountList.add(createVolumeMount(certSecretSource.getSecretName(), TLS_CERTS_VOLUME_MOUNT_PRODUCER + certSecretSource.getSecretName())); if (!volumeMountList.stream().anyMatch(vm -> vm.getName().equals(producerTlsAuthCertAndKey.getSecretName()))) { volumeMountList.add(createVolumeMount(producerTlsAuthCertAndKey.getSecretName(), TLS_CERTS_VOLUME_MOUNT_PRODUCER + producerTlsAuthCertAndKey.getSecretName())); for (CertSecretSource certSecretSource: consumer.getTls().getTrustedCertificates()) { if (!volumeMountList.stream().anyMatch(vm -> vm.getName().equals(certSecretSource.getSecretName()))) { volumeMountList.add(createVolumeMount(certSecretSource.getSecretName(), TLS_CERTS_VOLUME_MOUNT_CONSUMER + certSecretSource.getSecretName())); if (!volumeMountList.stream().anyMatch(vm -> vm.getName().equals(consumerTlsAuthCertAndKey.getSecretName()))) { volumeMountList.add(createVolumeMount(consumerTlsAuthCertAndKey.getSecretName(), TLS_CERTS_VOLUME_MOUNT_CONSUMER + consumerTlsAuthCertAndKey.getSecretName()));
public VolumeMountBuilder(VolumeMountFluent<?> fluent,VolumeMount instance,Boolean validationEnabled){ this.fluent = fluent; fluent.withMountPath(instance.getMountPath()); fluent.withName(instance.getName()); fluent.withReadOnly(instance.getReadOnly()); fluent.withSubPath(instance.getSubPath()); this.validationEnabled = validationEnabled; } public VolumeMountBuilder(VolumeMount instance){
public VolumeMountBuilder(VolumeMount instance,Boolean validationEnabled){ this.fluent = this; this.withMountPath(instance.getMountPath()); this.withName(instance.getName()); this.withReadOnly(instance.getReadOnly()); this.withSubPath(instance.getSubPath()); this.validationEnabled = validationEnabled; }
public VolumeMountFluentImpl(VolumeMount instance){ this.withMountPath(instance.getMountPath()); this.withName(instance.getName()); this.withReadOnly(instance.getReadOnly()); this.withSubPath(instance.getSubPath()); }
.anyMatch(volumeMount -> volumeMount.getName().equals(volume.getName()))) .collect(Collectors.toList()));