Skip to content

Commit 007bd47

Browse files
committed
add migration script
1 parent 4da8505 commit 007bd47

File tree

1 file changed

+29
-0
lines changed
  • src/migration-scripts/container

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2024 VyOS maintainers and contributors <[email protected]>
2+
#
3+
# This library is free software; you can redistribute it and/or
4+
# modify it under the terms of the GNU Lesser General Public
5+
# License as published by the Free Software Foundation; either
6+
# version 2.1 of the License, or (at your option) any later version.
7+
#
8+
# This library is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
# Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public License
14+
# along with this library. If not, see <http://www.gnu.org/licenses/>.
15+
16+
# T7473: container: allow log-driver to be set per container
17+
18+
from vyos.configtree import ConfigTree
19+
20+
base = ['container', 'log-driver']
21+
22+
def migrate(config: ConfigTree) -> None:
23+
24+
# Check if containers exist and we need to perform image manipulation
25+
if not config.exists(base):
26+
# Nothing to do
27+
return
28+
else:
29+
config.delete(base)

0 commit comments

Comments
 (0)