Skip to content

s2i job label must be no more than 63 characters #170

Description

@yangbo7907

Hi guys,
I got stucked by issue "must be no more than 63 characters",.
It was successful when I manually created a job by click "run" button in the image builder, and the final web application worked as I expectecd, I saw the job presented:
root@yb01:~# kubectl get jobs -A
NAMESPACE NAME COMPLETIONS DURATION AGE
demo1 dockerhub.kubekey.local-library-myweb-0ts-9fbc088797cc-job 1/1 9s 12h
demo1 dockerhub.kubekey.local-library-myweb-etm-a5364c5f3a73-job 1/1 8s 32m
demo1 dockerhub.kubekey.local-library-myweb-prh-68e5f481c0bd-job 1/1 10s 4d20h
demo1 library-mywebb-latest-vot-ru5-fbca5cfd0776-job 1/1 10s 4d20h

but when I triggered a job from the gitlab web hook, I got the error in the s2i operator logs:

I1227 03:41:19.150241 1 s2irun_controller.go:136] s2irun-controller "msg"="Reconciler of s2irun called" "Name"="dockerhub.kubekey.local-library-mywebc-latest-gah7qf7m"
I1227 03:41:19.151135 1 s2irun_controller.go:270] s2irun-controller "msg"="Creating Job" "Name"="dockerhub.kubekey.local-library-mywebc-latest-gah7qf7m-b36c6f9d5838-job" "Namespace"="demo1"
E1227 03:41:19.160172 1 s2irun_controller.go:281] s2irun-controller "msg"="Failed to create Job" "error"="Job.batch "dockerhub.kubekey.local-library-mywebc-latest-gah7qf7m-b36c6f9d5838-job" is invalid: spec.template.labels: Invalid value: "dockerhub.kubekey.local-library-mywebc-latest-gah7qf7m-b36c6f9d5838-job": must be no more than 63 characters" "Name"="dockerhub.kubekey.local-library-mywebc-latest-gah7qf7m-b36c6f9d5838-job" "Namespace"="demo1"
E1227 03:41:19.162391 1 controller.go:267] controller-runtime/manager/controller/s2irun-controller "msg"="Reconciler error" "error"="Job.batch "dockerhub.kubekey.local-library-mywebc-latest-gah7qf7m-b36c6f9d5838-job" is invalid: spec.template.labels: Invalid value: "dockerhub.kubekey.local-library-mywebc-latest-gah7qf7m-b36c6f9d5838-job": must be no more than 63 characters" "name"="dockerhub.kubekey.local-library-mywebc-latest-gah7qf7m" "namespace"="demo1"

the job name "dockerhub.kubekey.local-library-mywebc-latest-gah7qf7m-b36c6f9d5838-job" is really too long to exceed the 63 characters and is different from the manual job which does't make the job name long than 63 limit, so may I have the solution for this issue? really appreciate.

Thanks,
Leo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions