Oliver Williams
Oliver Williams

Reputation: 6364

unable to delete, modify or change the creationTimestamp in a Kubernetes CRD object

I am trying to update a custom resource:

kubectl edit ticketservice r134-4979a2f6-f46d-405d-97bc-ab1ba -n 2b9aea53dbfc47a
apiVersion: ticketservice.ias.alpha.com/v1alpha1
kind: TicketService
metadata:
  annotations:
    foo: bar
    baz: bux
    .. etc ..
  creationTimestamp: "2022-05-04T20:08:06Z" <--- here
  finalizers:
  - ticket-generator/simulator-finalizer
  generation: 3
  labels:
    label1: value1
    .. etc ..
  name: r134-4979a2f6-f46d-405d-97bc-ab1baf97543d

No matter what I do on the edit, the creationTimestamp just comes back at the same time. I can't edit it, can't remove the line either - it just comes back.

I thought maybe the finalizer line was involved, but I was able to delete it, but still no dice editing the creationTimestamp

I think there must be another resource that locks this value; any idea what the reason is, and if there's another check going on on submission, then how would I trace that?

Upvotes: 1

Views: 870

Answers (2)

theadzik
theadzik

Reputation: 138

From kubernetes API docs

CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists.

Upvotes: 0

Oliver Williams
Oliver Williams

Reputation: 6364

creationtimestamp can only be set by Kubernetes as it turns out. From a trusted source but sadly don't have the specific k8s docs ref.

Upvotes: 2

Related Questions