Skip to content

Commit

Permalink
Merge pull request #499 from 0xff-dev/main
Browse files Browse the repository at this point in the history
fix: update updatetime setting logic
  • Loading branch information
bjwswang authored Jan 5, 2024
2 parents cf9e6d4 + b1550cd commit 8c812a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions apiserver/pkg/dataset/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func dataset2model(obj *unstructured.Unstructured) (*generated.Dataset, error) {
ds.Namespace = obj.GetNamespace()
n := obj.GetCreationTimestamp()
ds.CreationTimestamp = &n.Time
ds.UpdateTimestamp = &n.Time
ds.Labels = utils.MapStr2Any(obj.GetLabels())
ds.Annotations = utils.MapStr2Any(obj.GetAnnotations())
dataset := &v1alpha1.Dataset{}
Expand Down
3 changes: 1 addition & 2 deletions apiserver/pkg/versioneddataset/versioned_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func versionedDataset2model(obj *unstructured.Unstructured) (*generated.Versione
return nil, err
}
vds.CreationTimestamp = obj.GetCreationTimestamp().Time
vds.UpdateTimestamp = &vds.CreationTimestamp
vds.Creator = &versioneddataset.Spec.Creator
vds.DisplayName = &versioneddataset.Spec.DisplayName
vds.Description = &versioneddataset.Spec.Description
Expand All @@ -69,8 +70,6 @@ func versionedDataset2model(obj *unstructured.Unstructured) (*generated.Versione
Name: versioneddataset.Spec.Dataset.Name,
Namespace: versioneddataset.Spec.Dataset.Namespace,
}
now := time.Now()
vds.UpdateTimestamp = &now

vds.Version = versioneddataset.Spec.Version
vds.SyncStatus = new(string)
Expand Down

0 comments on commit 8c812a6

Please sign in to comment.