├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── allocationFollower.go
├── example.nomad
├── followedAllocation.go
├── followedTask.go
├── go.mod
├── go.sum
├── logger.go
├── nomad_follower.nomad
├── service.go
└── vaultTokenBackend.go
/.gitignore:
--------------------------------------------------------------------------------
1 | nomad_follower
2 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM golang:1.16-alpine AS builder
2 | ADD . /build
3 | RUN cd /build && go install -mod=mod
4 |
5 | FROM alpine:latest
6 | COPY --from=builder /go/bin/nomad_follower .
7 | CMD ["./nomad_follower"]
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # nomad_follower
2 | Log forwarder for aggregating allocation logs from nomad worker agents.
3 |
4 | ## Running the application
5 | Run the application on each worker in a nomad cluster.
6 | ```
7 | docker pull sofixa/nomad_follower:latest
8 | docker run -v log_folder:/log -e LOG_TAG="logging" "-e LOG_FILE="/log/nomad-forwarder.log" sofixa/nomad_follower:latest
9 | ```
10 |
11 | Example Nomad job file available [here](./nomad_follower.nomad), with an example job outputting random logs [here](./example.nomad).
12 |
13 | nomad_follower:
14 | - will follow all allocations if it contains service tag ```nomad_follower``` (can be changed with `LOG_TAG` environment variable) on the worker and tail the allocation logs to the aggregate log file.
15 | - will stop following completed allocations and will start following new allocations as they become available.
16 | - can be deployed with nomad in a system task group along with a log collector. The aggregate log file can then be shared with the log collector by writing the aggregate log file into the shared allocation folder.
17 | - formats log entries as json formatted logs. It will convert string formatted logs to json formatted logs by passing the log entry in the ```message``` key.
18 | - adds a ```service_name``` key that contains the listed service names for a task.
19 |
20 | Using nomad_follower prevents the cluster operator from having to run a log collector in every task group for every task on a worker while still allowing nomad to handle the logs for each allocation.
21 |
22 | # License and attribution
23 |
24 | This project is a fork of [this fork](https://github.com/sas1024/nomad_follower) of this original [project](https://github.com/adragoset/nomad_follower).
25 | Everything within is licensed under [GPL v3](./LICENSE)
26 |
--------------------------------------------------------------------------------
/allocationFollower.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "encoding/json"
5 | "fmt"
6 | "io/ioutil"
7 | "os"
8 | "time"
9 |
10 | nomadApi "github.com/hashicorp/nomad/api"
11 | )
12 |
13 | var SaveFormatVersion = 1
14 |
15 | type SavePoint struct {
16 | NodeID string `json:"node_id"`
17 | SaveFormatVersion int `json:"save_format_version"`
18 | SavedAllocs map[string]SavedAlloc `json:"saved_allocs"`
19 | }
20 |
21 | type SavedAlloc struct {
22 | ID string `json:"alloc_id"`
23 | SavedTasks map[string]SavedTask `json:"saved_tasks"`
24 | }
25 |
26 | type SavedTask struct {
27 | Key string `json:"key"`
28 | StdOutOffsets map[string]int64 `json:"stdout_offsets"`
29 | StdErrOffsets map[string]int64 `json:"stderr_offsets"`
30 | }
31 |
32 | //AllocationFollower a container for the list of followed allocations
33 | type AllocationFollower struct {
34 | Allocations map[string]*FollowedAllocation
35 | Nomad NomadConfig
36 | NodeID string
37 | OutChan chan string
38 | Quit chan bool
39 | Ticker *time.Ticker
40 | log Logger
41 | logTag string
42 | }
43 |
44 | //NewAllocationFollower Creates a new allocation follower
45 | func NewAllocationFollower(nomad NomadConfig, logger Logger, logTag string) (a *AllocationFollower, e error) {
46 | return &AllocationFollower{
47 | Allocations: make(map[string]*FollowedAllocation),
48 | Nomad: nomad,
49 | NodeID: "",
50 | Quit: make(chan bool),
51 | log: logger,
52 | logTag: logTag,
53 | }, nil
54 | }
55 |
56 | // SetNodeID set the current Node's ID from the local Nomad agent.
57 | func (a *AllocationFollower) SetNodeID() error {
58 | logContext := "AllocationFollower.SetNodeID"
59 | var err error
60 | var maxRetries = 3
61 | for retryCount := 1; retryCount <= maxRetries; retryCount++ {
62 | time.Sleep(time.Duration(retryCount) * time.Second)
63 | // reset err after each retry -- but leave final error set for return
64 | err = nil
65 | self, err := a.Nomad.Client().Agent().Self()
66 | if err != nil {
67 | a.log.Debugf(logContext, "Unable to query Nomad self endpoint, retry %d of %d", retryCount, maxRetries)
68 | } else {
69 | a.NodeID = self.Stats["client"]["node_id"]
70 | return nil
71 | }
72 | }
73 | a.log.Error(logContext, "Failed to query Nomad self endpoint, exiting")
74 | return err
75 | }
76 |
77 | //Start registers and de registers allocation followers
78 | func (a *AllocationFollower) Start(duration time.Duration, savePath string) <-chan string {
79 | logContext := "AllocationFollower.Start"
80 | a.Ticker = time.NewTicker(duration)
81 | a.OutChan = make(chan string)
82 |
83 | go func() {
84 | defer a.Ticker.Stop()
85 |
86 | // handle first run special case items
87 | a.Nomad.RenewToken()
88 | err := a.SetNodeID()
89 | if err != nil {
90 | // cannot lookup allocations w/o node-id, hard fail
91 | a.log.Errorf(logContext, "Could not fetch NodeID: %s", err)
92 | close(a.OutChan)
93 | return
94 | }
95 | savePoint := a.restoreSavePoint(savePath)
96 | err = a.collectAllocations(savePoint)
97 | if err != nil {
98 | a.log.Debugf(
99 | logContext,
100 | "Error collecting allocations, first run: %s",
101 | err,
102 | )
103 | }
104 | // start routine loop
105 | for {
106 | select {
107 | case <-a.Ticker.C:
108 | err := a.collectAllocations(nil)
109 | if err != nil {
110 | a.log.Debugf(
111 | logContext,
112 | "Error collecting Allocations: %v",
113 | err,
114 | )
115 | // TODO differentiate 403 error from others
116 | a.Nomad.RenewToken()
117 | }
118 | a.createSavePoint(savePath)
119 | case <-a.Quit:
120 | a.log.Info(
121 | logContext,
122 | "Stopping Allocation Follower",
123 | )
124 | // TODO add a.Stop() here?
125 | //close(a.OutChan) // cannot do until we know there are no more senders on it
126 | return
127 | }
128 | }
129 | }()
130 | return a.OutChan
131 | }
132 |
133 | //Stop stops all followed allocations and exits
134 | func (a *AllocationFollower) Stop() {
135 | a.Quit <- true
136 |
137 | for _, v := range a.Allocations {
138 | v.Stop()
139 | }
140 | }
141 |
142 | func (a *AllocationFollower) createSavePoint(path string) {
143 | logContext := "AllocationFollower.buildSavePoint"
144 | a.log.Debug(logContext, "Building save file from allocations")
145 | savePoint := SavePoint{}
146 | savePoint.NodeID = a.NodeID
147 | savePoint.SaveFormatVersion = SaveFormatVersion
148 | savePoint.SavedAllocs = make(map[string]SavedAlloc, 0)
149 | for allocId, alloc := range a.Allocations {
150 | allocSave := SavedAlloc{}
151 | allocSave.ID = allocId
152 | allocSave.SavedTasks = make(map[string]SavedTask, 0)
153 |
154 | for _, task := range alloc.Tasks {
155 | taskSave := SavedTask{}
156 | taskSave.StdErrOffsets = make(map[string]int64)
157 | taskSave.StdOutOffsets = make(map[string]int64)
158 | taskSave.Key = fmt.Sprintf(
159 | "%s:%s",
160 | task.TaskGroup,
161 | task.Task.Name,
162 | )
163 | taskSave.StdErrOffsets = task.errState.FileOffsets
164 | taskSave.StdOutOffsets = task.outState.FileOffsets
165 | allocSave.SavedTasks[taskSave.Key] = taskSave
166 | }
167 | savePoint.SavedAllocs[allocId] = allocSave
168 | }
169 | data, err := json.Marshal(savePoint)
170 | if err != nil {
171 | a.log.Errorf(
172 | logContext,
173 | "Cannot create save file, JSON marshal err: %s",
174 | err,
175 | )
176 | return
177 | }
178 | err = ioutil.WriteFile(path, data, 0644)
179 | if err != nil {
180 | a.log.Errorf(
181 | logContext,
182 | "Cannot create save file, IO error: %s",
183 | err,
184 | )
185 | return
186 | }
187 | }
188 |
189 | func (a *AllocationFollower) restoreSavePoint(path string) *SavePoint {
190 | logContext := "AllocationFollower.restoreSavePoint"
191 | a.log.Debugf(logContext, "Attempting to restore save file from: %s", path)
192 | savePoint := SavePoint{}
193 | file, err := os.Open(path)
194 | if err != nil {
195 | return nil
196 | }
197 | defer file.Close()
198 | jsonDecoder := json.NewDecoder(file)
199 | err = jsonDecoder.Decode(&savePoint)
200 | if err != nil {
201 | return nil
202 | }
203 | if savePoint.NodeID != a.NodeID {
204 | a.log.Errorf(
205 | logContext,
206 | "Cannot restore save from '%s' NodeID differs.",
207 | path,
208 | )
209 | return nil
210 | }
211 | if savePoint.SaveFormatVersion != SaveFormatVersion {
212 | a.log.Errorf(
213 | logContext,
214 | "Cannot restore save from '%s' version %d != %d",
215 | path,
216 | savePoint.SaveFormatVersion,
217 | SaveFormatVersion,
218 | )
219 | return nil
220 | }
221 | a.log.Infof(
222 | logContext,
223 | "Restored save from file '%s'",
224 | path,
225 | )
226 | return &savePoint
227 | }
228 |
229 | func (a *AllocationFollower) collectAllocations(save *SavePoint) error {
230 | a.log.Debug("AllocationFollower.collectAllocations", "Collecting allocations")
231 | nodeReader := a.Nomad.Client().Nodes()
232 | allocs, _, err := nodeReader.Allocations(a.NodeID, &nomadApi.QueryOptions{})
233 |
234 | if err != nil {
235 | return err
236 | }
237 |
238 | for _, alloc := range allocs {
239 | record := a.Allocations[alloc.ID]
240 | runState := alloc.DesiredStatus == "run" || alloc.ClientStatus == "running"
241 | if record == nil && runState {
242 | // handle new alloc records w/ potentially saved state
243 | falloc := NewFollowedAllocation(alloc, a.Nomad, a.OutChan, a.log, a.logTag)
244 | if save != nil {
245 | a.log.Debug("AllocationFollower.collectAllocations", "Restoring saved allocations")
246 | savedAlloc := save.SavedAllocs[alloc.ID]
247 | falloc.Start(&savedAlloc)
248 | } else {
249 | falloc.Start(nil)
250 | }
251 | a.Allocations[alloc.ID] = falloc
252 | }
253 | }
254 |
255 | for k, fa := range a.Allocations {
256 | if !containsValidAlloc(k, allocs) {
257 | fa.Stop()
258 | delete(a.Allocations, k)
259 | }
260 | }
261 |
262 | return nil
263 | }
264 |
265 | func containsValidAlloc(id string, allocs []*nomadApi.Allocation) bool {
266 | for _, alloc := range allocs {
267 | runState := alloc.DesiredStatus == "run" || alloc.ClientStatus == "running"
268 | if alloc.ID == id && runState {
269 | return true
270 | }
271 | }
272 | return false
273 | }
274 |
--------------------------------------------------------------------------------
/example.nomad:
--------------------------------------------------------------------------------
1 | job "random-logger-example" {
2 | datacenters = ["dc1"]
3 | type = "service"
4 |
5 | group "random" {
6 | count = 1
7 |
8 | task "random-json" {
9 | driver = "docker"
10 | config {
11 | image = "sikwan/random-json-logger:latest"
12 | }
13 | service {
14 | tags = [
15 | "logging",
16 | ]
17 | }
18 | }
19 | task "random-txt" {
20 | driver = "docker"
21 | config {
22 | image = "chentex/random-logger"
23 | }
24 | service {
25 | tags = [
26 | "logging",
27 | ]
28 | }
29 | }
30 |
31 | }
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/followedAllocation.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 |
6 | nomadApi "github.com/hashicorp/nomad/api"
7 | )
8 |
9 | //FollowedAllocation a container for a followed allocations log process
10 | type FollowedAllocation struct {
11 | Alloc *nomadApi.Allocation
12 | Nomad NomadConfig
13 | OutputChan chan string
14 | Quit chan struct{}
15 | Tasks []*FollowedTask
16 | log Logger
17 | logTag string
18 | }
19 |
20 | //NewFollowedAllocation creates a new followed allocation
21 | func NewFollowedAllocation(alloc *nomadApi.Allocation, nomad NomadConfig, outChan chan string, logger Logger, logTag string) *FollowedAllocation {
22 | return &FollowedAllocation{
23 | Alloc: alloc,
24 | Nomad: nomad,
25 | OutputChan: outChan,
26 | Quit: make(chan struct{}),
27 | Tasks: make([]*FollowedTask, 0),
28 | log: logger,
29 | logTag: logTag,
30 | }
31 | }
32 |
33 | //Start starts following an allocation
34 | func (f *FollowedAllocation) Start(save *SavedAlloc) {
35 | f.log.Debugf(
36 | "FollowedAllocation.Start",
37 | "Following Allocation: %s ID: %s",
38 | f.Alloc.Name,
39 | f.Alloc.ID,
40 | )
41 | for _, tg := range f.Alloc.Job.TaskGroups {
42 | for _, task := range tg.Tasks {
43 | ft := NewFollowedTask(f.Alloc, *tg.Name, task, f.Nomad, f.Quit, f.OutputChan, f.log)
44 | skip := true
45 | for _, s := range ft.logTemplate.ServiceTags {
46 | if s == f.logTag {
47 | skip = false
48 | }
49 | }
50 | if !skip {
51 | if save != nil {
52 | f.log.Debug("FollowedAllocation.Start", "Restoring saved allocation data")
53 | key := fmt.Sprintf("%s:%s", *tg.Name, task.Name)
54 | savedTask := save.SavedTasks[key]
55 | ft.Start(&savedTask)
56 | } else {
57 | ft.Start(nil)
58 | }
59 | f.Tasks = append(f.Tasks, ft)
60 | }
61 | }
62 | }
63 | }
64 |
65 | //Stop stops tailing all allocation tasks
66 | func (f *FollowedAllocation) Stop() {
67 | f.log.Debugf(
68 | "FollowedAllocation.Stop",
69 | "Stopping Allocation: %s ID: %s",
70 | f.Alloc.Name,
71 | f.Alloc.ID,
72 | )
73 | close(f.Quit)
74 | }
75 |
--------------------------------------------------------------------------------
/followedTask.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "encoding/json"
5 | "fmt"
6 | "strings"
7 | "time"
8 |
9 | "github.com/dmwilcox/fuzzytime"
10 | nomadApi "github.com/hashicorp/nomad/api"
11 | )
12 |
13 | // INITIAL_OUTPUT_CAP is the slice capacity of the output logs before sent.
14 | var INITIAL_OUTPUT_CAP = 10
15 |
16 | // JSON_DATETIME_FIELDS lists fields searched in a JSON log for a timestamp.
17 | var JSON_DATETIME_FIELDS = []string{"datetime", "timestamp", "time", "date"}
18 |
19 | // MAX_TIMESTAMP_START_POS determines if a log timestamp signals a new multi-line log.
20 | var MAX_TIMESTAMP_START_POS = 6
21 |
22 | // MULTILINE_BUF_CAP is the slice capacity of new buffers to aggregate multi-line logs.
23 | var MULTILINE_BUF_CAP = 10
24 |
25 | // BACKOFF_DELAY rate-limits streaming logs of tasks that error (BACKOFF_DELAY << error-count) seconds
26 | var BACKOFF_DELAY = 8
27 |
28 | // NomadLog annotates task log data with metadata from Nomad about the task
29 | // and allocation. A timestamp is parsed out of the message body and string log
30 | // ouput is preserved under the 'message' field and JSON log output is nested
31 | // under the 'data' field.
32 | type NomadLog struct {
33 | AllocId string `json:"alloc_id"`
34 | JobName string `json:"job_name"`
35 | JobMeta map[string]string `json:"job_meta"`
36 | NodeName string `json:"node_name"`
37 | ServiceName string `json:"service_name"`
38 | ServiceTags []string `json:"service_tags"`
39 | ServiceTagMap map[string]string `json:"service_tag_map"`
40 | TaskMeta map[string]string `json:"task_meta"`
41 | TaskName string `json:"task_name"`
42 | // these all set at log time
43 | Timestamp string `json:"timestamp"`
44 | Message string `json:"message"`
45 | Data map[string]interface{} `json:"data"`
46 | }
47 |
48 | func (n *NomadLog) ToJSON() (string, error) {
49 | result, err := json.Marshal(n)
50 | if err != nil {
51 | return "", err
52 | }
53 | return string(result[:]), nil
54 | }
55 |
56 | //FollowedTask a container for a followed task log process
57 | type FollowedTask struct {
58 | Alloc *nomadApi.Allocation
59 | TaskGroup string
60 | Task *nomadApi.Task
61 | Nomad NomadConfig
62 | Quit chan struct{}
63 | OutputChan chan string
64 | log Logger
65 | logTemplate NomadLog
66 | errState StreamState
67 | outState StreamState
68 | }
69 |
70 | //NewFollowedTask creates a new followed task
71 | func NewFollowedTask(alloc *nomadApi.Allocation, taskGroup string, task *nomadApi.Task, nomad NomadConfig, quit chan struct{}, output chan string, logger Logger) *FollowedTask {
72 | logTemplate := createLogTemplate(alloc, task)
73 | return &FollowedTask{
74 | Alloc: alloc,
75 | TaskGroup: taskGroup,
76 | Task: task,
77 | Nomad: nomad,
78 | Quit: quit,
79 | OutputChan: output,
80 | log: logger,
81 | logTemplate: logTemplate,
82 | }
83 | }
84 |
85 | type StreamState struct {
86 | MultiLineBuf []string
87 | LastTimestamp string
88 | ConsecErrors uint
89 | FileOffsets map[string]int64
90 | // internal use only
91 | initialBufferCap int
92 | quit chan struct{}
93 | allocFS *nomadApi.AllocFS
94 | }
95 |
96 | func (s *StreamState) BufAdd(msg string) {
97 | s.MultiLineBuf = append(s.MultiLineBuf, msg)
98 | }
99 |
100 | func (s *StreamState) BufReset() {
101 | s.MultiLineBuf = make([]string, 0, s.initialBufferCap)
102 | }
103 |
104 | func (s *StreamState) SetOffsets(offsets map[string]int64) {
105 | if offsets != nil {
106 | s.FileOffsets = offsets
107 | } else {
108 | s.FileOffsets = make(map[string]int64)
109 | }
110 | }
111 |
112 | // GetOffset returns the current total log stream offset.
113 | func (s *StreamState) GetOffset() int64 {
114 | var offset int64
115 | offset = 0
116 | // sum the byte offsets for all of the file streams
117 | for _, o := range s.FileOffsets {
118 | offset += o
119 | }
120 | return offset
121 | }
122 |
123 | func (s *StreamState) Start(alloc *nomadApi.Allocation, task, logType string) (<-chan *nomadApi.StreamFrame, <-chan error) {
124 | return s.allocFS.Logs(alloc, true, task, logType, "start", s.GetOffset(), s.quit, &nomadApi.QueryOptions{})
125 | }
126 |
127 | func NewStreamState(allocFS *nomadApi.AllocFS, quit chan struct{}, initialBufferCap int) StreamState {
128 | s := StreamState{}
129 | s.initialBufferCap = initialBufferCap
130 | s.quit = quit
131 | s.allocFS = allocFS
132 | s.MultiLineBuf = make([]string, 0, initialBufferCap)
133 | s.FileOffsets = make(map[string]int64)
134 | return s
135 | }
136 |
137 | // SpeculativeOffset returns the total log stream offset if file had a given offset.
138 | // Function exists primarily for debugging purposes.
139 | func SpeculativeOffset(state StreamState, file string, offset int64) int64 {
140 | var speculativeOffset int64
141 | speculativeOffset = offset
142 | for f, o := range state.FileOffsets {
143 | if f == file {
144 | continue
145 | }
146 | speculativeOffset += o
147 | }
148 | return speculativeOffset
149 | }
150 |
151 | // CalculateOffset returns the total log stream offset based on given message size.
152 | // Function exists primarily for debugging purposes.
153 | func CalculateOffset(state StreamState, file string, size int64) int64 {
154 | var calculatedOffset int64
155 | calculatedOffset = 0
156 | for f, o := range state.FileOffsets {
157 | if f == file {
158 | calculatedOffset += o + size
159 | continue
160 | }
161 | calculatedOffset += o
162 | }
163 | return calculatedOffset
164 | }
165 |
166 | //Start starts following a task for an allocation
167 | func (ft *FollowedTask) Start(save *SavedTask) {
168 | //config := nomadApi.DefaultConfig()
169 | //config.WaitTime = 5 * time.Minute
170 | //client, err := nomadApi.NewClient(config)
171 | //if err != nil {
172 | //ft.ErrorChan <- fmt.Sprintf("{ \"message\":\"%s\"}", err)
173 | //}
174 | //fs := client.AllocFS()
175 |
176 | logContext := "FollowedTask.Start"
177 | fs := ft.Nomad.Client().AllocFS()
178 | ft.outState = NewStreamState(fs, ft.Quit, MULTILINE_BUF_CAP)
179 | ft.errState = NewStreamState(fs, ft.Quit, MULTILINE_BUF_CAP)
180 | if save != nil {
181 | ft.log.Debugf(logContext, "Restoring log offsets for %s", ft.Task.Name)
182 | ft.outState.SetOffsets(save.StdOutOffsets)
183 | ft.errState.SetOffsets(save.StdErrOffsets)
184 | ft.log.Debugf(logContext, "Set StdOut Offsets to %#v", ft.outState.FileOffsets)
185 | ft.log.Debugf(logContext, "Set StdErr Offsets to %#v", ft.errState.FileOffsets)
186 | }
187 | stdOutCh, stdOutErr := ft.outState.Start(ft.Alloc, ft.Task.Name, "stdout")
188 | stdErrCh, stdErrErr := ft.errState.Start(ft.Alloc, ft.Task.Name, "stderr")
189 |
190 | go func() {
191 | var messages []string
192 | for {
193 | // TODO need some max possible sleep duration
194 | // Keeps dead allocs from crash looping (until 403/404 error differentiated)
195 | if ft.outState.ConsecErrors > 0 || ft.errState.ConsecErrors > 0 {
196 | delay := BACKOFF_DELAY << (ft.outState.ConsecErrors + ft.errState.ConsecErrors)
197 | ft.log.Debugf(
198 | logContext,
199 | "Inserting delay of %ds for alloc: %s task: %s",
200 | delay,
201 | ft.Alloc.ID,
202 | ft.Task.Name,
203 | )
204 | time.Sleep(time.Duration(delay) * time.Second)
205 | }
206 |
207 | select {
208 | case _, ok := <-ft.Quit:
209 | // TODO handle quit case gracefully, flush buffer to out chan
210 | if !ok {
211 | return
212 | }
213 | case stdErrFrame, stdErrOk := <-stdErrCh:
214 | if stdErrOk {
215 | messages, ft.errState = ft.processFrame(stdErrFrame, ft.errState)
216 | for _, message := range messages {
217 | ft.OutputChan <- message
218 | }
219 | // TODO handle log file deletion + truncation events
220 | ft.log.Tracef(
221 | logContext,
222 | "StdErr Data size: %d Offsets Prior Total: %d Calculated: %d Reported: %d",
223 | len(stdErrFrame.Data),
224 | ft.errState.GetOffset(),
225 | CalculateOffset(ft.errState, stdErrFrame.File, int64(len(stdErrFrame.Data))),
226 | SpeculativeOffset(ft.errState, stdErrFrame.File, stdErrFrame.Offset),
227 | )
228 | // using reported offsets can lead to gaps when restoring a savepoint
229 | ft.errState.FileOffsets[stdErrFrame.File] += int64(len(stdErrFrame.Data))
230 | ft.errState.ConsecErrors = 0
231 | ft.outState.ConsecErrors = 0
232 | } else {
233 | stdErrCh, stdErrErr = ft.errState.Start(ft.Alloc, ft.Task.Name, "stderr")
234 | ft.errState.ConsecErrors += 1
235 | }
236 |
237 | case stdOutFrame, stdOutOk := <-stdOutCh:
238 | if stdOutOk {
239 | messages, ft.outState = ft.processFrame(stdOutFrame, ft.outState)
240 | for _, message := range messages {
241 | ft.OutputChan <- message
242 | }
243 | // TODO handle log file deletion + truncation events
244 | ft.log.Tracef(
245 | logContext,
246 | "StdOut Data size: %d Offsets Prior Total: %d Calculated: %d Reported: %d",
247 | len(stdOutFrame.Data),
248 | ft.outState.GetOffset(),
249 | CalculateOffset(ft.outState, stdOutFrame.File, int64(len(stdOutFrame.Data))),
250 | SpeculativeOffset(ft.outState, stdOutFrame.File, stdOutFrame.Offset),
251 | )
252 | // using reported offsets can lead to gaps when restoring a savepoint
253 | ft.outState.FileOffsets[stdOutFrame.File] += int64(len(stdOutFrame.Data))
254 | ft.outState.ConsecErrors = 0
255 | ft.errState.ConsecErrors = 0
256 | } else {
257 | stdOutCh, stdOutErr = ft.outState.Start(ft.Alloc, ft.Task.Name, "stdout")
258 | ft.outState.ConsecErrors += 1
259 | }
260 |
261 | case errErr := <-stdErrErr:
262 | ft.log.Debugf(
263 | logContext,
264 | "Error following stderr alloc: %s task: %s error: %s",
265 | ft.Alloc.ID,
266 | ft.Task.Name,
267 | errErr,
268 | )
269 | // TODO handle 403 case separately from 404 case
270 | // Handle task starting while client has invalid token
271 | ft.Nomad.RenewToken()
272 | stdErrCh, stdErrErr = ft.errState.Start(ft.Alloc, ft.Task.Name, "stderr")
273 | ft.errState.ConsecErrors += 1
274 |
275 | case outErr := <-stdOutErr:
276 | ft.log.Debugf(
277 | logContext,
278 | "Error following stdout alloc: %s task: %s error: %s",
279 | ft.Alloc.ID,
280 | ft.Task.Name,
281 | outErr,
282 | )
283 | // TODO handle 403 case separately from 404 case
284 | // Handle task starting while client has invalid token
285 | ft.Nomad.RenewToken()
286 | stdOutCh, stdOutErr = ft.outState.Start(ft.Alloc, ft.Task.Name, "stdout")
287 | ft.outState.ConsecErrors += 1
288 | }
289 | }
290 | }()
291 | }
292 |
293 | func createLogTemplate(alloc *nomadApi.Allocation, task *nomadApi.Task) NomadLog {
294 | tmpl := NomadLog{}
295 | service := nomadApi.Service{}
296 |
297 | tmpl.AllocId = alloc.ID
298 | tmpl.JobName = *alloc.Job.Name
299 | tmpl.JobMeta = alloc.Job.Meta
300 | tmpl.NodeName = alloc.NodeName
301 | tmpl.ServiceTags = make([]string, 0)
302 | tmpl.ServiceTagMap = make(map[string]string)
303 | if len(task.Services) > 0 {
304 | // shouldn't have more than one service per task
305 | service = *task.Services[0]
306 | tmpl.ServiceName = service.Name
307 | tmpl.ServiceTags = service.Tags
308 | tmpl.ServiceTagMap = getServiceTagMap(service)
309 | tmpl.TaskMeta = task.Meta
310 | } else {
311 | for _, tg := range alloc.Job.TaskGroups {
312 | if len(tg.Services) == 0 {
313 | continue
314 | }
315 | for _, t := range tg.Tasks {
316 | if t.Name == task.Name {
317 | service = *tg.Services[0]
318 | tmpl.ServiceName = service.Name
319 | tmpl.ServiceTags = service.Tags
320 | tmpl.ServiceTagMap = getServiceTagMap(service)
321 | tmpl.TaskMeta = t.Meta
322 | }
323 | }
324 | }
325 | }
326 | tmpl.TaskName = task.Name
327 | tmpl.Data = make(map[string]interface{})
328 | return tmpl
329 | }
330 |
331 | func getServiceTagMap(service nomadApi.Service) map[string]string {
332 | var serviceTagMap = make(map[string]string)
333 |
334 | for _, t := range service.Tags {
335 | parts := strings.SplitN(t, "=", 2)
336 | if len(parts) == 2 {
337 | key := parts[0]
338 | val := parts[1]
339 | serviceTagMap[key] = val
340 | }
341 | }
342 | return serviceTagMap
343 | }
344 |
345 | // processFrame takes a frame and determines if each line is JSON, or a single or multi-line log.
346 | //
347 | // Requirements of operation:
348 | // - JSON logs must be on a single line to be properly parsed aka newlines escaped if included
349 | // - String logs must contain a datetime as close to the beginning of the line as possible
350 | // - Multi-line string logs should not contain datetimes near the beginning of the string
351 | // to be grouped properly
352 | //
353 | // Pseudo code for multi-line string logs:
354 | // if has a timestamp
355 | // if multiline buf is empty
356 | // add to multiline buf + continue
357 | // else
358 | // flush multiline buf as json
359 | // add to multiline buf + continue
360 | // else
361 | // if multiline buf is empty
362 | // add frag header + line to multiline buf + continue
363 | // else
364 | // add line to multiline buf + continue
365 | // Note: last timestamp and multiline buffer must be passed to and received from the calling
366 | // function to properly mark timestamps and group logs between calls.
367 | func (ft *FollowedTask) processFrame(frame *nomadApi.StreamFrame, streamState StreamState) ([]string, StreamState) {
368 | logContext := "FollowedTask.processFrame"
369 | messages := strings.Split(string(frame.Data[:]), "\n")
370 | jsons := make([]string, 0, INITIAL_OUTPUT_CAP)
371 | for _, message := range messages {
372 | if message == "" || message == "\n" {
373 | continue
374 | }
375 | if isJSON(message) {
376 | ft.log.Tracef(
377 | logContext,
378 | "Found single-line json log: %s",
379 | message,
380 | )
381 | // no multi-line buffering for valid single-line json
382 | l := wrapJsonLog(ft.logTemplate, message)
383 | s, err := l.ToJSON()
384 | if err != nil {
385 | ft.log.DeadLetterf(
386 | logContext,
387 | l,
388 | "Error building log message JSON Error: %v",
389 | err,
390 | )
391 | } else {
392 | jsons = append(jsons, s)
393 | }
394 | } else {
395 | timestamp := findTimestamp(message)
396 | if timestamp != "" {
397 | ft.log.Tracef(
398 | logContext,
399 | "Found message with timestamp: %s, msg: %s",
400 | timestamp,
401 | message,
402 | )
403 | if len(streamState.MultiLineBuf) == 0 {
404 | ft.log.Tracef(
405 | logContext,
406 | "Beginning multiline, msg: %s",
407 | message,
408 | )
409 | streamState.BufAdd(message)
410 | } else {
411 | // flush multiline buf + start over
412 | ft.log.Tracef(
413 | logContext,
414 | "Flushing multiline:\n%s\n, new multiline: %s\n",
415 | streamState.MultiLineBuf,
416 | message,
417 | )
418 | l := createJsonLog(ft.logTemplate, streamState.MultiLineBuf, streamState.LastTimestamp)
419 | s, err := l.ToJSON()
420 | if err != nil {
421 | ft.log.DeadLetterf(
422 | logContext,
423 | l,
424 | "Error building json log message: %v",
425 | err,
426 | )
427 | } else {
428 | jsons = append(jsons, s)
429 | }
430 | streamState.BufReset()
431 | streamState.BufAdd(message)
432 | }
433 | // don't update until prior multi-line flush uses it
434 | streamState.LastTimestamp = timestamp
435 | } else {
436 | if len(streamState.MultiLineBuf) == 0 {
437 | // log fragment -- bad parsing?
438 | ft.log.Tracef(
439 | logContext,
440 | "Log fragment case, msg: %s",
441 | message,
442 | )
443 | header := createFragmentHeader(streamState.LastTimestamp)
444 | streamState.BufAdd(header)
445 | streamState.BufAdd(message)
446 | } else {
447 | ft.log.Tracef(
448 | logContext,
449 | "Appending to existing multiline, msg: %s",
450 | message,
451 | )
452 | streamState.BufAdd(message)
453 | }
454 | }
455 | }
456 | }
457 | return jsons, streamState
458 | }
459 |
460 | func isJSON(s string) bool {
461 | var js map[string]interface{}
462 | return json.Unmarshal([]byte(s), &js) == nil
463 | }
464 |
465 | func getJSONMessage(s string) map[string]interface{} {
466 | var js map[string]interface{}
467 | json.Unmarshal([]byte(s), &js)
468 |
469 | return js
470 | }
471 |
472 | func createFragmentHeader(timestamp string) string {
473 | return fmt.Sprintf("%s Log Fragment Header")
474 | }
475 |
476 | func wrapJsonLog(logTmpl NomadLog, line string) NomadLog {
477 | data := getJSONMessage(line)
478 | timestamp := findJsonTimestamp(data)
479 | logTmpl.Data = data
480 | logTmpl.Timestamp = timestamp
481 | return logTmpl
482 | }
483 |
484 | func createJsonLog(logTmpl NomadLog, lines []string, timestamp string) NomadLog {
485 | logTmpl.Message = strings.Join(lines, "\n")
486 | logTmpl.Timestamp = timestamp
487 | return logTmpl
488 | }
489 |
490 | // findJsonTimestamp looks at top level keys in a json log to find a timestamp.
491 | //
492 | // Returns the first parse-able timestamp in the list of JSON_DATETIME_FIELDS
493 | // searched.
494 | func findJsonTimestamp(data map[string]interface{}) string {
495 | for _, field := range JSON_DATETIME_FIELDS {
496 | value, ok := data[field]
497 | if ok {
498 | s, ok := value.(string)
499 | if !ok {
500 | continue
501 | }
502 | t, _, err := fuzzytime.Extract(s)
503 | if err != nil {
504 | return ""
505 | }
506 | if t.ISOFormat() != "" {
507 | return t.ISOFormat()
508 | }
509 | }
510 | }
511 | return ""
512 | }
513 |
514 | // findTimestamp determines if a string starts with a timestamp, and returns it.
515 | func findTimestamp(line string) string {
516 | var maxStartPos = MAX_TIMESTAMP_START_POS
517 | t, spans, err := fuzzytime.Extract(line)
518 | if err != nil {
519 | return ""
520 | }
521 | // Add guard to ensure date + time are within X distance
522 | // e.g. if spans == 2 distance between span[0].end and span[1]
523 | // begin cannot be more than X
524 | if len(spans) > 0 {
525 | // Line does not start with timestamp, doesn't count
526 | if spans[0].Begin > maxStartPos {
527 | return ""
528 | }
529 | }
530 | return t.ISOFormat()
531 | }
532 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/sas1024/nomad_follower
2 |
3 | go 1.14
4 |
5 | require (
6 | github.com/dmwilcox/fuzzytime v0.0.0-20191010161914-05ea0010feac
7 | github.com/docker/go-units v0.4.0 // indirect
8 | github.com/go-ldap/ldap v3.0.2+incompatible // indirect
9 | github.com/golang/snappy v0.0.4 // indirect
10 | github.com/gorilla/websocket v1.4.2 // indirect
11 | github.com/hashicorp/cronexpr v1.1.1 // indirect
12 | github.com/hashicorp/errwrap v1.1.0 // indirect
13 | github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
14 | github.com/hashicorp/go-multierror v1.1.1 // indirect
15 | github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
16 | github.com/hashicorp/nomad/api v0.0.0-20210702122822-4e9ed5f8827c
17 | github.com/hashicorp/vault/api v1.1.0
18 | github.com/hashicorp/vault/sdk v0.2.0 // indirect
19 | github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
20 | github.com/kr/pretty v0.2.1 // indirect
21 | github.com/mitchellh/go-testing-interface v1.14.1 // indirect
22 | github.com/mitchellh/mapstructure v1.4.1
23 | github.com/pierrec/lz4 v2.6.1+incompatible // indirect
24 | github.com/stretchr/testify v1.6.1 // indirect
25 | golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
26 | golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
27 | golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
28 | gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
29 | gopkg.in/natefinch/lumberjack.v2 v2.0.0
30 | gopkg.in/square/go-jose.v2 v2.6.0 // indirect
31 | gopkg.in/yaml.v2 v2.3.0 // indirect
32 | )
33 |
--------------------------------------------------------------------------------
/go.sum:
--------------------------------------------------------------------------------
1 | bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
2 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
3 | github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
4 | github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
5 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
6 | github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
7 | github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=
8 | github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8=
9 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
10 | github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
11 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
12 | github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
13 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I=
14 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
15 | github.com/armon/go-metrics v0.3.0/go.mod h1:zXjbSimjXTd7vOpY8B0/2LpvNvDoXBuplAD+gJD3GYs=
16 | github.com/armon/go-metrics v0.3.3/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
17 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
18 | github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
19 | github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
20 | github.com/aws/aws-sdk-go v1.30.27/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
21 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
22 | github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
23 | github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
24 | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
25 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
26 | github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
27 | github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
28 | github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
29 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
30 | github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
31 | github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
32 | github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
33 | github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
34 | github.com/containerd/containerd v1.3.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
35 | github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
36 | github.com/containerd/continuity v0.0.0-20200709052629-daa8e1ccc0bc/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo=
37 | github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
38 | github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0=
39 | github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o=
40 | github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=
41 | github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
42 | github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
43 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
44 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
45 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
46 | github.com/dmwilcox/fuzzytime v0.0.0-20191010161914-05ea0010feac h1:TenyRmfQ/UAdE6OHtFxPHyc1bQwHfg8nBdc/VfXDbLQ=
47 | github.com/dmwilcox/fuzzytime v0.0.0-20191010161914-05ea0010feac/go.mod h1:fUUPWDEEtZ74jLp6Z5D4VpZyD7xrnklYnP/lCUn1Mzg=
48 | github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
49 | github.com/docker/docker v1.4.2-0.20200319182547-c7ad2b866182/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
50 | github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
51 | github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
52 | github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
53 | github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
54 | github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
55 | github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
56 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
57 | github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
58 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
59 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
60 | github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
61 | github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y=
62 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
63 | github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
64 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
65 | github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
66 | github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc=
67 | github.com/go-ldap/ldap/v3 v3.1.3/go.mod h1:3rbOH3jRS2u6jg2rJnKAMLE/xQyCKIveG2Sa/Cohzb8=
68 | github.com/go-ldap/ldap/v3 v3.1.10/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q=
69 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
70 | github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
71 | github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
72 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
73 | github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
74 | github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
75 | github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
76 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
77 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
78 | github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
79 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
80 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
81 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
82 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
83 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
84 | github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
85 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
86 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
87 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
88 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
89 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
90 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
91 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
92 | github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
93 | github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
94 | github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
95 | github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
96 | github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
97 | github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
98 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
99 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
100 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
101 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
102 | github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
103 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
104 | github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
105 | github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
106 | github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
107 | github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
108 | github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
109 | github.com/hashicorp/cronexpr v1.1.0 h1:dnNsWtH0V2ReN7JccYe8m//Bj14+PjJDntR1dz0Cixk=
110 | github.com/hashicorp/cronexpr v1.1.0/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4=
111 | github.com/hashicorp/cronexpr v1.1.1 h1:NJZDd87hGXjoZBdvyCF9mX4DCq5Wy7+A/w+A7q0wn6c=
112 | github.com/hashicorp/cronexpr v1.1.1/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4=
113 | github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
114 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
115 | github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
116 | github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
117 | github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
118 | github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM=
119 | github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
120 | github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
121 | github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
122 | github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI=
123 | github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
124 | github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
125 | github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
126 | github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
127 | github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0=
128 | github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
129 | github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
130 | github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g=
131 | github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
132 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
133 | github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI=
134 | github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
135 | github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
136 | github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
137 | github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY=
138 | github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
139 | github.com/hashicorp/go-retryablehttp v0.5.4 h1:1BZvpawXoJCWX6pNtow9+rpEj+3itIlutiqnntI6jOE=
140 | github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
141 | github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY=
142 | github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
143 | github.com/hashicorp/go-retryablehttp v0.6.8 h1:92lWxgpa+fF3FozM4B3UZtHZMJX8T5XT+TFdCxsPyWs=
144 | github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
145 | github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4=
146 | github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
147 | github.com/hashicorp/go-rootcerts v1.0.1 h1:DMo4fmknnz0E0evoNYnV48RjWndOsmd6OW+09R3cEP8=
148 | github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
149 | github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=
150 | github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
151 | github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc=
152 | github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
153 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
154 | github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
155 | github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
156 | github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0=
157 | github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
158 | github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
159 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
160 | github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
161 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
162 | github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
163 | github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
164 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
165 | github.com/hashicorp/nomad/api v0.0.0-20201116174134-7a6db5f4836c h1:rOrft1/La/JrAcx71y/Svwa/1sS/RjOriIwtwgF4Bt8=
166 | github.com/hashicorp/nomad/api v0.0.0-20201116174134-7a6db5f4836c/go.mod h1:vYHP9jMXk4/T2qNUbWlQ1OHCA1hHLil3nvqSmz8mtgc=
167 | github.com/hashicorp/nomad/api v0.0.0-20210304195022-6920d6774650 h1:+NcbsMXTqgB+YjoS7QPxg4Zl6uhuVKAByzc3AcH3DpM=
168 | github.com/hashicorp/nomad/api v0.0.0-20210304195022-6920d6774650/go.mod h1:vYHP9jMXk4/T2qNUbWlQ1OHCA1hHLil3nvqSmz8mtgc=
169 | github.com/hashicorp/nomad/api v0.0.0-20210702122822-4e9ed5f8827c h1:43tCQxYn4ErGf3laSVu8vcNTMU4eD4y87AY5EJfNxe4=
170 | github.com/hashicorp/nomad/api v0.0.0-20210702122822-4e9ed5f8827c/go.mod h1:vYHP9jMXk4/T2qNUbWlQ1OHCA1hHLil3nvqSmz8mtgc=
171 | github.com/hashicorp/vault/api v1.0.4 h1:j08Or/wryXT4AcHj1oCbMd7IijXcKzYUGw59LGu9onU=
172 | github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q=
173 | github.com/hashicorp/vault/api v1.0.5-0.20200519221902-385fac77e20f/go.mod h1:euTFbi2YJgwcju3imEt919lhJKF68nN1cQPq3aA+kBE=
174 | github.com/hashicorp/vault/api v1.1.0 h1:QcxC7FuqEl0sZaIjcXB/kNEeBa0DH5z57qbWBvZwLC4=
175 | github.com/hashicorp/vault/api v1.1.0/go.mod h1:R3Umvhlxi2TN7Ex2hzOowyeNb+SfbVWI973N+ctaFMk=
176 | github.com/hashicorp/vault/sdk v0.1.13 h1:mOEPeOhT7jl0J4AMl1E705+BcmeRs1VmKNb9F0sMLy8=
177 | github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M=
178 | github.com/hashicorp/vault/sdk v0.1.14-0.20200519221530-14615acda45f/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10=
179 | github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267/go.mod h1:WX57W2PwkrOPQ6rVQk+dy5/htHIaB4aBM70EwKThu10=
180 | github.com/hashicorp/vault/sdk v0.2.0 h1:hvVswvMA9LvXwLBFDJLIoDBXi8hj90Q+gSS7vRYmLvQ=
181 | github.com/hashicorp/vault/sdk v0.2.0/go.mod h1:cAGI4nVnEfAyMeqt9oB+Mase8DNn3qA/LDNHURiwssY=
182 | github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
183 | github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
184 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
185 | github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
186 | github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
187 | github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
188 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
189 | github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
190 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
191 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
192 | github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
193 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
194 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
195 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
196 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
197 | github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
198 | github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
199 | github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
200 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
201 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
202 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
203 | github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
204 | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
205 | github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
206 | github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
207 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
208 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
209 | github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
210 | github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
211 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
212 | github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
213 | github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
214 | github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
215 | github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
216 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
217 | github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
218 | github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
219 | github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
220 | github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
221 | github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
222 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
223 | github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
224 | github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
225 | github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
226 | github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag=
227 | github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
228 | github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY=
229 | github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
230 | github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
231 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
232 | github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
233 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
234 | github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
235 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
236 | github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
237 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
238 | github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
239 | github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
240 | github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
241 | github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
242 | github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
243 | github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
244 | github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
245 | github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
246 | github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
247 | github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
248 | github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
249 | github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I=
250 | github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
251 | github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
252 | github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A=
253 | github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
254 | github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
255 | github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
256 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
257 | github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
258 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
259 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
260 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
261 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
262 | github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
263 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
264 | github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
265 | github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
266 | github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
267 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
268 | github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
269 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
270 | github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
271 | github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
272 | github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
273 | github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
274 | github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
275 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
276 | github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
277 | github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
278 | github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
279 | github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
280 | github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
281 | github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
282 | github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
283 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
284 | github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
285 | github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
286 | github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
287 | github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
288 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
289 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
290 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
291 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
292 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
293 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
294 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
295 | github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
296 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
297 | github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
298 | github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
299 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
300 | golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
301 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
302 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
303 | golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
304 | golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392 h1:ACG4HJsFiNMf47Y4PeRoebLNy/2lXT9EtprMuTFWt1M=
305 | golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
306 | golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
307 | golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g=
308 | golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
309 | golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI=
310 | golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
311 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
312 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
313 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
314 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
315 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
316 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
317 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
318 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
319 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
320 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
321 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
322 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
323 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
324 | golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
325 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
326 | golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
327 | golang.org/x/net v0.0.0-20190923162816-aa69164e4478 h1:l5EDrHhldLYb3ZRHDUhXF7Om7MvYXnkV9/iQNo1lX6g=
328 | golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
329 | golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
330 | golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
331 | golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
332 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
333 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
334 | golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
335 | golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
336 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
337 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
338 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
339 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
340 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
341 | golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
342 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
343 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
344 | golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
345 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
346 | golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
347 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
348 | golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
349 | golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
350 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
351 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
352 | golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
353 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
354 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
355 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
356 | golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
357 | golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
358 | golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
359 | golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
360 | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
361 | golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
362 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
363 | golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
364 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
365 | golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
366 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
367 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
368 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
369 | golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
370 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
371 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
372 | golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
373 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
374 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
375 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
376 | golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
377 | golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
378 | golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
379 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
380 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
381 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
382 | golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
383 | golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE=
384 | golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
385 | golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 h1:Vv0JUPWTyeqUq42B2WJ1FeIDjjvGKoA2Ss+Ts0lAVbs=
386 | golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
387 | golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
388 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
389 | golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
390 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
391 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
392 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
393 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
394 | golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
395 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
396 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
397 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
398 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
399 | google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
400 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
401 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
402 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
403 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
404 | google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
405 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
406 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
407 | google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
408 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
409 | google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
410 | google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
411 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
412 | google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
413 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
414 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
415 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
416 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
417 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
418 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
419 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
420 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
421 | google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
422 | gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
423 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
424 | gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
425 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
426 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
427 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
428 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
429 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
430 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
431 | gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
432 | gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3 h1:AFxeG48hTWHhDTQDk/m2gorfVHUEa9vo3tp3D7TzwjI=
433 | gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
434 | gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
435 | gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
436 | gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4=
437 | gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
438 | gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w=
439 | gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
440 | gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI=
441 | gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
442 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
443 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
444 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
445 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
446 | gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
447 | gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
448 | gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
449 | gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
450 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
451 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
452 | gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
453 | gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
454 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
455 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
456 |
--------------------------------------------------------------------------------
/logger.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "encoding/json"
5 | "fmt"
6 | "time"
7 |
8 | "github.com/mitchellh/mapstructure"
9 | )
10 |
11 | const RFC3339Milli = "2006-01-02T15:04:05.000Z07:00"
12 |
13 | // LogLevel provides compariable levels and a string representation.
14 | type LogLevel int
15 | const (
16 | _ LogLevel = iota * 10
17 | TRACE
18 | DEBUG
19 | INFO
20 | ERROR
21 | DEADLETTER
22 | )
23 |
24 | // String formats LogLevels as a string for readability.
25 | func (l LogLevel) String() string {
26 | var values = make(map[LogLevel]string)
27 | values[TRACE] = "trace"
28 | values[DEBUG] = "debug"
29 | values[INFO] = "info"
30 | values[ERROR] = "error"
31 | values[DEADLETTER] = "deadletter"
32 |
33 | s, ok := values[l]
34 | if !ok {
35 | return "unknown"
36 | }
37 | return s
38 | }
39 |
40 | func (l LogLevel) MarshalJSON() ([]byte, error) {
41 | return []byte(`"` + l.String() + `"`), nil
42 | }
43 |
44 | // FollowerLog structures log output from Nomad Follower and dead letters.
45 | type FollowerLog struct {
46 | Name string `json:"name"`
47 | Message string `json:"message"`
48 | Datetime string `json:"datetime"`
49 | Level LogLevel `json:"log_level,string"`
50 | Data map[string]interface{} `json:"data"`
51 | }
52 |
53 | func (f FollowerLog) String() string {
54 | // function to handle retries
55 | marshal := func(l FollowerLog) ([]byte, error) {
56 | return json.Marshal(l)
57 | }
58 | s, err := marshal(f)
59 | if err != nil {
60 | // error likely with data map
61 | retryMsg := fmt.Sprintf(
62 | "Original Msg: '%s' Original Level: '%s' Original Data: '%#v'",
63 | f.Message,
64 | f.Level,
65 | f.Data,
66 | )
67 | retryLog := NewFollowerLog(
68 | fmt.Sprintf("DeadLetter.%s", f.Name),
69 | retryMsg,
70 | DEADLETTER,
71 | nil,
72 | )
73 | s, err = marshal(retryLog)
74 | if err != nil {
75 | // should really never get here
76 | panic("Unparsable dead letter")
77 | }
78 | }
79 | return string(s)
80 | }
81 |
82 | // NewFollowerLog creates a new FollowerLog and attempts to recover dead letters.
83 | func NewFollowerLog(name, message string, level LogLevel, data map[string]interface{}) FollowerLog {
84 | now := time.Now()
85 | datetime := now.Format(RFC3339Milli)
86 | l := FollowerLog{}
87 | l.Name = name
88 | l.Message = message
89 | l.Level = level
90 | l.Data = data
91 | l.Datetime = datetime
92 | return l
93 | }
94 |
95 | func NewDeadLetter(name, message string, rawLog NomadLog) FollowerLog {
96 | data := make(map[string]interface{})
97 | // TODO determine what to do if err occurs here
98 | _ = mapstructure.Decode(rawLog, &data)
99 | return NewFollowerLog(name, message, DEADLETTER, data)
100 | }
101 |
102 | // Logger acts as a single config point for emitting FollowerLogs as JSON.
103 | type Logger struct {
104 | verbosity LogLevel
105 | }
106 |
107 | func (l Logger) logAtLevel(name string, level LogLevel, message string) {
108 | n := NewFollowerLog(
109 | name,
110 | message,
111 | level,
112 | make(map[string]interface{}),
113 | )
114 | if level >= l.verbosity {
115 | fmt.Println(n)
116 | }
117 | }
118 |
119 | func (l Logger) logFormatAtLevel(name string, level LogLevel, message string, f ...interface{}) {
120 | msg := fmt.Sprintf(message, f...)
121 | l.logAtLevel(name, level, msg)
122 | }
123 |
124 | func (l Logger) Trace(name, message string) {
125 | l.logAtLevel(name, TRACE, message)
126 | }
127 |
128 | func (l Logger) Tracef(name, message string, f ...interface{}) {
129 | l.logFormatAtLevel(name, TRACE, message, f...)
130 | }
131 |
132 | func (l Logger) Debug(name, message string) {
133 | l.logAtLevel(name, DEBUG, message)
134 | }
135 |
136 | func (l Logger) Debugf(name, message string, f ...interface{}) {
137 | l.logFormatAtLevel(name, DEBUG, message, f...)
138 | }
139 |
140 | func (l Logger) Info(name, message string) {
141 | l.logAtLevel(name, INFO, message)
142 | }
143 |
144 | func (l Logger) Infof(name, message string, f ...interface{}) {
145 | l.logFormatAtLevel(name, INFO, message, f...)
146 | }
147 |
148 | func (l Logger) Error(name, message string) {
149 | l.logAtLevel(name, ERROR, message)
150 | }
151 |
152 | func (l Logger) Errorf(name, message string, f ...interface{}) {
153 | l.logFormatAtLevel(name, ERROR, message, f...)
154 | }
155 |
156 | func (l Logger) DeadLetter(name string, rawLog NomadLog, message string) {
157 | n := NewDeadLetter(
158 | name,
159 | message,
160 | rawLog,
161 | )
162 | fmt.Println(n)
163 | }
164 |
165 | func (l Logger) DeadLetterf(name string, rawLog NomadLog, message string, f ...interface{}) {
166 | msg := fmt.Sprintf(message, f...)
167 | n := NewDeadLetter(
168 | name,
169 | msg,
170 | rawLog,
171 | )
172 | fmt.Println(n)
173 | }
174 |
--------------------------------------------------------------------------------
/nomad_follower.nomad:
--------------------------------------------------------------------------------
1 | job "log-shipping" {
2 | datacenters = ["dc1"]
3 | type = "system"
4 | namespace = "logs"
5 | update {
6 | max_parallel = 1
7 | min_healthy_time = "10s"
8 | healthy_deadline = "3m"
9 | progress_deadline = "10m"
10 | auto_revert = false
11 | }
12 |
13 | group "log-shipping" {
14 | count = 1
15 |
16 | network {
17 | port "promtail-healthcheck" {
18 | to = 3000
19 | }
20 | }
21 |
22 | restart {
23 | attempts = 2
24 | interval = "30m"
25 | delay = "15s"
26 | mode = "fail"
27 | }
28 |
29 | ephemeral_disk {
30 | size = 300
31 | }
32 |
33 |
34 | task "nomad-forwarder" {
35 | driver = "docker"
36 |
37 | env {
38 | VERBOSE = 4
39 | LOG_TAG = "logging"
40 | LOG_FILE = "${NOMAD_ALLOC_DIR}/nomad-logs.log"
41 | NOMAD_ADDR = "http://172.17.0.1:4646"
42 | }
43 |
44 | config {
45 | image = "sofixa/nomad_follower:latest"
46 | }
47 |
48 | resources {
49 | cpu = 100
50 | memory = 512
51 | }
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/service.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "log"
5 | "os"
6 | "strconv"
7 | "time"
8 |
9 | nomadApi "github.com/hashicorp/nomad/api"
10 | "gopkg.in/natefinch/lumberjack.v2"
11 | )
12 |
13 | var DEFAULT_CIRCUIT_BREAK = 60 * time.Second
14 |
15 | var DEFAULT_LOG_FILE = "nomad.log"
16 | var DEFAULT_SAVE_FILE = "nomad-follower.json"
17 |
18 | var DEFAULT_LOG_TAG = "nomad_follower"
19 |
20 | var MAX_LOG_SIZE = 50
21 | var MAX_LOG_BACKUPS = 1
22 | var MAX_LOG_AGE = 1
23 |
24 | var NOMAD_MAX_WAIT = 5 * time.Minute
25 | var ALLOC_REFRESH_TICK = time.Second * 30
26 |
27 | var DEFAULT_VERBOSITY = INFO
28 |
29 | func main() {
30 | var verbosity LogLevel
31 | verbose := os.Getenv("VERBOSE")
32 | i, err := strconv.Atoi(verbose)
33 | if err != nil {
34 | verbosity = DEFAULT_VERBOSITY
35 | } else {
36 | verbosity = LogLevel(i)
37 | }
38 | logger := Logger{verbosity: verbosity}
39 |
40 | logFile := os.Getenv("LOG_FILE")
41 | if logFile == "" {
42 | logFile = DEFAULT_LOG_FILE
43 | }
44 |
45 | saveFile := os.Getenv("SAVE_FILE")
46 | if saveFile == "" {
47 | saveFile = DEFAULT_SAVE_FILE
48 | }
49 |
50 | logTag := os.Getenv("LOG_TAG")
51 | if logTag == "" {
52 | logTag = DEFAULT_LOG_TAG
53 | }
54 |
55 | createLogFile(logFile, logger)
56 | fileLogger := log.New(&lumberjack.Logger{
57 | Filename: logFile,
58 | MaxSize: MAX_LOG_SIZE,
59 | MaxBackups: MAX_LOG_BACKUPS,
60 | MaxAge: MAX_LOG_AGE,
61 | }, "", 0)
62 |
63 | config := nomadApi.DefaultConfig()
64 | config.WaitTime = NOMAD_MAX_WAIT
65 |
66 | var nomadConfig NomadConfig
67 | nomadTokenBackend := os.Getenv("NOMAD_TOKEN_BACKEND")
68 | if nomadTokenBackend == "" {
69 | nomadConfig = NewNomadEnvAuth(config, logger)
70 | } else {
71 | nomadConfig = NewNomadRenewableAuth(
72 | config,
73 | nil,
74 | nomadTokenBackend,
75 | DEFAULT_CIRCUIT_BREAK,
76 | logger,
77 | )
78 | }
79 |
80 | af, err := NewAllocationFollower(nomadConfig, logger, logTag)
81 | if err != nil {
82 | logger.Errorf("main", "Error creating Allocation Follower: %s", err)
83 | return
84 | }
85 |
86 | outChan := af.Start(ALLOC_REFRESH_TICK, saveFile)
87 |
88 | if af != nil {
89 | for {
90 | select {
91 | case message, ok := <-outChan:
92 | if ok {
93 | fileLogger.Println(message)
94 | } else {
95 | logger.Info("main", "Allocation Follower fatal error, exiting.")
96 | return
97 | }
98 | }
99 | }
100 | }
101 | }
102 |
103 | func createLogFile(logFile string, logger Logger) {
104 | // detect if file exists
105 | var _, err = os.Stat(logFile)
106 |
107 | // create file if not exists
108 | if os.IsNotExist(err) {
109 | var file, err = os.Create(logFile)
110 | if err != nil {
111 | logger.Infof(
112 | "createLogFile",
113 | "Error creating log file Error: %v",
114 | err,
115 | )
116 | return
117 | }
118 | defer file.Close()
119 | }
120 | logger.Infof("createLogFile", "Created log file: %s", logFile)
121 | }
122 |
--------------------------------------------------------------------------------
/vaultTokenBackend.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "time"
5 |
6 | nomadApi "github.com/hashicorp/nomad/api"
7 | vaultApi "github.com/hashicorp/vault/api"
8 | )
9 |
10 | // NomadConfig is a common interface to use a Nomad client + optionally renew tokens.
11 | type NomadConfig interface {
12 | Client() *nomadApi.Client
13 | RenewToken()
14 | }
15 |
16 | // NomadEnvAuth uses the standard $NOMAD_TOKEN to auth to Nomad, if ACLs are enabled.
17 | type NomadEnvAuth struct {
18 | client *nomadApi.Client
19 | config *nomadApi.Config
20 | log Logger
21 | }
22 |
23 | // Client returns a pointer to the internal Nomad client struct.
24 | func (n *NomadEnvAuth) Client() *nomadApi.Client {
25 | return n.client
26 | }
27 |
28 | // RenewToken is a no-operation call to meet the NomadConfig interface.
29 | func (n *NomadEnvAuth) RenewToken() {
30 | // nothing to do $NOMAD_TOKEN is used or cluster does not use ACLs
31 | }
32 |
33 | // NewNomadEnvAuth returns a new standard-auth config relying on $NOMAD_TOKEN.
34 | func NewNomadEnvAuth(nomadConfig *nomadApi.Config, logger Logger) *NomadEnvAuth {
35 | var n = NomadEnvAuth{}
36 | var err error
37 | if nomadConfig == nil {
38 | n.config = nomadApi.DefaultConfig()
39 | } else {
40 | n.config = nomadConfig
41 | }
42 | n.client, err = nomadApi.NewClient(n.config)
43 | if err != nil {
44 | logger.Error("NewNomadEnvAuth", "Failed to create Nomad client.")
45 | return nil
46 | }
47 | n.log = logger
48 | return &n
49 | }
50 |
51 | // NomadRenewableAuth uses a Vault Nomad backend to auth to Nomad and can renew tokens.
52 | type NomadRenewableAuth struct {
53 | client *nomadApi.Client
54 | config *nomadApi.Config
55 | log Logger
56 |
57 | vaultClient *vaultApi.Client
58 | vaultConfig *vaultApi.Config
59 |
60 | nomadTokenBackend string
61 | circuitBreak time.Duration
62 | lastRenewTime time.Time
63 | }
64 |
65 | // Client returns a pointer to the internal Nomad client struct.
66 | func (n *NomadRenewableAuth) Client() *nomadApi.Client {
67 | return n.client
68 | }
69 |
70 | // RenewToken uses a Vault Nomad secrets backend to create a new Nomad token.
71 | func (n *NomadRenewableAuth) RenewToken() {
72 | logContext := "NomadRenewableAuth.RenewToken"
73 | // check if circuit breaker tripped on token renewal
74 | t := time.Now()
75 | past := t.Sub(n.lastRenewTime)
76 | if past < n.circuitBreak {
77 | n.log.Trace(logContext, "Circuit breaker already tripped, skipping request")
78 | return
79 | }
80 | vaultReader := n.vaultClient.Logical()
81 | resp, err := vaultReader.Read(n.nomadTokenBackend)
82 | if err != nil {
83 | n.log.Errorf(logContext, "Error reading Nomad token backend: %s", err)
84 | return
85 | }
86 |
87 | if resp == nil || resp.Data == nil || len(resp.Data) == 0 {
88 | n.log.Error(logContext, "Error no secret data at path")
89 | return
90 | }
91 |
92 | // pull out nomad token
93 | token, ok := resp.Data["secret_id"].(string)
94 | if !ok {
95 | n.log.Error(logContext, "Nomad token not string in Vault response")
96 | return
97 | }
98 |
99 | // set in client
100 | n.log.Debug(logContext, "Refreshed Nomad token from Vault")
101 | n.client.SetSecretID(token)
102 | n.lastRenewTime = time.Now()
103 | }
104 |
105 | // NewNomadRenewableAuth returns a config reliant on a Vault Nomad backend to provide auth tokens.
106 | func NewNomadRenewableAuth(nomadConfig *nomadApi.Config, vaultConfig *vaultApi.Config, tokenBackend string, circuitBreak time.Duration, logger Logger) *NomadRenewableAuth {
107 | var n = NomadRenewableAuth{}
108 | var err error
109 | logContext := "NewNomadRenewableAuth"
110 | if nomadConfig == nil {
111 | n.config = nomadApi.DefaultConfig()
112 | } else {
113 | n.config = nomadConfig
114 | }
115 | if vaultConfig == nil {
116 | n.vaultConfig = vaultApi.DefaultConfig()
117 | n.vaultConfig.ReadEnvironment()
118 | } else {
119 | n.vaultConfig = vaultConfig
120 | }
121 | n.vaultClient, err = vaultApi.NewClient(n.vaultConfig)
122 | if err != nil {
123 | logger.Error(logContext, "Failed to create Vault client")
124 | return nil
125 | }
126 | n.client, err = nomadApi.NewClient(n.config)
127 | if err != nil {
128 | logger.Error(logContext, "Failed to create Nomad client")
129 | return nil
130 | }
131 | n.nomadTokenBackend = tokenBackend
132 | n.circuitBreak = circuitBreak
133 | n.log = logger
134 | return &n
135 | }
136 |
--------------------------------------------------------------------------------