diff --git a/library/common-test/tests/externalInterface/validation_test.yaml b/library/common-test/tests/externalInterface/validation_test.yaml index 0ebaaae1..fc522215 100644 --- a/library/common-test/tests/externalInterface/validation_test.yaml +++ b/library/common-test/tests/externalInterface/validation_test.yaml @@ -55,11 +55,11 @@ tests: - hostInterface: enp0s3 ipam: type: dhcp - staticIPConfigurations: - - ipAddress: 1.2.3.4 + staticIPConfigurations: + - ipAddress: 1.2.3.4 asserts: - failedTemplate: - errorMessage: External Interface - Expected empty and when is not [static] + errorMessage: External Interface - Expected empty and when is not [static] - it: should fail with non-empty staticRoutes on dhcp set: @@ -67,12 +67,12 @@ tests: - hostInterface: enp0s3 ipam: type: dhcp - staticRoutes: - - gateway: 1.2.3.4 - destination: 1.2.3.4 + staticRoutes: + - gateway: 1.2.3.4 + destination: 1.2.3.4 asserts: - failedTemplate: - errorMessage: External Interface - Expected empty and when is not [static] + errorMessage: External Interface - Expected empty and when is not [static] - it: should fail with empty staticIPConfigurations on static set: @@ -80,10 +80,10 @@ tests: - hostInterface: enp0s3 ipam: type: static - staticIPConfigurations: [] + staticIPConfigurations: [] asserts: - failedTemplate: - errorMessage: External Interface - Expected non-empty when is [static] + errorMessage: External Interface - Expected non-empty when is [static] - it: should fail with empty gateway on staticRoutes on static set: @@ -91,14 +91,14 @@ tests: - hostInterface: enp0s3 ipam: type: static - staticIPConfigurations: - - ipAddress: 1.2.3.4 - staticRoutes: - - gateway: "" - destination: 1.2.3.4 + staticIPConfigurations: + - ipAddress: 1.2.3.4 + staticRoutes: + - gateway: "" + destination: 1.2.3.4 asserts: - failedTemplate: - errorMessage: External Interface - Expected non-empty in + errorMessage: External Interface - Expected non-empty in - it: should fail with empty destination on staticRoutes on static set: @@ -106,14 +106,14 @@ tests: - hostInterface: enp0s3 ipam: type: static - staticIPConfigurations: - - ipAddress: 1.2.3.4 - staticRoutes: - - gateway: 1.2.3.4 - destination: "" + staticIPConfigurations: + - ipAddress: 1.2.3.4 + staticRoutes: + - gateway: 1.2.3.4 + destination: "" asserts: - failedTemplate: - errorMessage: External Interface - Expected non-empty in + errorMessage: External Interface - Expected non-empty in - it: should fail with empty ixExternalInterfaceConfigurationNames when interface is defined set: diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index 71711f17..921a661b 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 12.4.15 +version: 12.4.16 diff --git a/library/common/templates/lib/externalInterface/_validation.tpl b/library/common/templates/lib/externalInterface/_validation.tpl index dfdeec5d..c1eb478f 100644 --- a/library/common/templates/lib/externalInterface/_validation.tpl +++ b/library/common/templates/lib/externalInterface/_validation.tpl @@ -28,23 +28,23 @@ objectData: The object data to validate that contains the external interface con {{- fail (printf "External Interface - Expected to be one of [%s], but got [%s]" (join ", " $types) $objectData.ipam.type) -}} {{- end -}} - {{- if and (or $objectData.staticIPConfigurations $objectData.staticRoutes) (ne $objectData.ipam.type "static") -}} - {{- fail "External Interface - Expected empty and when is not [static]" -}} + {{- if and (or $objectData.ipam.staticIPConfigurations $objectData.ipam.staticRoutes) (ne $objectData.ipam.type "static") -}} + {{- fail "External Interface - Expected empty and when is not [static]" -}} {{- end -}} {{- if eq $objectData.ipam.type "static" -}} - {{- if not $objectData.staticIPConfigurations -}} - {{- fail "External Interface - Expected non-empty when is [static]" -}} + {{- if not $objectData.ipam.staticIPConfigurations -}} + {{- fail "External Interface - Expected non-empty when is [static]" -}} {{- end -}} - {{- with $objectData.staticRoutes -}} + {{- with $objectData.ipam.staticRoutes -}} {{- range . -}} {{- if not .destination -}} - {{- fail "External Interface - Expected non-empty in " -}} + {{- fail "External Interface - Expected non-empty in " -}} {{- end -}} {{- if not .gateway -}} - {{- fail "External Interface - Expected non-empty in " -}} + {{- fail "External Interface - Expected non-empty in " -}} {{- end -}} {{- end -}} {{- end -}}