-
Notifications
You must be signed in to change notification settings - Fork 5k
[Elastic Agent] Add install/uninstall sub-command #21206
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
Changes from 26 commits
09fabb5
f99d7f9
4fabf0a
a6f0549
92d64da
de393a3
86983aa
29e507b
7a7716a
d54768e
d260e25
3099b66
c7eeb77
2c6f0bb
189b1e0
1eb59ae
387e4c1
2d9e0bb
bb3b216
a508c2b
29c66de
2d9fe52
729b4b3
f537b2c
5c8b0a4
a6c1857
ff898a2
b574a29
489da3f
3e21b30
be282cb
f570a35
df6e995
ee370ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10907,6 +10907,36 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
|
||
|
|
||
| -------------------------------------------------------------------------------- | ||
| Dependency : github.com/kardianos/service | ||
| Version: v1.1.0 | ||
| Licence type (autodetected): Zlib | ||
| -------------------------------------------------------------------------------- | ||
|
|
||
| Contents of probable licence file $GOMODCACHE/github.com/kardianos/[email protected]/LICENSE: | ||
|
|
||
| Copyright (c) 2015 Daniel Theophanes | ||
|
|
||
| This software is provided 'as-is', without any express or implied | ||
| warranty. In no event will the authors be held liable for any damages | ||
| arising from the use of this software. | ||
|
|
||
| Permission is granted to anyone to use this software for any purpose, | ||
| including commercial applications, and to alter it and redistribute it | ||
| freely, subject to the following restrictions: | ||
|
|
||
| 1. The origin of this software must not be misrepresented; you must not | ||
| claim that you wrote the original software. If you use this software | ||
| in a product, an acknowledgment in the product documentation would be | ||
| appreciated but is not required. | ||
|
|
||
| 2. Altered source versions must be plainly marked as such, and must not be | ||
| misrepresented as being the original software. | ||
|
|
||
| 3. This notice may not be removed or altered from any source | ||
| distribution. | ||
|
|
||
|
|
||
| -------------------------------------------------------------------------------- | ||
| Dependency : github.com/lib/pq | ||
| Version: v1.1.2-0.20190507191818-2ff3cb3adc01 | ||
|
|
@@ -11843,6 +11873,37 @@ Contents of probable licence file $GOMODCACHE/github.com/oklog/[email protected]/LICEN | |
| limitations under the License. | ||
|
|
||
|
|
||
| -------------------------------------------------------------------------------- | ||
| Dependency : github.com/otiai10/copy | ||
| Version: v1.2.0 | ||
| Licence type (autodetected): MIT | ||
| -------------------------------------------------------------------------------- | ||
|
|
||
| Contents of probable licence file $GOMODCACHE/github.com/otiai10/[email protected]/LICENSE: | ||
|
|
||
| The MIT License (MIT) | ||
|
|
||
| Copyright (c) 2018 otiai10 | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. | ||
|
|
||
|
|
||
| -------------------------------------------------------------------------------- | ||
| Dependency : github.com/pierrre/gotestcover | ||
| Version: v0.0.0-20160517101806-924dca7d15f0 | ||
|
|
@@ -34009,6 +34070,54 @@ Contents of probable licence file $GOMODCACHE/github.com/opencontainers/runtime- | |
| limitations under the License. | ||
|
|
||
|
|
||
| -------------------------------------------------------------------------------- | ||
| Dependency : github.com/otiai10/curr | ||
| Version: v1.0.0 | ||
| Licence type (autodetected): MIT | ||
| -------------------------------------------------------------------------------- | ||
|
|
||
| Contents of probable licence file $GOMODCACHE/github.com/otiai10/[email protected]/LICENSE: | ||
|
|
||
| The MIT License (MIT) | ||
|
|
||
| Copyright (c) 2020 Hiromu Ochiai | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. | ||
|
|
||
|
|
||
| -------------------------------------------------------------------------------- | ||
| Dependency : github.com/otiai10/mint | ||
| Version: v1.3.1 | ||
| Licence type (autodetected): MIT | ||
| -------------------------------------------------------------------------------- | ||
|
|
||
| Contents of probable licence file $GOMODCACHE/github.com/otiai10/[email protected]/LICENSE: | ||
|
|
||
| Copyright 2017 otiai10 (Hiromu OCHIAI) | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
|
||
|
|
||
| -------------------------------------------------------------------------------- | ||
| Dependency : github.com/oxtoacart/bpool | ||
| Version: v0.0.0-20150712133111-4e1c5567d7c2 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,8 @@ | |
| "ISC", | ||
| "MIT", | ||
| "MPL-2.0", | ||
| "Public Domain" | ||
| "Public Domain", | ||
| "Zlib" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes its greenlight. For other reviewers going through this.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should add this in a separate PR to have it "documented" in case someone looks for the diff so it does not look like "accidentally" added.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can move it to a single PR just for this one thing. Might be weird to add in an individual PR, think it makes better sense in context. |
||
| ], | ||
| "maybelist": [ | ||
| "EPL-1.0", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // Licensed to Elasticsearch B.V. under one or more contributor | ||
| // license agreements. See the NOTICE file distributed with | ||
| // this work for additional information regarding copyright | ||
| // ownership. Elasticsearch B.V. licenses this file to you under | ||
| // the Apache License, Version 2.0 (the "License"); you may | ||
| // not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| package cli | ||
|
|
||
| import ( | ||
| "bufio" | ||
| "fmt" | ||
| "io" | ||
| "os" | ||
|
|
||
| "github.com/pkg/errors" | ||
| ) | ||
|
|
||
| // ReadInput shows the text and ask the user to provide input. | ||
| func ReadInput(prompt string) (string, error) { | ||
| reader := bufio.NewReader(os.Stdin) | ||
| return input(reader, prompt) | ||
| } | ||
|
|
||
| func input(r io.Reader, prompt string) (string, error) { | ||
| reader := bufio.NewScanner(r) | ||
| fmt.Print(prompt + " ") | ||
|
|
||
| if !reader.Scan() { | ||
| return "", errors.New("error reading user input") | ||
| } | ||
| return reader.Text(), nil | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| // Licensed to Elasticsearch B.V. under one or more contributor | ||
| // license agreements. See the NOTICE file distributed with | ||
| // this work for additional information regarding copyright | ||
| // ownership. Elasticsearch B.V. licenses this file to you under | ||
| // the Apache License, Version 2.0 (the "License"); you may | ||
| // not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| package cli | ||
|
|
||
| import ( | ||
| "strings" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestReadInput(t *testing.T) { | ||
| tests := []struct { | ||
| name string | ||
| input string | ||
| res string | ||
| }{ | ||
| { | ||
| name: "Question 1?", | ||
| input: "\n", | ||
| res: "", | ||
| }, | ||
| { | ||
| name: "Question 2?", | ||
| input: "full string input\n", | ||
| res: "full string input", | ||
| }, | ||
| { | ||
| name: "Question 3?", | ||
| input: "123456789\n", | ||
| res: "123456789", | ||
| }, | ||
| { | ||
| name: "Question 4?", | ||
| input: "false\n", | ||
| res: "false", | ||
| }, | ||
| } | ||
|
|
||
| for _, test := range tests { | ||
| t.Run(test.name, func(t *testing.T) { | ||
| r := strings.NewReader(test.input) | ||
| result, err := input(r, test.name) | ||
| assert.NoError(t, err) | ||
| assert.Equal(t, test.res, result) | ||
| }) | ||
| } | ||
| } |
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.
We should probably move this repo under elastic?
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.
At the moment this is just pointing to a fix of the upstream, once this lands in the upstream repo then the dependency will not point to my personal repo but instead it will point to: https://github.com/kardianos/service
Which is what is defined in the
go.mod, its just that I am usingreplaceat the moment to get the needed fix for systemd on link from my repository.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.
Can you file an issue to switch it over when upstream is fixed. Otherwise we forget for sure ;-)