-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Added CLI option to read license file for inlets operator. #70
Added CLI option to read license file for inlets operator. #70
Conversation
Signed-off-by: Anit <codeanit@gmail.com>
Signed-off-by: Anit <codeanit@gmail.com>
@Waterdrips Hope things are well. Could you please review? |
Thanks for the PR. @Waterdrips did you see this ping? |
@@ -0,0 +1,53 @@ | |||
// Package license reads a license file and |
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.
I don't think we need this package. Can you delete it please?
ioutil.Readfile is fine.
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.
Noted!
@alexellis, I will make the changes as recommended. Thanks.
@@ -0,0 +1,49 @@ | |||
package license |
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.
Not required, please delete.
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.
Noted!
Thanks @alexellis.
@@ -161,6 +162,15 @@ func MakeInstallInletsOperator() *cobra.Command { | |||
overrides["inletsProLicense"] = val | |||
} | |||
|
|||
if licenseFile, _ := command.Flags().GetString("license-file"); len(licenseFile) > 0 { |
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.
Please just use https://golang.org/pkg/io/ioutil/#ReadFile
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.
@alexellis Thanks. Will do.
inletsOperator.Flags().String("pro-client-image", "", "Docker image for inlets-pro's client") | ||
inletsOperator.Flags().Bool("helm3", true, "Use helm3, if set to false uses helm2") | ||
inletsOperator.Flags().StringArray("set", []string{}, "Use custom flags or override existing flags \n(example --set=image=org/repo:tag)") | ||
inletsOperator.Flags().String("license-file", "lf", "The text file containing license key for inlets-pro") |
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.
Not sure you can use a two letter alias of lf
, was this tested?
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.
@alexellis, It was tested passing value to the parameter name. I will double check while making changes. Thanks.
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.
Let's set it to something else, a single character. is -f
available? or -l
?
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.
Sure. Thanks.
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.
Bit too complicated. Please can you see the notes and make sure you've tested.
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.
Please see comments.
Thanks for having a go at this PR, we needed it a little sooner, but you were not to know. Fixed via: #83 Please feel free to stop by again and we'll see if we can find something else for you to get a quick win with. |
Will do @alexellis. Thanks. |
Signed-off-by: Anit codeanit@gmail.com
CLI option
license-file
orlf
added to read a inlets operator license file.Description
CLI option
license-file
orlf
added to read a inlets operator license file.Motivation and Context
The existing and previous option to read license key passed as a string is insecure. Hence, this featured was needed.
How Has This Been Tested?
Types of changes
Checklist:
git commit -s