Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

image regex doesn't match @sha256:<hash> #909

Closed
errordeveloper opened this issue Jan 23, 2018 · 1 comment
Closed

image regex doesn't match @sha256:<hash> #909

errordeveloper opened this issue Jan 23, 2018 · 1 comment

Comments

@errordeveloper
Copy link
Contributor

I've noticed this when I used a deployment with image pinned to a SHA256 digest:

ts=2018-01-23T10:57:22.426492054Z caller=warming.go:154 component=warmer err="requesting tags: mux: variable \"errordeveloper/k9c@sha256\" doesn't match, expected \"^(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\\\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?/)?[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?$\""

Here is the manifest I'm using:

apiVersion: v1
kind: List
items:
  - apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: "ide"
      namespace: "k9c"
      labels:
        name: "ide"
  - apiVersion: rbac.authorization.k8s.io/v1beta1
    kind: ClusterRole
    metadata:
      name: "ide"
      labels:
        name: "ide"
    rules:
      - apiGroups: [ '*' ]
        resources: [ '*' ]
        verbs: [ '*' ]
      - nonResourceURLs: [ '*' ]
        verbs: [ '*' ]
  - apiVersion: rbac.authorization.k8s.io/v1beta1
    kind: ClusterRoleBinding
    metadata:
      name: "ide"
      namespace: "k9c"
      labels:
        name: "ide"
    roleRef:
      kind: ClusterRole
      name: cluster-admin
      apiGroup: rbac.authorization.k8s.io
    subjects:
      - kind: ServiceAccount
        name: "ide"
        namespace: "k9c"
  - apiVersion: v1
    kind: Service
    metadata:
      name: "ide"
      namespace: "k9c"
      labels:
        name: "ide"
    spec:
      type: LoadBalancer
      selector:
        name: "ide"
      ports:
      - name: http
        port: 80
        targetPort: 8080
  - apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: workspace
      namespace: k9c
    spec:
      accessModes: [ReadWriteOnce]
      resources:
        requests:
          storage: 2Gi
  - apiVersion: apps/v1beta1
    kind: Deployment
    metadata:
      name: "ide"
      namespace: "k9c"
      labels:
        name: "ide"
    spec:
      template:
        metadata:
          labels:
            name: "ide"
        spec:
          serviceAccount: "ide"
          restartPolicy: Always
          initContainers:
            - name: "git-clone"
              image: "errordeveloper/k9c@sha256:70bdb06a86213fb4af28f460219ad81ec71849a64ea4cfa11a10d572a9c222bb"
              command: [ "/bin/sh", "-c", "test -d /workspace/app || git clone https://github.com/bricef/metrics-demo" ]
              volumeMounts:
                - name: workspace
                  mountPath: /workspace
          containers:
            - name: "ide"
              image: "errordeveloper/k9c@sha256:70bdb06a86213fb4af28f460219ad81ec71849a64ea4cfa11a10d572a9c222bb"
              imagePullPolicy: IfNotPresent
              ports:
                - name: http
                  containerPort: 8080
              volumeMounts:
                - name: workspace
                  mountPath: /workspace
          volumes:
            - name: workspace
              persistentVolumeClaim:
                claimName: workspace

I've not checked it into config repo, it just happens to be in my cluster, so the fact that it's List should be irrelevant.

@squaremo
Copy link
Member

@errordeveloper Is this the same as #885?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants