Skip to content

Commit

Permalink
hook fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Viktor Kramarenko <[email protected]>
  • Loading branch information
ViktorKram committed Aug 30, 2024
1 parent 70a88b3 commit c7e1147
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion hooks/convert_block_device_names_to_selector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#!/usr/bin/env python3
#
# Copyright 2024 Flant JSC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, List

from deckhouse import hook
Expand All @@ -6,14 +22,19 @@

config = """
configVersion: v1
afterHelm: 10
onStartup: 5
"""

group = "storage.deckhouse.io"
plural = "lvmvolumegroups"
version = "v1alpha1"


# This webhook ensures the migration of LVMVolumeGroup resources from the old CRD version to the new one:
# - Removes field spec.blockDeviceNames
# - Adds spec.Local field and fills its value 'nodeName' with the resource's node.
# - Adds spec.blockDeviceSelector field and fills it with the LVMVolumeGroup nodeName and blockDeviceNames

def main(ctx: hook.Context):
kubernetes.config.load_incluster_config()

Expand Down

0 comments on commit c7e1147

Please sign in to comment.