From ff8df16778818804d31b844b0df7b2f9a16f2cba Mon Sep 17 00:00:00 2001 From: Lukasz Rajewski Date: Fri, 4 Sep 2020 18:16:45 +0200 Subject: Add k8s-upload-profile templating and packaging Issue-ID: CCSDK-2631 Signed-off-by: Lukasz Rajewski Change-Id: Id520338ffc2f43821d114b037467fbcc2f042b66 --- .../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') 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 8290167cd..a0ef565cc 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 @@ -228,6 +228,7 @@ object BluePrintConstants { const val MODEL_TYPE_ARTIFACT_SCRIPT_KOTLIN = "artifact-script-kotlin" 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 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 3c5561994..64553230a 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 @@ -311,6 +311,22 @@ fun BluePrintTypes.artifactTypeScriptKotlin(): ArtifactType { } } +fun ServiceTemplateBuilder.artifactTypeK8sProfileFolder() { + val artifactType = BluePrintTypes.artifactTypeK8sProfileFolder() + if (this.artifactTypes == null) this.artifactTypes = hashMapOf() + this.artifactTypes!![artifactType.id!!] = artifactType +} + +fun BluePrintTypes.artifactTypeK8sProfileFolder(): ArtifactType { + return artifactType( + id = BluePrintConstants.MODEL_TYPE_ARTIFACT_K8S_PROFILE, + version = BluePrintConstants.DEFAULT_VERSION_NUMBER, + derivedFrom = BluePrintConstants.MODEL_TYPE_ARTIFACT_TYPE_IMPLEMENTATION, + description = "K8s Profile 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 bf16ea93a..824d7ddec 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 @@ -110,6 +110,7 @@ class BluePrintDSLTest { artifactTypeScriptKotlin() artifactTypeMappingResource() artifactTypeComponentJar() + artifactTypeK8sProfileFolder() relationshipTypeConnectsTo() relationshipTypeDependsOn() -- cgit 1.2.3-korg