本文整理了Java中io.fabric8.kubernetes.api.model.Volume.getName()
方法的一些代码示例,展示了Volume.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Volume.getName()
方法的具体详情如下:
包路径:io.fabric8.kubernetes.api.model.Volume
类名称:Volume
方法名:getName
暂无
代码示例来源:origin: zalando/zalenium
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));
}
}
}
代码示例来源:origin: io.fabric8/fabric8-maven-enricher-fabric8
private boolean isVolumeAlreadyExists(List<Volume> volumes, String volumeName) {
for (Volume v : volumes) {
if (volumeName.equals(v.getName())) {
return true;
}
}
return false;
}
});
代码示例来源:origin: fabric8io/fabric8-maven-plugin
private boolean isVolumeAlreadyExists(List<Volume> volumes, String volumeName) {
for (Volume v : volumes) {
if (volumeName.equals(v.getName())) {
return true;
}
}
return false;
}
});
代码示例来源:origin: fabric8io/fabric8-maven-plugin
private Map<String, String> extractMountPoints(PodSpec podSpec) {
Map<String, String> nameToMount = new LinkedHashMap<>();
List<Volume> volumes = podSpec.getVolumes();
if (volumes != null) {
for (Volume volume : volumes) {
PersistentVolumeClaimVolumeSource persistentVolumeClaim = volume.getPersistentVolumeClaim();
if (persistentVolumeClaim != null) {
String name = volume.getName();
String mountPath = getMountPath(podSpec.getContainers(), name);
nameToMount.put(name, mountPath);
}
}
}
return nameToMount;
}
代码示例来源:origin: io.fabric8/fabric8-maven-enricher-standard
private Map<String, String> extractMountPoints(PodSpec podSpec) {
Map<String, String> nameToMount = new LinkedHashMap<>();
List<Volume> volumes = podSpec.getVolumes();
if (volumes != null) {
for (Volume volume : volumes) {
PersistentVolumeClaimVolumeSource persistentVolumeClaim = volume.getPersistentVolumeClaim();
if (persistentVolumeClaim != null) {
String name = volume.getName();
String mountPath = getMountPath(podSpec.getContainers(), name);
nameToMount.put(name, mountPath);
}
}
}
return nameToMount;
}
代码示例来源:origin: strimzi/strimzi-kafka-operator
protected List<Volume> getVolumes(boolean isOpenShift) {
List<Volume> volumeList = new ArrayList<>(1);
volumeList.add(createConfigMapVolume(logAndMetricsConfigVolumeName, ancillaryConfigName));
if (trustedCertificates != null && trustedCertificates.size() > 0) {
for (CertSecretSource certSecretSource: trustedCertificates) {
// skipping if a volume with same Secret name was already added
if (!volumeList.stream().anyMatch(v -> v.getName().equals(certSecretSource.getSecretName()))) {
volumeList.add(createSecretVolume(certSecretSource.getSecretName(), certSecretSource.getSecretName(), isOpenShift));
}
}
}
if (tlsAuthCertAndKey != null) {
// skipping if a volume with same Secret name was already added
if (!volumeList.stream().anyMatch(v -> v.getName().equals(tlsAuthCertAndKey.getSecretName()))) {
volumeList.add(createSecretVolume(tlsAuthCertAndKey.getSecretName(), tlsAuthCertAndKey.getSecretName(), isOpenShift));
}
} else if (passwordSecret != null) {
volumeList.add(createSecretVolume(passwordSecret.getSecretName(), passwordSecret.getSecretName(), isOpenShift));
}
volumeList.addAll(getExternalConfigurationVolumes(isOpenShift));
return volumeList;
}
代码示例来源:origin: strimzi/strimzi-kafka-operator
protected void createClientSecretVolume(KafkaMirrorMakerClientSpec client, CertAndKeySecretSource clientTlsAuthCertAndKey, PasswordSecretSource clientPasswordSecret, List<Volume> volumeList, boolean isOpenShift) {
if (client.getTls() != null && client.getTls().getTrustedCertificates() != null && client.getTls().getTrustedCertificates().size() > 0) {
for (CertSecretSource certSecretSource: client.getTls().getTrustedCertificates()) {
// skipping if a volume with same Secret name was already added
if (!volumeList.stream().anyMatch(v -> v.getName().equals(certSecretSource.getSecretName()))) {
volumeList.add(createSecretVolume(certSecretSource.getSecretName(), certSecretSource.getSecretName(), isOpenShift));
}
}
}
if (clientTlsAuthCertAndKey != null) {
if (!volumeList.stream().anyMatch(v -> v.getName().equals(clientTlsAuthCertAndKey.getSecretName()))) {
volumeList.add(createSecretVolume(clientTlsAuthCertAndKey.getSecretName(), clientTlsAuthCertAndKey.getSecretName(), isOpenShift));
}
} else if (clientPasswordSecret != null) {
volumeList.add(createSecretVolume(clientPasswordSecret.getSecretName(), clientPasswordSecret.getSecretName(), isOpenShift));
}
}
代码示例来源:origin: spring-cloud/spring-cloud-deployer-kubernetes
.noneMatch(existingVolume -> existingVolume.getName().equals(volume.getName())))
.collect(Collectors.toList()));
代码示例来源:origin: carlossg/jenkins-kubernetes-plugin
if (pod.getSpec().getVolumes().stream().noneMatch(v -> WORKSPACE_VOLUME_NAME.equals(v.getName()))) {
pod.getSpec().getVolumes()
.add(new VolumeBuilder().withName(WORKSPACE_VOLUME_NAME).withNewEmptyDir().endEmptyDir().build());
代码示例来源:origin: strimzi/strimzi-kafka-operator
for (int i = 0; i < volumes.size(); i++) {
Volume vol = volumes.get(i);
if (vol.getName().startsWith(AbstractModel.VOLUME_NAME) && vol.getEmptyDir() != null) {
desired.getSpec().getTemplate().getSpec().getVolumes().add(0, volumes.get(i));
break;
for (int i = 0; i < volumes.size(); i++) {
Volume vol = volumes.get(i);
if (vol.getName().startsWith(AbstractModel.VOLUME_NAME) && vol.getEmptyDir() != null) {
volumes.remove(i);
break;
代码示例来源:origin: spring-cloud/spring-cloud-deployer-kubernetes
.anyMatch(volumeMount -> volumeMount.getName().equals(volume.getName())))
.collect(Collectors.toList()));
代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model
public VolumeBuilder( Volume instance ){
this.fluent = this; this.withAwsElasticBlockStore(instance.getAwsElasticBlockStore()); this.withEmptyDir(instance.getEmptyDir()); this.withGcePersistentDisk(instance.getGcePersistentDisk()); this.withGitRepo(instance.getGitRepo()); this.withGlusterfs(instance.getGlusterfs()); this.withHostPath(instance.getHostPath()); this.withIscsi(instance.getIscsi()); this.withName(instance.getName()); this.withNfs(instance.getNfs()); this.withPersistentVolumeClaim(instance.getPersistentVolumeClaim()); this.withRbd(instance.getRbd()); this.withSecret(instance.getSecret());
}
代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model
public VolumeBuilder( VolumeFluent<?> fluent , Volume instance ){
this.fluent = fluent; fluent.withAwsElasticBlockStore(instance.getAwsElasticBlockStore()); fluent.withEmptyDir(instance.getEmptyDir()); fluent.withGcePersistentDisk(instance.getGcePersistentDisk()); fluent.withGitRepo(instance.getGitRepo()); fluent.withGlusterfs(instance.getGlusterfs()); fluent.withHostPath(instance.getHostPath()); fluent.withIscsi(instance.getIscsi()); fluent.withName(instance.getName()); fluent.withNfs(instance.getNfs()); fluent.withPersistentVolumeClaim(instance.getPersistentVolumeClaim()); fluent.withRbd(instance.getRbd()); fluent.withSecret(instance.getSecret());
}
public VolumeBuilder( Volume instance ){
代码示例来源:origin: org.apache.stratos/kubernetes-model
public VolumeBuilder( VolumeFluent<?> fluent , Volume instance ){
this.fluent = fluent; fluent.withAwsElasticBlockStore(instance.getAwsElasticBlockStore()); fluent.withEmptyDir(instance.getEmptyDir()); fluent.withGcePersistentDisk(instance.getGcePersistentDisk()); fluent.withGitRepo(instance.getGitRepo()); fluent.withGlusterfs(instance.getGlusterfs()); fluent.withHostPath(instance.getHostPath()); fluent.withIscsi(instance.getIscsi()); fluent.withName(instance.getName()); fluent.withNfs(instance.getNfs()); fluent.withPersistentVolumeClaim(instance.getPersistentVolumeClaim()); fluent.withRbd(instance.getRbd()); fluent.withSecret(instance.getSecret());
}
public VolumeBuilder( Volume instance ){
代码示例来源:origin: spotify/styx
.withName(saVolume.getName())
.withReadOnly(true)
.build();
.withName(secretVolume.getName())
.withReadOnly(true)
.build();
代码示例来源:origin: org.apache.stratos/kubernetes-model
public VolumeBuilder( Volume instance ){
this.fluent = this; this.withAwsElasticBlockStore(instance.getAwsElasticBlockStore()); this.withEmptyDir(instance.getEmptyDir()); this.withGcePersistentDisk(instance.getGcePersistentDisk()); this.withGitRepo(instance.getGitRepo()); this.withGlusterfs(instance.getGlusterfs()); this.withHostPath(instance.getHostPath()); this.withIscsi(instance.getIscsi()); this.withName(instance.getName()); this.withNfs(instance.getNfs()); this.withPersistentVolumeClaim(instance.getPersistentVolumeClaim()); this.withRbd(instance.getRbd()); this.withSecret(instance.getSecret());
}
代码示例来源:origin: org.domeos/kubernetes-model
public VolumeBuilder(VolumeFluent<?> fluent,Volume instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withAwsElasticBlockStore(instance.getAwsElasticBlockStore());
fluent.withAzureFile(instance.getAzureFile());
fluent.withCephfs(instance.getCephfs());
fluent.withCinder(instance.getCinder());
fluent.withConfigMap(instance.getConfigMap());
fluent.withDownwardAPI(instance.getDownwardAPI());
fluent.withEmptyDir(instance.getEmptyDir());
fluent.withFc(instance.getFc());
fluent.withFlexVolume(instance.getFlexVolume());
fluent.withFlocker(instance.getFlocker());
fluent.withGcePersistentDisk(instance.getGcePersistentDisk());
fluent.withGitRepo(instance.getGitRepo());
fluent.withGlusterfs(instance.getGlusterfs());
fluent.withHostPath(instance.getHostPath());
fluent.withIscsi(instance.getIscsi());
fluent.withMetadata(instance.getMetadata());
fluent.withName(instance.getName());
fluent.withNfs(instance.getNfs());
fluent.withPersistentVolumeClaim(instance.getPersistentVolumeClaim());
fluent.withRbd(instance.getRbd());
fluent.withSecret(instance.getSecret());
fluent.withVsphereVolume(instance.getVsphereVolume());
this.validationEnabled = validationEnabled;
}
public VolumeBuilder(Volume instance){
代码示例来源:origin: org.domeos/kubernetes-model
public VolumeFluentImpl(Volume instance){
this.withAwsElasticBlockStore(instance.getAwsElasticBlockStore());
this.withAzureFile(instance.getAzureFile());
this.withCephfs(instance.getCephfs());
this.withCinder(instance.getCinder());
this.withConfigMap(instance.getConfigMap());
this.withDownwardAPI(instance.getDownwardAPI());
this.withEmptyDir(instance.getEmptyDir());
this.withFc(instance.getFc());
this.withFlexVolume(instance.getFlexVolume());
this.withFlocker(instance.getFlocker());
this.withGcePersistentDisk(instance.getGcePersistentDisk());
this.withGitRepo(instance.getGitRepo());
this.withGlusterfs(instance.getGlusterfs());
this.withHostPath(instance.getHostPath());
this.withIscsi(instance.getIscsi());
this.withMetadata(instance.getMetadata());
this.withName(instance.getName());
this.withNfs(instance.getNfs());
this.withPersistentVolumeClaim(instance.getPersistentVolumeClaim());
this.withRbd(instance.getRbd());
this.withSecret(instance.getSecret());
this.withVsphereVolume(instance.getVsphereVolume());
}
代码示例来源:origin: org.domeos/kubernetes-model
public VolumeBuilder(Volume instance,Boolean validationEnabled){
this.fluent = this;
this.withAwsElasticBlockStore(instance.getAwsElasticBlockStore());
this.withAzureFile(instance.getAzureFile());
this.withCephfs(instance.getCephfs());
this.withCinder(instance.getCinder());
this.withConfigMap(instance.getConfigMap());
this.withDownwardAPI(instance.getDownwardAPI());
this.withEmptyDir(instance.getEmptyDir());
this.withFc(instance.getFc());
this.withFlexVolume(instance.getFlexVolume());
this.withFlocker(instance.getFlocker());
this.withGcePersistentDisk(instance.getGcePersistentDisk());
this.withGitRepo(instance.getGitRepo());
this.withGlusterfs(instance.getGlusterfs());
this.withHostPath(instance.getHostPath());
this.withIscsi(instance.getIscsi());
this.withMetadata(instance.getMetadata());
this.withName(instance.getName());
this.withNfs(instance.getNfs());
this.withPersistentVolumeClaim(instance.getPersistentVolumeClaim());
this.withRbd(instance.getRbd());
this.withSecret(instance.getSecret());
this.withVsphereVolume(instance.getVsphereVolume());
this.validationEnabled = validationEnabled;
}
内容来源于网络,如有侵权,请联系作者删除!