Skip to content

Commit 6d032b9

Browse files
committed
Rename CommittedAt to CreatedAt in content interface
Use "created at" terminology to be consistent with the rest of the containerd interfaces. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
1 parent a78d0bd commit 6d032b9

File tree

9 files changed

+108
-108
lines changed

9 files changed

+108
-108
lines changed

api/services/content/v1/content.pb.go

Lines changed: 77 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/content/v1/content.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ message Info {
8181
// Size is the total number of bytes in the blob.
8282
int64 size = 2;
8383

84-
// CommittedAt provides the time at which the blob was committed.
85-
google.protobuf.Timestamp committed_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
84+
// CreatedAt provides the time at which the blob was committed.
85+
google.protobuf.Timestamp created_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
8686

8787
// UpdatedAt provides the time the info was last updated.
8888
google.protobuf.Timestamp updated_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
@@ -105,7 +105,7 @@ message UpdateRequest {
105105
// UpdateMask specifies which fields to perform the update on. If empty,
106106
// the operation applies to all fields.
107107
//
108-
// In info, Digest, Size, and CommittedAt are immutable,
108+
// In info, Digest, Size, and CreatedAt are immutable,
109109
// other field may be updated using this mask.
110110
// If no mask is provided, all mutable field are updated.
111111
google.protobuf.FieldMask update_mask = 2;

cmd/dist/fetch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ outer:
163163
Status: "waiting",
164164
}
165165
}
166-
} else if info.CommittedAt.After(start) {
166+
} else if info.CreatedAt.After(start) {
167167
statuses[key] = statusInfo{
168168
Ref: key,
169169
Status: "done",
170170
Offset: info.Size,
171171
Total: info.Size,
172-
UpdatedAt: info.CommittedAt,
172+
UpdatedAt: info.CreatedAt,
173173
}
174174
} else {
175175
statuses[key] = statusInfo{

cmd/dist/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var listCommand = cli.Command{
6161
fmt.Fprintf(tw, "%s\t%s\t%s\t%s\n",
6262
info.Digest,
6363
units.HumanSize(float64(info.Size)),
64-
units.HumanDuration(time.Since(info.CommittedAt)),
64+
units.HumanDuration(time.Since(info.CreatedAt)),
6565
labels)
6666
return nil
6767
}

content/content.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ type Ingester interface {
2929
// TODO(stevvooe): Consider a very different name for this struct. Info is way
3030
// to general. It also reads very weird in certain context, like pluralization.
3131
type Info struct {
32-
Digest digest.Digest
33-
Size int64
34-
CommittedAt time.Time
35-
UpdatedAt time.Time
36-
Labels map[string]string
32+
Digest digest.Digest
33+
Size int64
34+
CreatedAt time.Time
35+
UpdatedAt time.Time
36+
Labels map[string]string
3737
}
3838

3939
type Status struct {

content/store.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ func (s *store) Info(ctx context.Context, dgst digest.Digest) (Info, error) {
5252

5353
func (s *store) info(dgst digest.Digest, fi os.FileInfo) Info {
5454
return Info{
55-
Digest: dgst,
56-
Size: fi.Size(),
57-
CommittedAt: fi.ModTime(),
58-
UpdatedAt: fi.ModTime(),
55+
Digest: dgst,
56+
Size: fi.Size(),
57+
CreatedAt: fi.ModTime(),
58+
UpdatedAt: fi.ModTime(),
5959
}
6060
}
6161

metadata/content.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func (cs *contentStore) checkAccess(ctx context.Context, dgst digest.Digest) err
432432
}
433433

434434
func readInfo(info *content.Info, bkt *bolt.Bucket) error {
435-
if err := readTimestamps(&info.CommittedAt, &info.UpdatedAt, bkt); err != nil {
435+
if err := readTimestamps(&info.CreatedAt, &info.UpdatedAt, bkt); err != nil {
436436
return err
437437
}
438438

@@ -452,7 +452,7 @@ func readInfo(info *content.Info, bkt *bolt.Bucket) error {
452452
}
453453

454454
func writeInfo(info *content.Info, bkt *bolt.Bucket) error {
455-
if err := writeTimestamps(bkt, info.CommittedAt, info.UpdatedAt); err != nil {
455+
if err := writeTimestamps(bkt, info.CreatedAt, info.UpdatedAt); err != nil {
456456
return err
457457
}
458458

services/content/service.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ func (s *Service) List(req *api.ListContentRequest, session api.Content_ListServ
111111

112112
if err := s.store.Walk(session.Context(), func(info content.Info) error {
113113
buffer = append(buffer, api.Info{
114-
Digest: info.Digest,
115-
Size_: info.Size,
116-
CommittedAt: info.CommittedAt,
117-
Labels: info.Labels,
114+
Digest: info.Digest,
115+
Size_: info.Size,
116+
CreatedAt: info.CreatedAt,
117+
Labels: info.Labels,
118118
})
119119

120120
if len(buffer) >= 100 {

services/content/store.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,20 +193,20 @@ func (rs *remoteStore) negotiate(ctx context.Context, ref string, size int64, ex
193193

194194
func infoToGRPC(info content.Info) contentapi.Info {
195195
return contentapi.Info{
196-
Digest: info.Digest,
197-
Size_: info.Size,
198-
CommittedAt: info.CommittedAt,
199-
UpdatedAt: info.UpdatedAt,
200-
Labels: info.Labels,
196+
Digest: info.Digest,
197+
Size_: info.Size,
198+
CreatedAt: info.CreatedAt,
199+
UpdatedAt: info.UpdatedAt,
200+
Labels: info.Labels,
201201
}
202202
}
203203

204204
func infoFromGRPC(info contentapi.Info) content.Info {
205205
return content.Info{
206-
Digest: info.Digest,
207-
Size: info.Size_,
208-
CommittedAt: info.CommittedAt,
209-
UpdatedAt: info.UpdatedAt,
210-
Labels: info.Labels,
206+
Digest: info.Digest,
207+
Size: info.Size_,
208+
CreatedAt: info.CreatedAt,
209+
UpdatedAt: info.UpdatedAt,
210+
Labels: info.Labels,
211211
}
212212
}

0 commit comments

Comments
 (0)