appId:在Marathon中创建应用程序时出现error.pattern

问题描述

我正在尝试使用Web控制台在Marathon中创建一个应用程序。这是JSON文件

{
    "id": "TestSpringApplication","cmd": "/usr/bin/java -jar -Dspring.profiles.active=test /spring-boot-rest-example-0.5.0.war","cpus": 1,"mem": 32.0,"networks": [ { "mode": "container/bridge" } ],"container": {
      "type": "DOCKER","docker": {
        "image": "openjdk:8-jre-alpine"
      },"portMappings": [
        { "containerPort": 8090,"hostPort": 8090 },{"containerPort": 8091,"hostPort": 8091 }],"volumes" : [
          {
          "containerPath": "/","mode": "RW","hostPath": "/root/spring-boot-rest-example/target"
          }
        ]
    }
}

但是当我把它放在盒子里时,出现了这个错误

您的配置有问题

appId:error.pattern

有人遇到这个问题吗?我搜索了太多文档,但没有发现任何有用的信息

解决方法

AppID(又名 PathID 必须满足特定条件

pod 的唯一标识符,由一系列以斜线分隔的名称组成。 每个名称必须至少为 1 个字符,并且只能包含数字 (0-9)、破折号 (-)、点 (.) 和小写字母 (a-z)。名字不能开头

并匹配

^(\/?((\.\.)|(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9]))?($|\/))+$

https://github.com/mesosphere/marathon/blob/7523b83799cd4ac0d3ce7ce0392edf77fd84e418/docs/docs/rest-api/public/api/v2/types/stringTypes.raml#L23-L31