blob: 57b45074ed5f6abb2ccbc75edbee66f4391dbdf2 [file] [log] [blame]
garciadeblas83775ba2025-07-23 18:35:24 +02001#######################################################################################
2# Copyright ETSI Contributors and Others.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#######################################################################################
17
18# Meta-module of helper functions to manage, transform and generate specifications of Kubernetes resources.
19# This meta-module comprises all the modules of the OSM's SDK for App Modelling.
20
21
22# Import submodules
23export module ./keypair.nu
24export module ./concatenate.nu
25export module ./convert.nu
26export module ./generator.nu
27export module ./patch.nu
28export module ./jsonpatch.nu
29export module ./strategicmergepatch.nu
30export module ./overlaypatch.nu
31
32
33# Convert input string to a safe name for Kubernetes resources
34export def "safe resource name" [input: string]: [
35 nothing -> string
36] {
37 $input
38 | str downcase
39 | str replace -a './' ''
40 | str replace -a '.' '-'
41 | str replace -a '/' '-'
42 | str replace -a '_' '-'
43 | str replace -a ' ' '-'
44 | str replace -a ':' '-'
45}
46
47export alias safe_name = safe resource name