What happened:
When submitting a PodCheckpoint, if the name is long (>63 characters) then the PodCheckpoint will fail to process.
{"level":"error","ts":1593128067.005712,"logger":"kubebuilder.controller","msg":"Reconciler error","controller":"podsavestate-controller","request":"forensics-system/podsavestate-long-name-123456789012345678901234567890123456789012345678901234567890","error":"Job.batch \"podsavestate-long-name-123456789012345678901234567890123456789012345678901234567890-job\" is invalid: spec.template.labels: Invalid value: \"podsavestate-long-name-123456789012345678901234567890123456789012345678901234567890-job\": must be no more than 63 characters","stacktrace":"github.intuit.com/kubernetes/pod-savestate/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/src/github.intuit.com/kubernetes/pod-savestate/vendor/github.com/go-logr/zapr/zapr.go:128\ngithub.intuit.com/kubernetes/pod-savestate/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/src/github.intuit.com/kubernetes/pod-savestate/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:217\ngithub.intuit.com/kubernetes/pod-savestate/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1\n\t/go/src/github.intuit.com/kubernetes/pod-savestate/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:158\ngithub.intuit.com/kubernetes/pod-savestate/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/go/src/github.intuit.com/kubernetes/pod-savestate/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\ngithub.intuit.com/kubernetes/pod-savestate/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/go/src/github.intuit.com/kubernetes/pod-savestate/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134\ngithub.intuit.com/kubernetes/pod-savestate/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\t/go/src/github.intuit.com/kubernetes/pod-savestate/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88"}
What you expected to happen:
PodCheckpoint should be allowed to have long names. Instead of creating a Job with a name based on the PodCheckpoint name (just appending -job), the controller should check the length. If the length is >60 characters, get a short hash of the PodCheckpoint name and name the job by truncating the name of the PodCheckpoint an appropriate amount and then prepending the hash and -job such that the resulting length of the job name is <64 characters.
How to reproduce it (as minimally and precisely as possible):
Is this a BUG REPORT or FEATURE REQUEST?: BUG
What happened: When submitting a PodCheckpoint, if the name is long (>63 characters) then the PodCheckpoint will fail to process.
What you expected to happen: PodCheckpoint should be allowed to have long names. Instead of creating a Job with a name based on the PodCheckpoint name (just appending
-job
), the controller should check the length. If the length is >60 characters, get a short hash of the PodCheckpoint name and name the job by truncating the name of the PodCheckpoint an appropriate amount and then prepending the hash and-job
such that the resulting length of the job name is <64 characters.How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
Other debugging information (if applicable):