-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from flanksource/moshloop
Add k8s file scraper
- Loading branch information
Showing
9 changed files
with
214 additions
and
61 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
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,3 @@ | ||
-- +goose Up | ||
|
||
ALTER TABLE config_items ADD COLUMN icon TEXT NULL; |
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,41 @@ | ||
package file | ||
|
||
import "testing" | ||
|
||
//test stripPrefix | ||
func TestStripPrefix(t *testing.T) { | ||
cases := []struct { | ||
input string | ||
expected string | ||
}{ | ||
{"file://foo", "foo"}, | ||
{"git::foo", "foo"}, | ||
{"git::https://foo", "https://foo"}, | ||
{"foo", "foo"}, | ||
{"", ""}, | ||
} | ||
for _, c := range cases { | ||
actual := stripPrefix(c.input) | ||
if actual != c.expected { | ||
t.Errorf("stripPrefix(%s) == %s, expected %s", c.input, actual, c.expected) | ||
} | ||
} | ||
} | ||
|
||
func TestConvertLocalPath(t *testing.T) { | ||
cases := []struct { | ||
input string | ||
expected string | ||
}{ | ||
{"file://foo", "foo-ecf5c8ee"}, | ||
{"git::foo", "foo-b943d8a5"}, | ||
{"git::https://foo/path?query=abc", "foo-path-8f49fbdc"}, | ||
{"foo", "foo-acbd18db"}, | ||
} | ||
for _, c := range cases { | ||
actual := convertToLocalPath(c.input) | ||
if actual != c.expected { | ||
t.Errorf("convertToLocalPath(%s) == %s, expected %s", c.input, actual, c.expected) | ||
} | ||
} | ||
} |
Oops, something went wrong.