Skip to content

Commit 253c51d

Browse files
committed
tidy up
1 parent 65160e3 commit 253c51d

File tree

6 files changed

+3
-45
lines changed

6 files changed

+3
-45
lines changed

src/api/crypt.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ use std::str::FromStr;
66

77
impl SystemConfig {
88
pub fn age_identity(&self) -> Result<Identity, AnyError> {
9-
Ok(age::x25519::Identity::from_str(
10-
self.age_key.as_deref().unwrap(),
11-
)?)
9+
Ok(Identity::from_str(self.age_key.as_deref().unwrap())?)
1210
}
1311
}
1412

src/api/workspace/enter.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ impl<'a> WorkspaceApi<'a> {
8787
}
8888
};
8989

90-
//TODO: v2 chown is disabled for sidecars
91-
// symlinking might be happening in wrapped entrypoints so maybe chowning could to
92-
// Chowing as exec to work in non-root containers
9390
if !root && container_name == constants::DEFAULT_CONTAINER_NAME {
9491
self.api.exec.ensure_user(container_id).await?;
9592

src/config/config.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@ impl FileFormat {
9999
}
100100
}
101101

102-
#[derive(Debug, Serialize, Deserialize, Clone)]
103-
#[serde(untagged)]
104-
pub enum SidecarMount {
105-
Empty(String),
106-
Files {
107-
mount: String,
108-
files: HashMap<String, String>,
109-
},
110-
}
111102
#[derive(Debug, Serialize, Deserialize, Clone)]
112103
#[serde(deny_unknown_fields)]
113104
pub struct RoozSidecar {
@@ -121,8 +112,6 @@ pub struct RoozSidecar {
121112
#[serde(skip_serializing_if = "Option::is_none")]
122113
pub mounts: Option<LinkedHashMap<String, MountSource>>,
123114
#[serde(skip_serializing_if = "Option::is_none")]
124-
pub legacy_mounts: Option<Vec<SidecarMount>>,
125-
#[serde(skip_serializing_if = "Option::is_none")]
126115
pub ports: Option<Vec<String>>,
127116
#[serde(skip_serializing_if = "Option::is_none")]
128117
pub privileged: Option<bool>,

src/config/runtime.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::config::{DataValue, MountSource, RoozCfg, RoozSidecar, SidecarMount};
1+
use super::config::{DataValue, MountSource, RoozCfg, RoozSidecar};
22
use crate::AnyError;
33
use crate::constants;
44
use crate::model::types::{TargetDir, VolumeFilesSpec};
@@ -14,7 +14,6 @@ pub struct RoozSidecarRuntime {
1414
pub args: Vec<String>,
1515
pub mounts: HashMap<String, MountSource>,
1616
pub real_mounts: HashMap<TargetDir, VolumeFilesSpec>,
17-
pub legacy_mounts: Vec<SidecarMount>,
1817
pub ports: Vec<String>,
1918
pub privileged: bool,
2019
pub init: bool,
@@ -42,7 +41,6 @@ impl<'a> From<&'a RoozSidecar> for RoozSidecarRuntime {
4241
.iter()
4342
.map(|(k, v)| (k.to_string(), v.clone()))
4443
.collect(),
45-
legacy_mounts: value.legacy_mounts.clone().unwrap_or_default(),
4644
real_mounts: HashMap::new(),
4745
ports: value.ports.clone().unwrap_or_default(),
4846
privileged: value.privileged.clone().unwrap_or_default(),

src/model/volume.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ pub enum RoozVolumeSharing {
2121

2222
#[derive(Debug, Clone)]
2323
pub enum RoozVolumeRole {
24-
//TODO: remove in v2
25-
//Home,
2624
Work,
2725
Cache,
2826
Data,
@@ -34,8 +32,6 @@ pub enum RoozVolumeRole {
3432
impl RoozVolumeRole {
3533
pub fn as_str(&self) -> &str {
3634
match self {
37-
//TODO: remove in v2
38-
//RoozVolumeRole::Home => HOME_ROLE,
3935
RoozVolumeRole::Work => WORK_ROLE,
4036
RoozVolumeRole::Cache => CACHE_ROLE,
4137
RoozVolumeRole::Data => DATA_ROLE,
@@ -123,20 +119,6 @@ impl RoozVolume {
123119
}
124120
}
125121

126-
//TODO: remove once v2 is up
127-
// pub fn home(key: &str, path: &str) -> RoozVolume {
128-
// RoozVolume {
129-
// path: path.into(),
130-
// sharing: RoozVolumeSharing::Exclusive { key: key.into() },
131-
// role: RoozVolumeRole::Home,
132-
// files: None,
133-
// labels: Some(Labels::from(&[
134-
// Labels::workspace(key),
135-
// Labels::role(RoozVolumeRole::Home.as_str()),
136-
// ])),
137-
// }
138-
// }
139-
140122
pub fn cache(path: &str) -> RoozVolume {
141123
RoozVolume {
142124
path: path.into(),
@@ -185,7 +167,7 @@ impl RoozVolume {
185167
},
186168
None => RoozVolume {
187169
path: path.into(),
188-
role: role,
170+
role,
189171
sharing: RoozVolumeSharing::Exclusive {
190172
key: workspace_key.into(),
191173
},

src/util/labels.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ const ROOZ: &'static str = "dev.rooz";
1111
pub const LABEL_KEY: &'static str = "label";
1212
const TRUE: &'static str = "true";
1313

14-
//TODO: remove in v2
15-
//pub const HOME_ROLE: &'static str = "home";
1614
pub const WORK_ROLE: &'static str = "work";
1715
pub const DATA_ROLE: &'static str = "data";
1816
pub const SSH_KEY_ROLE: &'static str = "ssh-key";
@@ -21,10 +19,6 @@ pub const SYSTEM_CONFIG_ROLE: &'static str = "sys-config";
2119
pub const CACHE_ROLE: &'static str = "cache";
2220
pub const SIDECAR_ROLE: &'static str = "sidecar";
2321

24-
// -- volume v2 roles
25-
26-
//
27-
2822
#[derive(Clone, Debug)]
2923
pub struct KeyValue {
3024
formatted: String,

0 commit comments

Comments
 (0)