diff --git a/pom.xml b/pom.xml index c3009b84f..d4535c1df 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ io.gaia_app gaia - 2.4.0 + 2.4.1 jar gaia diff --git a/src/main/client/app/pages/modules/terraform-image-input.vue b/src/main/client/app/pages/modules/terraform-image-input.vue index 14dad4d46..27745f473 100644 --- a/src/main/client/app/pages/modules/terraform-image-input.vue +++ b/src/main/client/app/pages/modules/terraform-image-input.vue @@ -79,7 +79,7 @@ return !!this.image.repository; }, isRepositoryValid() { - return /^[\w][\w.\-/]{0,127}$/.test(this.image.repository); + return /^[\w][\w.\-/:]{0,127}$/.test(this.image.repository); }, isTagNotEmpty() { return !!this.image.tag && /^\S*$/.test(this.image.tag); @@ -112,7 +112,7 @@ formatRepository(value) { if (!value) return ''; if (!value.includes(':')) return value; - [this.image.repository, this.image.tag] = value.split(':'); + [this.image.host, this.image.repository, this.image.tag] = /(\S*):(\S*)/.exec(value); document.getElementById('image_tag').focus(); return this.image.repository; }, diff --git a/src/main/java/io/gaia_app/modules/bo/TerraformImage.kt b/src/main/java/io/gaia_app/modules/bo/TerraformImage.kt index 311b964b0..25faa4666 100644 --- a/src/main/java/io/gaia_app/modules/bo/TerraformImage.kt +++ b/src/main/java/io/gaia_app/modules/bo/TerraformImage.kt @@ -4,7 +4,7 @@ import javax.validation.constraints.NotBlank import javax.validation.constraints.Pattern data class TerraformImage( - @field:NotBlank @field:Pattern(regexp = """^[\w][\w.\-\/]{0,127}$""") val repository: String, + @field:NotBlank @field:Pattern(regexp = """^[\w][\w.\-\/:]{0,127}$""") val repository: String, @field:NotBlank val tag: String) { fun image() = "$repository:$tag" diff --git a/src/main/resources/mustache/terraform.mustache b/src/main/resources/mustache/terraform.mustache index d2d9313da..c4e210c3d 100644 --- a/src/main/resources/mustache/terraform.mustache +++ b/src/main/resources/mustache/terraform.mustache @@ -2,8 +2,14 @@ set -e echo '[gaia] using image {{terraformImage}}' -echo '[gaia] installing curl' -apk -q add curl +curl --version +if $? > 0 +then + echo '[gaia] installing curl' + apk -q add curl +else + echo '[gaia] curl already installed' +fi echo '[gaia] cloning {{gitRepositoryUrl}}' | awk '{ sub(/oauth2:(.*)@/, "oauth2:[MASKED]@");}1' git clone {{gitRepositoryUrl}} module