Skip to content

Commit

Permalink
Add shared PVC support for vine desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Jun 1, 2023
1 parent 35d6b1d commit 1602fdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions vine/session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ark-core = { path = "../../ark/core" }
dash-provider = { path = "../../dash/provider" }
dash-provider-api = { path = "../../dash/provider/api" }
vine-api = { path = "../api" }
vine-storage = { path = "../storage" }

anyhow = { workspace = true }
chrono = { workspace = true }
Expand Down
7 changes: 7 additions & 0 deletions vine/session/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ impl SessionManager {
.and_then(|()| self.label_namespace(&ctx, Some(ctx.spec.user_name)))
.and_then(|()| self.label_user(ctx.spec.node, ctx.spec.user_name, true))
.and_then(|()| self.delete_cleanup(&ctx))
.and_then(|()| self.create_shared_pvc(&ctx))
.and_then(|()| self.create_template(&ctx))
.await
}
Expand Down Expand Up @@ -141,6 +142,12 @@ impl SessionManager {
.map(|_| ())
}

async fn create_shared_pvc(&self, ctx: &SessionContext<'_>) -> Result<()> {
::vine_storage::get_or_create_shared_pvcs(&self.client.kube, &ctx.metadata.namespace)
.await
.map(|_| ())
}

async fn create_template(&self, ctx: &SessionContext<'_>) -> Result<()> {
self.client
.create_raw_named(Self::TEMPLATE_SESSION_FILENAME, ctx)
Expand Down

0 comments on commit 1602fdc

Please sign in to comment.