@@ -25,10 +25,16 @@ private static readonly Action<ILogger, string, Exception> _StopDockerContainer
25
25
private static readonly Action < ILogger , string , Exception > _DeleteDockerContainer
26
26
= LoggerMessage . Define < string > ( LogLevel . Information , default , "Delete Docker container {Id}" ) ;
27
27
28
- private static readonly Action < ILogger , string , string , Exception > _ExtractArchiveToDockerContainer
29
- = LoggerMessage . Define < string , string > ( LogLevel . Information , default , "Copy tar archive to \" {Path} \" at Docker container {Id} " ) ;
28
+ private static readonly Action < ILogger , string , Exception > _StartReadinessCheck
29
+ = LoggerMessage . Define < string > ( LogLevel . Information , default , "Wait for Docker container {Id} to complete readiness checks " ) ;
30
30
31
- private static readonly Action < ILogger , string , string , Exception > _GetArchiveFromDockerContainer
31
+ private static readonly Action < ILogger , string , Exception > _CompleteReadinessCheck
32
+ = LoggerMessage . Define < string > ( LogLevel . Information , default , "Docker container {Id} ready" ) ;
33
+
34
+ private static readonly Action < ILogger , string , string , Exception > _CopyArchiveToDockerContainer
35
+ = LoggerMessage . Define < string , string > ( LogLevel . Information , default , "Copy tar archive to \" {Path}\" to Docker container {Id}" ) ;
36
+
37
+ private static readonly Action < ILogger , string , string , Exception > _ReadArchiveFromDockerContainer
32
38
= LoggerMessage . Define < string , string > ( LogLevel . Information , default , "Read \" {Path}\" from Docker container {Id}" ) ;
33
39
34
40
private static readonly Action < ILogger , Type , string , Exception > _AttachToDockerContainer
@@ -91,47 +97,57 @@ public static void IgnorePatternAdded(this ILogger logger, Regex ignorePattern)
91
97
92
98
public static void DockerContainerCreated ( this ILogger logger , string id )
93
99
{
94
- _DockerContainerCreated ( logger , id , null ) ;
100
+ _DockerContainerCreated ( logger , TruncId ( id ) , null ) ;
95
101
}
96
102
97
103
public static void StartDockerContainer ( this ILogger logger , string id )
98
104
{
99
- _StartDockerContainer ( logger , id , null ) ;
105
+ _StartDockerContainer ( logger , TruncId ( id ) , null ) ;
100
106
}
101
107
102
108
public static void StopDockerContainer ( this ILogger logger , string id )
103
109
{
104
- _StopDockerContainer ( logger , id , null ) ;
110
+ _StopDockerContainer ( logger , TruncId ( id ) , null ) ;
105
111
}
106
112
107
113
public static void DeleteDockerContainer ( this ILogger logger , string id )
108
114
{
109
- _DeleteDockerContainer ( logger , id , null ) ;
115
+ _DeleteDockerContainer ( logger , TruncId ( id ) , null ) ;
116
+ }
117
+
118
+ public static void StartReadinessCheck ( this ILogger logger , string id )
119
+ {
120
+ _StartReadinessCheck ( logger , TruncId ( id ) , null ) ;
110
121
}
111
122
112
- public static void ExtractArchiveToDockerContainer ( this ILogger logger , string id , string path )
123
+ public static void CompleteReadinessCheck ( this ILogger logger , string id )
113
124
{
114
- _ExtractArchiveToDockerContainer ( logger , path , id , null ) ;
125
+ _CompleteReadinessCheck ( logger , TruncId ( id ) , null ) ;
115
126
}
116
127
117
- public static void GetArchiveFromDockerContainer ( this ILogger logger , string id , string path )
128
+ public static void CopyArchiveToDockerContainer ( this ILogger logger , string id , string path )
118
129
{
119
- _GetArchiveFromDockerContainer ( logger , path , id , null ) ;
130
+ _CopyArchiveToDockerContainer ( logger , path , TruncId ( id ) , null ) ;
131
+ }
132
+
133
+ public static void ReadArchiveFromDockerContainer ( this ILogger logger , string id , string path )
134
+ {
135
+ _ReadArchiveFromDockerContainer ( logger , path , TruncId ( id ) , null ) ;
120
136
}
121
137
122
138
public static void AttachToDockerContainer ( this ILogger logger , string id , Type type )
123
139
{
124
- _AttachToDockerContainer ( logger , type , id , null ) ;
140
+ _AttachToDockerContainer ( logger , type , TruncId ( id ) , null ) ;
125
141
}
126
142
127
143
public static void ConnectToDockerNetwork ( this ILogger logger , string networkId , string containerId )
128
144
{
129
- _ConnectToDockerNetwork ( logger , containerId , networkId , null ) ;
145
+ _ConnectToDockerNetwork ( logger , TruncId ( containerId ) , TruncId ( networkId ) , null ) ;
130
146
}
131
147
132
148
public static void ExecuteCommandInDockerContainer ( this ILogger logger , string id , IEnumerable < string > command )
133
149
{
134
- _ExecuteCommandInDockerContainer ( logger , string . Join ( " " , command ) , id , null ) ;
150
+ _ExecuteCommandInDockerContainer ( logger , string . Join ( " " , command ) , TruncId ( id ) , null ) ;
135
151
}
136
152
137
153
public static void DockerImageCreated ( this ILogger logger , IImage image )
@@ -151,12 +167,12 @@ public static void DeleteDockerImage(this ILogger logger, IImage image)
151
167
152
168
public static void DockerNetworkCreated ( this ILogger logger , string id )
153
169
{
154
- _DockerNetworkCreated ( logger , id , null ) ;
170
+ _DockerNetworkCreated ( logger , TruncId ( id ) , null ) ;
155
171
}
156
172
157
173
public static void DeleteDockerNetwork ( this ILogger logger , string id )
158
174
{
159
- _DeleteDockerNetwork ( logger , id , null ) ;
175
+ _DeleteDockerNetwork ( logger , TruncId ( id ) , null ) ;
160
176
}
161
177
162
178
public static void DockerVolumeCreated ( this ILogger logger , string name )
@@ -205,5 +221,10 @@ public static void DockerRegistryCredentialFound(this ILogger logger, string doc
205
221
{
206
222
_DockerRegistryCredentialFound ( logger , dockerRegistry , null ) ;
207
223
}
224
+
225
+ private static string TruncId ( string id )
226
+ {
227
+ return id . Substring ( 0 , Math . Min ( 12 , id . Length ) ) ;
228
+ }
208
229
}
209
230
}
0 commit comments