How to rig this robotic arm piece


i’ve made a robotic arm and over a part that can extend, I’ve added a rubber sleeve. How could I rig it so that when it extends, the rubber sleeve stretches or contracts with it? I’ve tried basic parenting with automatic weights but its a horrible effect. Will i some how have to lattice deform this kind of thing?

thanks! i’ll study that