Files
zot/pkg/meta/proto/gen/versioned.pb.go
T
Andrei Aaron 3c7d5a5f1d feat: add TaggedTimestamp to ImageSummary returned by graphql API (#3731)
feat(meta): add TaggedTimestamp field and preserve during re-parsing

Add TaggedTimestamp field to track when image tags were created, exposed
through GraphQL API. Previously, when zot restarted and re-parsed storage,
ResetRepoReferences would clear all tags, causing timestamp information to
be lost and reset to the service restart time for existing images.

This change adds TaggedTimestamp support and modifies ResetRepoReferences to
selectively preserve tags that still exist in storage, maintaining their
TaggedTimestamp values. Tags that no longer exist in storage are removed as
before.

Changes:
- Add TaggedTimestamp field to GraphQL ImageSummary schema
- Update GraphQL conversion functions to populate TaggedTimestamp with
  fallback to PushTimestamp when unavailable
- Updated ResetRepoReferences interface to accept tagsToKeep parameter
- Modified ParseRepo to collect tags from storage before resetting
- Updated all backend implementations (Redis, DynamoDB, BoltDB) to preserve
  tags in tagsToKeep instead of clearing all tags
- Updated tests and mocks to match new signature

This ensures TaggedTimestamp accurately reflects when tags were originally
created, and exposes this information through the GraphQL API.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-01-30 23:05:14 +02:00

143 lines
4.2 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.24.4
// source: oci/versioned.proto
package gen
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Versioned struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SchemaVersion int32 `protobuf:"varint,1,opt,name=SchemaVersion,proto3" json:"SchemaVersion,omitempty"`
}
func (x *Versioned) Reset() {
*x = Versioned{}
if protoimpl.UnsafeEnabled {
mi := &file_oci_versioned_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Versioned) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Versioned) ProtoMessage() {}
func (x *Versioned) ProtoReflect() protoreflect.Message {
mi := &file_oci_versioned_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Versioned.ProtoReflect.Descriptor instead.
func (*Versioned) Descriptor() ([]byte, []int) {
return file_oci_versioned_proto_rawDescGZIP(), []int{0}
}
func (x *Versioned) GetSchemaVersion() int32 {
if x != nil {
return x.SchemaVersion
}
return 0
}
var File_oci_versioned_proto protoreflect.FileDescriptor
var file_oci_versioned_proto_rawDesc = []byte{
0x0a, 0x13, 0x6f, 0x63, 0x69, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x6f, 0x63, 0x69, 0x5f, 0x76, 0x31, 0x22, 0x31, 0x0a,
0x09, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x53, 0x63,
0x68, 0x65, 0x6d, 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_oci_versioned_proto_rawDescOnce sync.Once
file_oci_versioned_proto_rawDescData = file_oci_versioned_proto_rawDesc
)
func file_oci_versioned_proto_rawDescGZIP() []byte {
file_oci_versioned_proto_rawDescOnce.Do(func() {
file_oci_versioned_proto_rawDescData = protoimpl.X.CompressGZIP(file_oci_versioned_proto_rawDescData)
})
return file_oci_versioned_proto_rawDescData
}
var file_oci_versioned_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_oci_versioned_proto_goTypes = []interface{}{
(*Versioned)(nil), // 0: oci_v1.Versioned
}
var file_oci_versioned_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_oci_versioned_proto_init() }
func file_oci_versioned_proto_init() {
if File_oci_versioned_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_oci_versioned_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Versioned); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_oci_versioned_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_oci_versioned_proto_goTypes,
DependencyIndexes: file_oci_versioned_proto_depIdxs,
MessageInfos: file_oci_versioned_proto_msgTypes,
}.Build()
File_oci_versioned_proto = out.File
file_oci_versioned_proto_rawDesc = nil
file_oci_versioned_proto_goTypes = nil
file_oci_versioned_proto_depIdxs = nil
}