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
10991099 if err == nil { // usable as remote snapshot without unlazying.
11001100 defer func () {
11011101 // 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" )
11041113 }
11051114 if _ , err := r .cm .Snapshotter .Update (ctx , info , tmpFields ... ); err != nil {
11061115 bklog .G (ctx ).Warn (errors .Wrapf (err ,
You can’t perform that action at this time.
0 commit comments