Commit da85045
Warn when legacy .s2i/bin/assemble scaffolding is detected (#3584)
* Warn when legacy .s2i/bin/assemble scaffolding is detected
Prior to #3436, func wrote S2I scaffolding for go/python
to <func-root>/.s2i/bin/assemble. It now lives at .func/build/bin/assemble.
The stale file can interfere with other builders (e.g. pack erroneously
detects the assemble script).
Add WarnIfLegacyS2IScaffolding helper in pkg/s2i that checks only
scaffolded runtimes (go/python) and only the exact file func generated,
so user-managed .s2i directories are not flagged. Call it from both the
local Build() path and the remote PipelinesProvider.Run() path so the
warning is emitted regardless of how the function is built.
Fixes #3452
* Move legacy .s2i warning into Client.Build
Per review feedback on #3584, the warning helper now lives in
pkg/functions as a standalone WarnIfLegacyS2IScaffolding and is invoked
from Client.Build, so it fires for every build (and therefore every
local deploy) regardless of which builder the user switched to.
The Tekton pipelines provider keeps its own call for remote deploys
(which don't go through Client.Build) and no longer needs to import
pkg/s2i. The s2i builder's redundant call is removed. The test moves
to pkg/functions and exercises the helper directly.
* Update pkg/functions/client.go
Co-authored-by: David Fridrich <49119790+gauron99@users.noreply.github.com>
* Update pkg/functions/function.go
Co-authored-by: David Fridrich <49119790+gauron99@users.noreply.github.com>
* Update pkg/functions/function_unit_test.go
Co-authored-by: David Fridrich <49119790+gauron99@users.noreply.github.com>
* Fix govet/staticcheck: drop unused Fprintf args in legacy s2i warning
* Update pkg/functions/function.go
Co-authored-by: David Fridrich <49119790+gauron99@users.noreply.github.com>
* Update pkg/functions/function.go
Co-authored-by: David Fridrich <49119790+gauron99@users.noreply.github.com>
* Update pkg/functions/function.go
Co-authored-by: David Fridrich <49119790+gauron99@users.noreply.github.com>
* Update pkg/functions/function.go
---------
Co-authored-by: David Fridrich <49119790+gauron99@users.noreply.github.com>1 parent 07bdeaf commit da85045
File tree
4 files changed
+91
-0
lines changed- pkg
- functions
- pipelines/tekton
4 files changed
+91
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
695 | 700 | | |
696 | 701 | | |
697 | 702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
601 | 602 | | |
602 | 603 | | |
603 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
604 | 623 | | |
605 | 624 | | |
606 | 625 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
296 | 298 | | |
297 | 299 | | |
298 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
| |||
0 commit comments