-
Notifications
You must be signed in to change notification settings - Fork 60
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
new(cmd/driver): support user provided headers option for driver download #428
Conversation
Welcome @toamto94! It looks like this is your first PR to falcosecurity/falcoctl 🎉 |
Thanks for this PR! I'll give it a look tomorrow! |
/milestone v0.7.2 |
To fix linting: make sure to split the line:
Into multiple lines ;) |
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.
/approve
LGTM label has been added. Git tree hash: 1b9a401266077b97a5b366b061fa90ac478b163c
|
Can you run |
cmd/driver/install/install.go
Outdated
} | ||
|
||
type driverInstallOptions struct { | ||
*options.Common | ||
*options.Driver | ||
Download bool | ||
Compile bool | ||
Download: true, |
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.
bool
?
Ah I am sorry! I have a meeting now and will fix it afterwords. Gesendet mit der mobilen Mail AppAm 09.02.24 um 10:42 schrieb Federico Di Pierro
Von: "Federico Di Pierro" ***@***.***>Datum: 9. Februar 2024An: "falcosecurity/falcoctl" ***@***.***>Cc: "Mention" ***@***.***>,"Tom Müller" ***@***.***>Betreff: Re: [falcosecurity/falcoctl] Fb header options (PR #428)
@FedeDP commented on this pull request.
In cmd/driver/install/install.go:
}
type driverInstallOptions struct {
*options.Common
*options.Driver
- Download bool
- Compile bool
+ Download: true,
bool ?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I'd say we are quite ready; you just miss to run |
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.
My IDE is messing around, I am sorry for the confusion
Alright, let me get things right now. Sorry for the confusion :D |
Ok no problem! |
ah need to sign of. sec |
Aah wait let me fix this |
45a0d08
to
65ebe6d
Compare
Signed-off-by: Tom Müller <[email protected]> fixed linting for http-header option fixed syntax error in driver download options Signed-off-by: Tom Müller <[email protected]> fixed syntax error in driver download options Signed-off-by: Tom Müller <[email protected]> fixed syntax error in driver download options Signed-off-by: Tom Müller <[email protected]> fixed linting for driver download options Signed-off-by: Tom Müller <[email protected]> moved header injection below error check No need to inject a header into an empty request Signed-off-by: Tom Müller <[email protected]> fixed linting for Download function call Line was too long so needed to be split in multiple lines Signed-off-by: Tom Müller <[email protected]> rearranged http-headers flag http-headers flag moved to driverDownloadOptions Signed-off-by: Tom Müller <[email protected]> added leading space trimming for header keys Added leading space trimming for header keys in order to make the function more robust Signed-off-by: Tom Müller <[email protected]> forwarding of the headers variable into the http GET request Added functionality which parses the comma separated string of headers which were provided with the --http-headers flag to the Download function. The headers are unpacked and injected into the http GET request. Signed-off-by: Tom Müller <[email protected]> added header options for driver download Added header options for the driver download via http GET. Headers should be provided via the --http-headers flag as a comma separated string (e.g. --http-headers="x-emc-namespace:default") Signed-off-by: Tom Müller <[email protected]>
65ebe6d
to
fa715ce
Compare
Fighting with git is always fun :D |
Failed. What exactly needs to be done there @FedeDP |
8ab30b1
to
1676aed
Compare
Don't seem to work hm. Any idea what I am doing wrong? |
1676aed
to
84726a4
Compare
You can quickly locally test using |
Ah alright! Thx for the tip |
|
@@ -37,6 +37,7 @@ Flags: | |||
--download Whether to enable download of prebuilt drivers (default true) | |||
-h, --help help for install | |||
--http-insecure Whether you want to allow insecure downloads or not | |||
--http-headers string Optional comma-separated list of headers for the http GET request (e.g. --http-headers='x-emc-namespace: default,Proxy-Authenticate: Basic'). Not necessary if default repo is used |
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.
Here, --http-headers
should be before --http-insecure
.
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.
Awesome!! Thank you very much! :)
Signed-off-by: Tom Müller <[email protected]>
84726a4
to
24760db
Compare
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.
/approve
LGTM label has been added. Git tree hash: d40677f83658c1e4257ccbcc645000c3189d4d3d
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, toamto94 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area cli
What this PR does / why we need it:
Added option to add headers in the http GET request for the driver download
Which issue(s) this PR fixes:
Option had been possible via environment variables in the script based download but is not possible anymore since the falcoctl migration
Fixes #426
Special notes for your reviewer:
example flag (for testing):
--http-headers="x-emc-namespace: default,Proxy-Authenticate: Basic"