Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Ship Cat container manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wizards
Ship Cat container manager
Compare revisions
eff16c69860d765ac5f0303cce504955116893a6 to 35f2b956d2aba3d3a79c27c1f3544cf161488aba
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
wizards/ship-cat
Select target project
No results found
35f2b956d2aba3d3a79c27c1f3544cf161488aba
Select Git revision
Loading items
Swap
Target
wizards/ship-cat
Select target project
wizards/ship-cat
1 result
eff16c69860d765ac5f0303cce504955116893a6
Select Git revision
Loading items
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Add podman_create_options to container config
· 8d0b44e9
Martin Mareš
authored
1 year ago
8d0b44e9
Add "shc update --no-pull"
· 35f2b956
Martin Mareš
authored
1 year ago
35f2b956
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
debian/changelog
+6
-0
6 additions, 0 deletions
debian/changelog
etc/container.toml.example
+3
-0
3 additions, 0 deletions
etc/container.toml.example
shipcat/config.py
+3
-1
3 additions, 1 deletion
shipcat/config.py
shipcat/main.py
+7
-6
7 additions, 6 deletions
shipcat/main.py
with
19 additions
and
7 deletions
debian/changelog
View file @
35f2b956
kam-shipcat (0.9.1) unstable; urgency=medium
* Added podman_create_options and "shc update --no-pull".
-- Martin Mares <mj@ucw.cz> Tue, 18 Jun 2024 10:46:23 +0200
kam-shipcat (0.9) unstable; urgency=medium
* Initial release.
...
...
This diff is collapsed.
Click to expand it.
etc/container.toml.example
View file @
35f2b956
...
...
@@ -12,3 +12,6 @@ allowed_groups = []
# Do we re-create the container on every start?
create_on_start = false
# Extra options passed to "podman create"
podman_create_options = []
This diff is collapsed.
Click to expand it.
shipcat/config.py
View file @
35f2b956
...
...
@@ -6,7 +6,7 @@ from grp import getgrnam
from
pathlib
import
Path
import
re
import
tomllib
from
typing
import
Set
from
typing
import
Set
,
List
from
.json_walker
import
Walker
,
WalkerError
...
...
@@ -58,6 +58,7 @@ class ContainerConfig:
allowed_groups
:
Set
[
int
]
create_on_start
:
bool
global_config
:
GlobalConfig
podman_create_options
:
List
[
str
]
# Automatically generated
pid_file
:
str
...
...
@@ -118,6 +119,7 @@ class ContainerConfig:
self
.
allowed_groups
.
add
(
grp
.
gr_gid
)
self
.
create_on_start
=
w
[
'
create_on_start
'
].
as_bool
(
self
.
global_config
.
default_create_on_start
)
self
.
podman_create_options
=
[
o
.
as_str
()
for
o
in
w
[
'
podman_create_options
'
].
default_to
([]).
array_values
()]
self
.
pid_file
=
f
'
/run/shc/
{
self
.
name
}
.pid
'
self
.
user_name
=
self
.
name
...
...
This diff is collapsed.
Click to expand it.
shipcat/main.py
View file @
35f2b956
...
...
@@ -192,6 +192,7 @@ def service_action(cc: ContainerConfig, action: str) -> None:
def
cmd_update
(
args
:
argparse
.
Namespace
)
->
None
:
cc
=
setup_container
(
args
,
False
)
if
not
args
.
no_pull
:
progress
(
'
Pulling new image
'
)
run_command
(
[
'
podman
'
,
'
pull
'
,
cc
.
image
]
...
...
@@ -226,8 +227,7 @@ def create_container(cc: ContainerConfig) -> None:
'
--ip
'
,
ip
,
'
--subuidname
'
,
cc
.
user_name
,
'
--subgidname
'
,
cc
.
user_name
,
cc
.
image
,
],
]
+
cc
.
podman_create_options
+
[
cc
.
image
]
)
...
...
@@ -441,6 +441,7 @@ def main() -> None:
update_parser
=
subparsers
.
add_parser
(
'
update
'
,
help
=
'
update a container from an image
'
,
description
=
'
Update a container from an image and start it.
'
)
update_parser
.
add_argument
(
'
name
'
,
help
=
'
name of the container
'
)
update_parser
.
add_argument
(
'
--no-pull
'
,
default
=
False
,
action
=
'
store_true
'
,
help
=
'
do not pull a new image
'
)
args
=
parser
.
parse_args
()
get_caller_credentials
()
...
...
This diff is collapsed.
Click to expand it.