@@ -13,7 +13,6 @@ public static async Task PublishImageAsync(
1313 SourceImageReference sourceImageReference ,
1414 DestinationImageReference destinationImageReference ,
1515 Microsoft . Build . Utilities . TaskLoggingHelper Log ,
16- bool isSafeLog ,
1716 Telemetry telemetry ,
1817 CancellationToken cancellationToken )
1918 {
@@ -27,7 +26,6 @@ await PushToLocalRegistryAsync(
2726 sourceImageReference ,
2827 destinationImageReference ,
2928 Log ,
30- isSafeLog ,
3129 telemetry ,
3230 cancellationToken ,
3331 destinationImageReference . LocalRegistry ! . LoadAsync ) . ConfigureAwait ( false ) ;
@@ -38,7 +36,6 @@ await PushToRemoteRegistryAsync(
3836 sourceImageReference ,
3937 destinationImageReference ,
4038 Log ,
41- isSafeLog ,
4239 cancellationToken ,
4340 destinationImageReference . RemoteRegistry ! . PushAsync ,
4441 Strings . ContainerBuilder_ImageUploadedToRegistry ) . ConfigureAwait ( false ) ;
@@ -55,7 +52,6 @@ public static async Task PublishImageAsync(
5552 SourceImageReference sourceImageReference ,
5653 DestinationImageReference destinationImageReference ,
5754 Microsoft . Build . Utilities . TaskLoggingHelper Log ,
58- bool isSafeLog ,
5955 Telemetry telemetry ,
6056 CancellationToken cancellationToken )
6157 {
@@ -69,7 +65,6 @@ await PushToLocalRegistryAsync(
6965 sourceImageReference ,
7066 destinationImageReference ,
7167 Log ,
72- isSafeLog ,
7368 telemetry ,
7469 cancellationToken ,
7570 destinationImageReference . LocalRegistry ! . LoadAsync ) . ConfigureAwait ( false ) ;
@@ -80,7 +75,6 @@ await PushToRemoteRegistryAsync(
8075 sourceImageReference ,
8176 destinationImageReference ,
8277 Log ,
83- isSafeLog ,
8478 cancellationToken ,
8579 destinationImageReference . RemoteRegistry ! . PushManifestListAsync ,
8680 Strings . ImageIndexUploadedToRegistry ) . ConfigureAwait ( false ) ;
@@ -97,7 +91,6 @@ private static async Task PushToLocalRegistryAsync<T>(
9791 SourceImageReference sourceImageReference ,
9892 DestinationImageReference destinationImageReference ,
9993 Microsoft . Build . Utilities . TaskLoggingHelper Log ,
100- bool isSafeLog ,
10194 Telemetry telemetry ,
10295 CancellationToken cancellationToken ,
10396 Func < T , SourceImageReference , DestinationImageReference , CancellationToken , Task > loadFunc )
@@ -112,34 +105,25 @@ private static async Task PushToLocalRegistryAsync<T>(
112105 try
113106 {
114107 await loadFunc ( image , sourceImageReference , destinationImageReference , cancellationToken ) . ConfigureAwait ( false ) ;
115- if ( isSafeLog )
116- {
117- Log . LogMessage ( MessageImportance . High , Strings . ContainerBuilder_ImageUploadedToLocalDaemon , destinationImageReference , localRegistry ) ;
118- }
108+ Log . LogMessage ( MessageImportance . High , Strings . ContainerBuilder_ImageUploadedToLocalDaemon , destinationImageReference , localRegistry ) ;
119109 }
120- catch ( ContainerHttpException e ) when ( isSafeLog )
110+ catch ( ContainerHttpException e )
121111 {
122112 Log . LogErrorFromException ( e , true ) ;
123113 }
124114 catch ( AggregateException ex ) when ( ex . InnerException is DockerLoadException dle )
125115 {
126116 telemetry . LogLocalLoadError ( ) ;
127- if ( isSafeLog )
128- {
129- Log . LogErrorFromException ( dle , showStackTrace : false ) ;
130- }
117+ Log . LogErrorFromException ( dle , showStackTrace : false ) ;
131118 }
132- catch ( ArgumentException argEx ) when ( isSafeLog )
119+ catch ( ArgumentException argEx )
133120 {
134121 Log . LogErrorFromException ( argEx , showStackTrace : false ) ;
135122 }
136123 catch ( DockerLoadException dle )
137124 {
138125 telemetry . LogLocalLoadError ( ) ;
139- if ( isSafeLog )
140- {
141- Log . LogErrorFromException ( dle , showStackTrace : false ) ;
142- }
126+ Log . LogErrorFromException ( dle , showStackTrace : false ) ;
143127 }
144128 }
145129
@@ -148,7 +132,6 @@ private static async Task PushToRemoteRegistryAsync<T>(
148132 SourceImageReference sourceImageReference ,
149133 DestinationImageReference destinationImageReference ,
150134 Microsoft . Build . Utilities . TaskLoggingHelper Log ,
151- bool isSafeLog ,
152135 CancellationToken cancellationToken ,
153136 Func < T , SourceImageReference , DestinationImageReference , CancellationToken , Task > pushFunc ,
154137 string successMessage )
@@ -160,20 +143,17 @@ await pushFunc(
160143 sourceImageReference ,
161144 destinationImageReference ,
162145 cancellationToken ) . ConfigureAwait ( false ) ;
163- if ( isSafeLog )
164- {
165- Log . LogMessage ( MessageImportance . High , successMessage , destinationImageReference , destinationImageReference . RemoteRegistry ! . RegistryName ) ;
166- }
146+ Log . LogMessage ( MessageImportance . High , successMessage , destinationImageReference , destinationImageReference . RemoteRegistry ! . RegistryName ) ;
167147 }
168- catch ( UnableToAccessRepositoryException ) when ( isSafeLog )
148+ catch ( UnableToAccessRepositoryException )
169149 {
170150 Log . LogErrorWithCodeFromResources ( nameof ( Strings . UnableToAccessRepository ) , destinationImageReference . Repository , destinationImageReference . RemoteRegistry ! . RegistryName ) ;
171151 }
172- catch ( ContainerHttpException e ) when ( isSafeLog )
152+ catch ( ContainerHttpException e )
173153 {
174154 Log . LogErrorFromException ( e , true ) ;
175155 }
176- catch ( Exception e ) when ( isSafeLog )
156+ catch ( Exception e )
177157 {
178158 Log . LogErrorWithCodeFromResources ( nameof ( Strings . RegistryOutputPushFailed ) , e . Message ) ;
179159 Log . LogMessage ( MessageImportance . Low , "Details: {0}" , e ) ;
0 commit comments