-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- wait for dns on windows. This is dues to the fact that windows containers on docker don't start up without their network ready so we have to wait. we think that this can be removed when containerd is the default runtime. In the build-init binary we don't error on timeout because we assume that it timed out due to an incorrect host, so we want the normal error for that to still apply. - create network wait launcher binary. This is used to execute the lifecycle containers during the build after the network is ready in windows containers. it is built with build-init and copied to a shared volume during the prepare step. we also think this can be removed when containerd is the default runtime - Copy git repository to workspace directory becase clone directly to workspace was causing issues on Windows - add os to builder status - Update openapi spec with latest openapi gen binary - add windows images to controller yaml - caching is not currently implemented for windows builds because the DefaultStorageClass isn't always compatible with windows. This will require more investigation Co-authored-by: Tom Kennedy <ktom@vmware.com> Co-authored-by: Anthony Emengo <aemengo@vmware.com> Co-authored-by: Matthew McNew <mmcnew@pivotal.io>
- Loading branch information
1 parent
55e1007
commit 2729e9a
Showing
16 changed files
with
788 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package main | ||
|
||
import ( | ||
"errors" | ||
"log" | ||
"net" | ||
"os" | ||
"os/exec" | ||
"time" | ||
) | ||
|
||
func main() { | ||
// example: /kpack/network-wait-launcher gcr.io -- completion --notary-url="some-url" | ||
|
||
hostname := os.Args[1] | ||
command := os.Args[3:] | ||
|
||
if err := waitForDns(hostname); err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
cmd := exec.Command(command[0], command[1:]...) | ||
|
||
cmd.Stdout = os.Stdout | ||
cmd.Stderr = os.Stderr | ||
if err := cmd.Run(); err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
} | ||
|
||
func waitForDns(hostname string) error { | ||
timeoutChan := time.After(10 * time.Second) | ||
tickerChan := time.NewTicker(time.Second) | ||
defer tickerChan.Stop() | ||
|
||
for { | ||
select { | ||
case <-timeoutChan: | ||
return errors.New("timeout waiting for network") | ||
case <-tickerChan.C: | ||
_, err := net.LookupIP(hostname) | ||
if err == nil { | ||
return nil | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.