mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-19 10:23:42 -05:00
Compare commits
5 Commits
v3.4.0
...
a1d53bb56b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1d53bb56b | ||
|
|
de1d662936 | ||
|
|
b542f1bac5 | ||
|
|
34ae9cb36f | ||
|
|
e015afbaca |
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -376,7 +376,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cup"
|
||||
version = "3.3.0"
|
||||
version = "3.4.1"
|
||||
dependencies = [
|
||||
"bollard",
|
||||
"chrono",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cup"
|
||||
version = "3.4.0"
|
||||
version = "3.4.1"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -20,7 +20,7 @@ Sometimes, there may be a need to specify a custom docker socket. Cup provides t
|
||||
For example, if using Podman, you might do
|
||||
|
||||
```bash
|
||||
$ cup -s /run/user/1000/podman/podman.sock check
|
||||
$ cup -s unix:///run/user/1000/podman/podman.sock check
|
||||
```
|
||||
|
||||
This option is also available in the configuration file and it's best to put it there.
|
||||
|
||||
@@ -4,7 +4,7 @@ If you need to specify a custom Docker socket (e.g. because you're using Podman)
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"socket": "/run/user/1000/podman/podman.sock"
|
||||
"socket": "unix:///run/user/1000/podman/podman.sock"
|
||||
// Other options
|
||||
}
|
||||
```
|
||||
@@ -16,4 +16,4 @@ You can also specify a TCP socket if you're using a remote Docker host or a [pro
|
||||
"socket": "tcp://localhost:2375"
|
||||
// Other options
|
||||
}
|
||||
```
|
||||
```
|
||||
@@ -1,5 +1,6 @@
|
||||
use rustc_hash::FxHashMap;
|
||||
use serde::Deserialize;
|
||||
use serde::Deserializer;
|
||||
use std::env;
|
||||
use std::mem;
|
||||
use std::path::PathBuf;
|
||||
@@ -64,6 +65,7 @@ pub struct Config {
|
||||
pub agent: bool,
|
||||
pub ignore_update_type: UpdateType,
|
||||
pub images: ImageConfig,
|
||||
#[serde(deserialize_with = "empty_as_none")]
|
||||
pub refresh_interval: Option<String>,
|
||||
pub registries: FxHashMap<String, RegistryConfig>,
|
||||
pub servers: FxHashMap<String, String>,
|
||||
@@ -151,3 +153,15 @@ impl Default for Config {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
fn empty_as_none<'de, D>(deserializer: D) -> Result<Option<String>, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
let s = String::deserialize(deserializer)?;
|
||||
if s.is_empty() {
|
||||
Ok(None)
|
||||
} else {
|
||||
Ok(Some(s))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user