blackducksoftware / perceivers

Kubernetes and openshift image discovery for OpsSight
Apache License 2.0
4 stars 7 forks source link

Image/Pod perceiver: invalid label value error #37

Closed jlin963 closed 6 years ago

jlin963 commented 6 years ago

image-perceiver-logs.txt

time="2018-03-22T17:14:43Z" level=error msg="unable to update annotations/labels for image centos/php-70-centos7@sha256:cdaba352981df86e204ba47129aa64433c888757dde5eea36057996f25e67f26: Image "sha256:cdaba352981df86e204ba47129aa64433c888757dde5eea36057996f25e67f26" is invalid: [metadata.labels: Invalid value: "https://hub-piv01.blackducksoftware.com/api/projects/2b93ac51-3425-486b-8270-a4aa7765a2c8/versions/5ce993fe-e7da-4285-a743-b8ad96ff5ac0/components": must be no more than 63 characters, metadata.labels: Invalid value: "https://hub-piv01.blackducksoftware.com/api/projects/2b93ac51-3425-486b-8270-a4aa7765a2c8/versions/5ce993fe-e7da-4285-a743-b8ad96ff5ac0/components": a valid label must be an empty string or consist of alphanumeric characters, '-', '' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9.]*)?[A-Za-z0-9])?')]"

pod-perceiver-logs.txt

