-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase compatibility for building of Windows images #1081
Conversation
@@ -1,4 +1,5 @@ | |||
version: 2 | |||
version: 2.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these changes (like this one) are slightly preemptive. I started from a version where I was making Windows builds (unsuccessfully) and just backtracked on the explicitly windows+CI portions.
Version 2.1 is required here if we want to use the windows orb on circleCI which enables use of the windows executor.
@@ -10,7 +10,7 @@ fi | |||
|
|||
function image_push() { | |||
echo ${DOCKERHUB_TOKEN} | docker login --username sonobuoybot --password-stdin | |||
make containers push | |||
make push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually (when windows+linux nodes supported) we can't build both on the same machine. So presumably we've make container
and make win-container
in different machines and loaded the images for this step.
result-format: raw | ||
skip-cleanup: true | ||
spec: | ||
image: schnake/windows-plugin:v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to push a sonobuoy version of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the name; still need to push the image though. I'll do that when this merges.
pkg/client/retrieve.go
Outdated
@@ -141,8 +189,9 @@ func UntarAll(reader io.Reader, destFile, prefix string) (filenames []string, re | |||
} | |||
entrySeq++ | |||
mode := header.FileInfo().Mode() | |||
outFileName := path.Join(destFile, header.Name[len(prefix):]) | |||
outFileName := filepath.Join(destFile, header.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double check prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this kind of doesnt really matter. The reason being that we take the base name right below this so it is a bit redundant to also strip the prefix.
I'll undo this change for now, but not sure how this may change as both OSs are supported.
Need to manually check this again on windows and probably update the manual steps in the release.md; however I think otherwise the code is good. Had manually run it all but that was a few weeks ago. Will post back results when done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your efforts on this, @johnSchnake! I know it's been really awkward to get working. The change so far look good to me, although I haven't tried them out. My understanding is that if this is merged as is, it won't affect any of the existing behaviour, and won't affect the CI scripts until we add in those changes from the other PR? If that's the case, and you're happy with it, I think we can merge this and iterate on it afterwards.
pkg/client/gen_test.go
Outdated
}, | ||
goldenFile: filepath.Join("testdata", "multiple-node-selector.golden"), | ||
}, { | ||
name: "Node selector with empty string is OK", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having an empty value for the node selector will produce invalid YAML, do we want to validate that case or rely on the error when we try to use the resulting manifest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the Set
method of the flag should handle that; I added a node_selector_test.go that has a unit test for this. As a result, I removed this test case entirely since it (1) shouldn't occur and (2) produces invalid yaml anyways.
Windows images so that Sonobuoy can be run on Windows nodes. This change stops short of adding the Windows build to CI while we figure out some of the last technical problems there. Changes include: - Utilizing circleci workspaces to load/store docker images across stages - Adds a Windows sample plugin - Updates the makefile to support building windows images and cleans up some of the makefile structure to build the binaries as appropriate - Updates the makefile to build/push images for windows only if PUSH_WINDOWS=true - Updates the way the manifest-tool is invoked to use a template instead of the command line options (which provides more flexibility) - Adds a flag `aggregator-node-selector` to gen/run commands in order to help direct where to place the aggregator in mixed-node clusters - Modify which command is used to grab the tarball of results from the aggregator depending on whether or not it is a Windows system or not (therefore if bash or powershell should be used) Signed-off-by: John Schnake <[email protected]>
Based on @zubron 's last comment I'm going to merge once CI goes green. I fixed up some problems I found in the makefile, added 2 more tests (and removed one), and made some doc tweaks. |
What this PR does / why we need it:
Currently in a beta state, we are experimenting with building
Windows images so that Sonobuoy can be run on Windows nodes.
This change stops short of adding the Windows build to CI
while we figure out some of the last technical problems there.
Changes include:
aggregator-node-selector
to gen/run commands in order to help direct where to place the aggregator in mixed-node clustersWhich issue(s) this PR fixes
Special notes for your reviewer:
The hardest parts of this are:
Once those are handled the rest isn't so bad.
Release note: