From 1e294a59489bf5900135f67cd87dab5d6a67fada Mon Sep 17 00:00:00 2001 From: Lukasz Rajewski Date: Mon, 22 Mar 2021 22:43:23 +0100 Subject: Bug fixes for config template and config value components Issue-ID: CCSDK-3232 Signed-off-by: Lukasz Rajewski Change-Id: I817d83001a76ba480472c7aa2da15eba65b39c20 (cherry picked from commit 91c1deec281ece8aa72b2afd9cc68b2d63c38189) --- .../cds/controllerblueprints/core/BlueprintConstants.kt | 1 + .../cds/controllerblueprints/core/dsl/BlueprintDSL.kt | 16 ++++++++++++++++ .../controllerblueprints/core/dsl/BlueprintDSLTest.kt | 1 + 3 files changed, 18 insertions(+) (limited to 'ms/blueprintsprocessor/modules/blueprints/blueprint-core/src') diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BlueprintConstants.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BlueprintConstants.kt index cfe436023..256339c62 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BlueprintConstants.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BlueprintConstants.kt @@ -232,6 +232,7 @@ object BlueprintConstants { const val MODEL_TYPE_ARTIFACT_DIRECTED_GRAPH = "artifact-directed-graph" const val MODEL_TYPE_ARTIFACT_COMPONENT_JAR = "artifact-component-jar" const val MODEL_TYPE_ARTIFACT_K8S_PROFILE = "artifact-k8sprofile-content" + const val MODEL_TYPE_ARTIFACT_K8S_CONFIG = "artifact-k8sconfig-content" const val TOSCA_SPEC = "TOSCA" diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSL.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSL.kt index 503e07048..81593c935 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSL.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSL.kt @@ -327,6 +327,22 @@ fun BlueprintTypes.artifactTypeK8sProfileFolder(): ArtifactType { } } +fun ServiceTemplateBuilder.artifactTypeK8sConfigFolder() { + val artifactType = BlueprintTypes.artifactTypeK8sConfigFolder() + if (this.artifactTypes == null) this.artifactTypes = hashMapOf() + this.artifactTypes!![artifactType.id!!] = artifactType +} + +fun BlueprintTypes.artifactTypeK8sConfigFolder(): ArtifactType { + return artifactType( + id = BlueprintConstants.MODEL_TYPE_ARTIFACT_K8S_CONFIG, + version = BlueprintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BlueprintConstants.MODEL_TYPE_ARTIFACT_TYPE_IMPLEMENTATION, + description = "K8s Config Folder Artifact" + ) { + } +} + @Deprecated("CDS won't support, use implerative workflow definitions.") fun BlueprintTypes.artifactTypeDirectedGraph(): ArtifactType { return artifactType( diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSLTest.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSLTest.kt index 5143c9dc7..57f671dc4 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSLTest.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/dsl/BlueprintDSLTest.kt @@ -111,6 +111,7 @@ class BlueprintDSLTest { artifactTypeMappingResource() artifactTypeComponentJar() artifactTypeK8sProfileFolder() + artifactTypeK8sConfigFolder() relationshipTypeConnectsTo() relationshipTypeDependsOn() -- cgit 1.2.3-korg