fabric8资源无效名称

时间:2018-06-21 08:58:53

标签: maven fabric8

A正在运行mvn fabric8:resource,并且得到以下输出:

...
[INFO] F8: validating /home/jcabre/projects/tdevhub/application-src/t-devhub/tdev-wsec-service/target/classes/META-INF/fabric8/openshift/tdev-wsec-service-deploymentconfig.yml resource
[WARNING] F8: Invalid Resource : /home/jcabre/projects/tdevhub/application-src/t-devhub/tdev-wsec-service/target/classes/META-INF/fabric8/openshift/tdev-wsec-service-deploymentconfig.yml
[message=.spec.template.spec.containers[0].name: does not match the regex pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$, violation type=pattern]
[INFO] F8: validating /home/jcabre/projects/tdevhub/application-src/t-devhub/tdev-wsec-service/target/classes/META-INF/fabric8/kubernetes/tdev-wsec-service-deployment.yml resource
[WARNING] F8: Invalid Resource : /home/jcabre/projects/tdevhub/application-src/t-devhub/tdev-wsec-service/target/classes/META-INF/fabric8/kubernetes/tdev-wsec-service-deployment.yml
...

我不太清楚怎么了。 tdev-wsec-service-deploymentconfig.yml的内容是:

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    fabric8.io/git-commit: 4bb3b53369213a4b4d9940d49aa47c9df4a2f611
    fabric8.io/iconUrl: img/icons/spring-boot.svg
    fabric8.io/git-branch: master
    fabric8.io/metrics-path: dashboard/file/kubernetes-pods.json/?var-project=tdev-wsec-service&var-version=0.0.1-SNAPSHOT
    fabric8.io/scm-tag: HEAD
    fabric8.io/scm-url: https://github.com/spring-projects/spring-boot/spring-boot-starter-parent/t-devhub/tdev-wsec-service
  labels:
    app: tdev-wsec-service
    provider: fabric8
    version: 0.0.1-SNAPSHOT
    group: com.raw.io
  name: tdev-wsec-service
spec:
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: tdev-wsec-service
      provider: fabric8
      group: com.raw.io
  template:
    metadata:
      annotations:
        fabric8.io/git-commit: 4bb3b53369213a4b4d9940d49aa47c9df4a2f611
        fabric8.io/metrics-path: dashboard/file/kubernetes-pods.json/?var-project=tdev-wsec-service&var-version=0.0.1-SNAPSHOT
        fabric8.io/scm-url: https://github.com/spring-projects/spring-boot/spring-boot-starter-parent/t-devhub/tdev-wsec-service
        fabric8.io/iconUrl: img/icons/spring-boot.svg
        fabric8.io/git-branch: master
        fabric8.io/scm-tag: HEAD
      labels:
        app: tdev-wsec-service
        provider: fabric8
        version: 0.0.1-SNAPSHOT
        group: com.raw.io
    spec:
      containers:
      - env:
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        image: wsec:0.0.1-SNAPSHOT
        imagePullPolicy: IfNotPresent
        name: com.raw.io-tdev-wsec-service
        securityContext:
          privileged: false

1 个答案:

答案 0 :(得分:1)

message=.spec.template.spec.containers[0].name-> KUBERNETES_NAMESPACE

^[a-z0-9]([-a-z0-9]*[a-z0-9])?$->不允许字符'_'

这不是结构限制,我尝试使用kubectl运行类似的pod def,但得到的消息相同。