Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove null creationTimestamp from CRD metadata #3163

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

omerap12
Copy link
Contributor

What type of PR is this?
bug

Which issue does this PR fix?:
issue #3017

What does this PR do / Why do we need it?:
Removes metadata.creationTimestamp: null field from CustomResourceDefinition to resolve kubeconform validation errors. This field is automatically managed by Kubernetes and should not be explicitly set to null in the CRD definition.

Testing done on this change:

Will this PR introduce any new dependencies?:

Will this break upgrades or downgrades? Has updating a running cluster been tested?:

Does this change require updates to the CNI daemonset config files to work?:

Does this PR introduce any user-facing change?:

NONE

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@omerap12 omerap12 requested a review from a team as a code owner December 31, 2024 09:41
@orsenthil
Copy link
Member

Looks like createTimestamp was added automatically when using controller-gen.kubebuilder.io/version: v0.11.3

Since creationTimeStamp is populated by system https://github.com/kubernetes/apimachinery/blob/master/pkg/apis/meta/v1/types.go#L179-L188 it is okay to remove it from CRD file.

	// 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.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	CreationTimestamp Time `json:"creationTimestamp,omitempty" protobuf:"bytes,8,opt,name=creationTimestamp"`

Copy link
Member

@orsenthil orsenthil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@orsenthil orsenthil merged commit 94c4a15 into aws:master Jan 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants