Add omitempty json tag to fake.ConnectionDetailsLastPublishedTimer.Time field

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
This commit is contained in:
Alper Rifat Ulucinar 2022-10-18 14:07:01 +03:00
parent bce61005a1
commit 31279534ed
No known key found for this signature in database
GPG Key ID: 7FA6E859125EFEEF
1 changed files with 7 additions and 1 deletions

View File

@ -249,7 +249,13 @@ func (m *EnvironmentConfigReferencer) GetEnvironmentConfigReferences() []corev1.
// ConnectionDetailsLastPublishedTimer is a mock that implements the
// ConnectionDetailsLastPublishedTimer interface.
type ConnectionDetailsLastPublishedTimer struct{ Time *metav1.Time }
type ConnectionDetailsLastPublishedTimer struct {
// NOTE: runtime.DefaultUnstructuredConverter.ToUnstructured
// cannot currently handle if `Time` is nil here.
// The `omitempty` json tag is a workaround that
// prevents a panic.
Time *metav1.Time `json:"lastPublishedTime,omitempty"`
}
// SetConnectionDetailsLastPublishedTime sets the published time.
func (c *ConnectionDetailsLastPublishedTimer) SetConnectionDetailsLastPublishedTime(t *metav1.Time) {