Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Only create PVC when a matching volume is found #530

Merged
merged 1 commit into from
Aug 8, 2020

Conversation

ryanzhang-oss
Copy link
Contributor

@msftclas
Copy link

msftclas commented Jan 31, 2020

CLA assistant check
All CLA requirements met.

@hongchaodeng
Copy link
Member

What's the reason for this change?
Isn't PVC created using StorageClass?

@zhxu2
Copy link
Contributor

zhxu2 commented Jan 31, 2020

the change tries to find a matched volume before calls creation on a PVC parsed out of an app cfg, to avoid unused objects being created behind the scene

fn find_volume(&self) -> Option<&Volume> {
self.component.containers.iter().find_map(|c| {
c.resources.volumes.as_ref().and_then(|vols| {
vols.iter()
.filter(|v| !v.disk.as_ref().unwrap().ephemeral)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean if we create a new PV, it's not ephemeral?

Copy link
Contributor Author

@ryanzhang-oss ryanzhang-oss Feb 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the plan, so we won't create a PVC for a ephemeral volume. Does it make sense.

Copy link
Member

@wonderflow wonderflow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@resouer resouer merged commit 5c40ae8 into oam-dev:master Aug 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants