Jordi
Jordi

Reputation: 23257

fabric8 resource invalid name

A'm running mvn fabric8:resource and I'm getting this output:

...
[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
...

I don't quite figure out what's wrong. The content of tdev-wsec-service-deploymentconfig.yml is:

---
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

Upvotes: 1

Views: 202

Answers (1)

Peuper
Peuper

Reputation: 26

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

^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ -> character '_' is not allowed

This is not a fabric limitation, i tried running a similar pod def using kubectl and i got the same message.

Upvotes: 1

Related Questions