time="2018-03-22T17:15:16Z" level=error msg="unable to update annotations/labels for pod bds-perceptor:protoform: Pod "protoform" is invalid: [metadata.annotations: Invalid value: "image0.": name part must consist of alphanumeric characters, '-', '' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9.])?[A-Za-z0-9]'), spec: Forbidden: pod updates may not change fields other than spec.containers[].image, spec.initContainers[].image, spec.activeDeadlineSeconds or spec.tolerations (only additions to existing tolerations)\n{"Volumes":[{"Name":"viper-input","HostPath":null,"EmptyDir":null,"GCEPersistentDisk":null,"AWSElasticBlockStore":null,"GitRepo":null,"Secret":null,"NFS":null,"ISCSI":null,"Glusterfs":null,"PersistentVolumeClaim":null,"RBD":null,"Quobyte":null,"FlexVolume":null,"Cinder":null,"CephFS":null,"Flocker":null,"DownwardAPI":null,"FC":null,"AzureFile":null,"ConfigMap":{"Name":"viper-input","Items":null,"DefaultMode":420,"Optional":null},"VsphereVolume":null,"AzureDisk":null,"PhotonPersistentDisk":null,"Projected":null,"PortworxVolume":null,"ScaleIO":null,"StorageOS":null},{"Name":"protoform-token-bhg5c","HostPath":null,"EmptyDir":null,"GCEPersistentDisk":null,"AWSElasticBlockStore":null,"GitRepo":null,"Secret":{"SecretName":"protoform-token-bhg5c","Items":null,"DefaultMode":420,"Optional":null},"NFS":null,"ISCSI":null,"Glusterfs":null,"PersistentVolumeClaim":null,"RBD":null,"Quobyte":null,"FlexVolume":null,"Cinder":null,"CephFS":null,"Flocker":null,"DownwardAPI":null,"FC":null,"AzureFile":null,"ConfigMap":null,"VsphereVolume":null,"AzureDisk":null,"PhotonPersistentDisk":null,"Projected":null,"PortworxVolume":null,"ScaleIO":null,"StorageOS":null}],"InitContainers":null,"Containers":[{"Name":"protoform","Image":"gcr.io/gke-verification/blackducksoftware/perceptor-protoform:master","Command":["./protoform"],"Args":null,"WorkingDir":"","Ports":[{"Name":"","HostPort":0,"ContainerPort":3001,"Protocol":"TCP","HostIP":""}],"EnvFrom":null,"Env":null,"Resources":{"Limits":null,"Requests":null},"VolumeMounts":[{"Name":"viper-input","ReadOnly":false,"MountPath":"/etc/protoform/","SubPath":""},{"Name":"protoform-token-bhg5c","ReadOnly":true,"MountPath":"/var/run/secrets/kubernetes.io/serviceaccount","SubPath":""}],"LivenessProbe":null,"ReadinessProbe":null,"Lifecycle":null,"TerminationMessagePath":"/dev/termination-log","TerminationMessagePolicy":"File","ImagePullPolicy":"Always","SecurityContext":{"Capabilities":{"Add":null,"Drop":["\n\nA: KILL","MKNOD","SETGID","SETUID"]},"Privileged":false,"SELinuxOptions":{"User":"","Role":"","Type":"","Level":"s0:c8,c7"},"RunAsUser":1000070000,"RunAsNonRoot":null,"ReadOnlyRootFilesystem":null},"Stdin":false,"StdinOnce":false,"TTY":false}],"RestartPolicy":"Never","TerminationGracePeriodSeconds":30,"ActiveDeadlineSeconds":null,"DNSPolicy":"ClusterFirst","NodeSelector":null,"ServiceAccountName":"protoform","AutomountServiceAccountToken":null,"NodeName":"localhost","SecurityContext":{"HostNetwork":false,"HostPID":false,"HostIPC":false,"SELinuxOptions":{"User":"","Role":"","Type":"","Level":"s0:c8,c7"},"RunAsUser":null,"RunAsNonRoot":null,"SupplementalGroups":[],"FSGroup":1000070000},"ImagePullSecrets":[{"Name":"protoform-dockercfg-95xhn"}],"Hostname":"","Subdomain":"","Affinity":null,"SchedulerName":"default-scheduler","Tolerations":null,"HostAliases":null}\n\nB: MKNOD"]},"Privileged":false,"SELinuxOptions":{"User":"","Role":"","Type":"","Level":"s0:c8,c7"},"RunAsUser":null,"RunAsNonRoot":null,"ReadOnlyRootFilesystem":null},"Stdin":false,"StdinOnce":false,"TTY":false}],"RestartPolicy":"Never","TerminationGracePeriodSeconds":30,"ActiveDeadlineSeconds":null,"DNSPolicy":"ClusterFirst","NodeSelector":null,"ServiceAccountName":"protoform","AutomountServiceAccountToken":null,"NodeName":"localhost","SecurityContext":{"HostNetwork":false,"HostPID":false,"HostIPC":false,"SELinuxOptions":{"User":"","Role":"","Type":"","Level":"s0:c8,c7"},"RunAsUser":null,"RunAsNonRoot":null,"SupplementalGroups":null,"FSGroup":null},"ImagePullSecrets":[{"Name":"protoform-dockercfg-95xhn"}],"Hostname":"","Subdomain":"","Affinity":null,"SchedulerName":"default-scheduler","Tolerations":null,"HostAliases":null}\n\n]" time="2018-03-22T17:15:16Z" level=info msg="annotations are missing or incorrect on pod bds-perceptor/perceptor-scanner-n8vvc. Expected map[kubernetes.io/created-by:{"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicationController","namespace":"bds-perceptor","name":"perceptor-scanner","uid":"22216a2f-2dde-11e8-bfa6-eee9e4eb6160","apiVersion":"v1","resourceVersion":"1421"}}\n openshift.io/scc:privileged] to contain map[pod.server-version:4.5.0-SNAPSHOT image0.policy-violations:0 image1.overall-status:NOT_IN_VIOLATION image0.vulnerabilities:20 image0.project-endpoint:https://hub-piv01.blackducksoftware.com/api/projects/af7d9c0f-4c9d-4ece-ac23-ab25bcb8af8f/versions/76c322fc-bdce-4684-9fe8-7b0bad0682ba/components image1.policy-violations:0 image1.project-endpoint:https://hub-piv01.blackducksoftware.com/api/projects/5f3d095d-8ee1-45bf-8438-39e696396d52/versions/7face4bd-9e20-4479-a802-2d1fbab39421/components image1.vulnerabilities:20 pod.vulnerabilities:40 image1.:gcr.io.gke-verification.blackducksoftware.perceptor-scanner image0.:gcr.io.gke-verification.blackducksoftware.perceptor-imagefacade image1.server-version:4.5.0-SNAPSHOT image0.overall-status:NOT_IN_VIOLATION image0.server-version:4.5.0-SNAPSHOT image1.scanner-version:4.5.0-SNAPSHOT pod.policy-violations:0 pod.overall-status:NOT_IN_VIOLATION pod.scanner-version:4.5.0-SNAPSHOT image0.scanner-version:4.5.0-SNAPSHOT]" time="2018-03-22T17:15:16Z" level=error msg="unable to update annotations/labels for pod bds-perceptor:perceptor-scanner-n8vvc: Pod "perceptor-scanner-n8vvc" is invalid: [metadata.annotations: Invalid value: "image0.": name part must consist of alphanumeric characters, '-', '' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9.])?[A-Za-z0-9]'), metadata.annotations: Invalid value: "image1.": name part must consist of alphanumeric characters, '-', '' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9.]*)?[A-Za-z0-9]')]"

Notes:

rrati commented 6 years ago

Fixed by #38