@@ -87,7 +87,7 @@ func SyncImage(ctx context.Context, image *structs.Image) error {
87
87
Strs ("targets" , image .Targets ).
88
88
Msg ("Syncing image" )
89
89
90
- pullAuth , _ := getAuth (image .GetSourceRegistry (), image .GetSourceRepository ())
90
+ pullAuth , pullAuthName := getAuth (image .GetSourceRegistry (), image .GetSourceRepository ())
91
91
92
92
puller , err := remote .NewPuller (pullAuth )
93
93
if err != nil {
@@ -107,6 +107,7 @@ func SyncImage(ctx context.Context, image *structs.Image) error {
107
107
// Get all tags from source
108
108
log .Info ().
109
109
Str ("image" , image .Source ).
110
+ Str ("auth" , pullAuthName ).
110
111
Msg ("Fetching tags" )
111
112
112
113
var srcTags []string
@@ -122,24 +123,26 @@ func SyncImage(ctx context.Context, image *structs.Image) error {
122
123
123
124
log .Info ().
124
125
Str ("image" , image .Source ).
126
+ Str ("auth" , pullAuthName ).
125
127
Int ("tags" , len (srcTags )).
126
128
Msg ("Found tags" )
127
129
128
130
// Get all tags from targets
129
131
var dstTags []string
130
132
131
133
for _ , dst := range image .Targets {
132
- log .Info ().
133
- Str ("image" , image .Source ).
134
- Str ("target" , dst ).
135
- Msg ("Fetching destination tags" )
136
-
137
134
dstRepo , err := name .NewRepository (dst )
138
135
if err != nil {
139
136
return err
140
137
}
141
138
142
- pushAuth , _ := getAuth (image .GetRegistry (dst ), image .GetRepository (dst ))
139
+ pushAuth , pushAuthName := getAuth (image .GetRegistry (dst ), image .GetRepository (dst ))
140
+
141
+ log .Info ().
142
+ Str ("image" , image .Source ).
143
+ Str ("target" , dst ).
144
+ Str ("auth" , pushAuthName ).
145
+ Msg ("Fetching destination tags" )
143
146
144
147
dstPuller , err := remote .NewPuller (pushAuth )
145
148
if err != nil {
@@ -166,6 +169,7 @@ func SyncImage(ctx context.Context, image *structs.Image) error {
166
169
Str ("image" , image .Source ).
167
170
Str ("target" , dst ).
168
171
Int ("tags" , len (dstTags )).
172
+ Str ("auth" , pushAuthName ).
169
173
Msg ("Found destination tags" )
170
174
}
171
175
0 commit comments