File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1099,8 +1099,17 @@ func (sr *immutableRef) prepareRemoteSnapshotsStargzMode(ctx context.Context, s
1099
1099
if err == nil { // usable as remote snapshot without unlazying.
1100
1100
defer func () {
1101
1101
// Remove tmp labels appended in this func
1102
- for k := range tmpLabels {
1103
- info .Labels [k ] = ""
1102
+ if info .Labels != nil {
1103
+ for k := range tmpLabels {
1104
+ info .Labels [k ] = ""
1105
+ }
1106
+ } else {
1107
+ // We are logging here to track to try to debug when and why labels are nil.
1108
+ // Log can be removed when not happening anymore.
1109
+ bklog .G (ctx ).
1110
+ WithField ("snapshotID" , snapshotID ).
1111
+ WithField ("name" , info .Name ).
1112
+ Debug ("snapshots exist but labels are nil" )
1104
1113
}
1105
1114
if _ , err := r .cm .Snapshotter .Update (ctx , info , tmpFields ... ); err != nil {
1106
1115
bklog .G (ctx ).Warn (errors .Wrapf (err ,
You can’t perform that action at this time.
0 commit comments