diff --git a/simulator/resourceapplier/resourceapplier.go b/simulator/resourceapplier/resourceapplier.go index 13dea0ad..e821f3af 100644 --- a/simulator/resourceapplier/resourceapplier.go +++ b/simulator/resourceapplier/resourceapplier.go @@ -280,6 +280,7 @@ func removeUnnecessaryMetadata(resource *unstructured.Unstructured) *unstructure resource.SetUID("") resource.SetGeneration(0) resource.SetResourceVersion("") + resource.SetCreationTimestamp(metav1.Time{}) return resource } diff --git a/simulator/snapshot/snapshot.go b/simulator/snapshot/snapshot.go index ce2f6fb6..d19d21af 100644 --- a/simulator/snapshot/snapshot.go +++ b/simulator/snapshot/snapshot.go @@ -495,6 +495,9 @@ func (s *Service) applyPods(ctx context.Context, r *ResourcesForLoad, eg *util.S pod := r.Pods[i] if err := eg.Go(func() error { pod.ObjectMetaApplyConfiguration.UID = nil + pod.ObjectMetaApplyConfiguration.CreationTimestamp = nil + pod.ObjectMetaApplyConfiguration.ResourceVersion = nil + pod.WithAPIVersion("v1").WithKind("Pod") _, err := s.client.CoreV1().Pods(*pod.Namespace).Apply(ctx, &pod, metav1.ApplyOptions{Force: true, FieldManager: "simulator"}) if err != nil {