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

Why are both fields in VolumeSnapshotError struct optional? #1233

Open
gnufied opened this issue Dec 6, 2024 · 1 comment
Open

Why are both fields in VolumeSnapshotError struct optional? #1233

gnufied opened this issue Dec 6, 2024 · 1 comment

Comments

@gnufied
Copy link
Contributor

gnufied commented Dec 6, 2024

Why are both fields in VolumeSnapshotError struct optional?

// VolumeSnapshotError describes an error encountered during snapshot creation.
type VolumeSnapshotError struct {
	// time is the timestamp when the error was encountered.
	// +optional
	Time *metav1.Time `json:"time,omitempty" protobuf:"bytes,1,opt,name=time"`

	// message is a string detailing the encountered error during snapshot
	// creation if specified.
	// NOTE: message may be logged, and it should not contain sensitive
	// information.
	// +optional
	Message *string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"`
}

This doesn't make sense IMO. Is there a value in instantiating empty error struct?

@xing-yang
Copy link
Collaborator

You are right, ideally Time and Message should be required in this struct. However, since Volume Snapshot API is already GA, we cannot make the optional fields required.

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

No branches or pull requests

2 participants