K8s: Dashboard spec should not have id (#98336)

This commit is contained in:
Stephanie Hingtgen
2025-01-03 09:28:45 -06:00
committed by GitHub
parent f3a553fb9b
commit b4ab55ae38
10 changed files with 645 additions and 17 deletions
+8 -2
View File
@@ -123,8 +123,14 @@ func (s *Storage) prepareObjectForUpdate(ctx context.Context, updateObject runti
obj.SetCreatedBy(previous.GetCreatedBy())
obj.SetCreationTimestamp(previous.GetCreationTimestamp())
obj.SetResourceVersion("") // removed from saved JSON because the RV is not yet calculated
obj.SetDeprecatedInternalID(previous.GetDeprecatedInternalID()) // nolint:staticcheck
obj.SetResourceVersion("") // removed from saved JSON because the RV is not yet calculated
// for dashboards, a mutation hook will set it if it didn't exist on the previous obj
// avoid setting it back to 0
previousInternalID := previous.GetDeprecatedInternalID() // nolint:staticcheck
if previousInternalID != 0 {
obj.SetDeprecatedInternalID(previousInternalID) // nolint:staticcheck
}
// Read+write will verify that origin format is accurate
repo, err := obj.GetRepositoryInfo()