Fix the issue of AWSMachine controller trying to update rootVolume deviceName
rootVolume deviceName is an immutable field so the webhook denies an update request.
This was caused by rootVolumes of AWSMachine and an instance sharing the
same pointer.
@@ -115,7 +115,7 @@ func (s *Service) CreateInstance(scope *scope.MachineScope, userData []byte) (*i
input := &infrav1.Instance{
Type: scope.AWSMachine.Spec.InstanceType,
IAMProfile: scope.AWSMachine.Spec.IAMInstanceProfile,
- RootVolume: scope.AWSMachine.Spec.RootVolume,
+ RootVolume: scope.AWSMachine.Spec.RootVolume.DeepCopy(),
NonRootVolumes: scope.AWSMachine.Spec.NonRootVolumes,
NetworkInterfaces: scope.AWSMachine.Spec.NetworkInterfaces,
}
