mirror of
https://github.com/weaveworks/scope.git
synced 2026-02-14 18:09:59 +00:00
Merge pull request #3797 from weaveworks/update-build-tools
Update build tools
This commit is contained in:
4
.lintignore
Normal file
4
.lintignore
Normal file
@@ -0,0 +1,4 @@
|
||||
# Generated files
|
||||
./cri/runtime/api.pb.go
|
||||
# Files from different repo
|
||||
./tools/*
|
||||
4
Makefile
4
Makefile
@@ -118,7 +118,7 @@ shell:
|
||||
tests: $(CODECGEN_TARGETS) prog/staticui/staticui.go prog/externalui/externalui.go
|
||||
./tools/test -no-go-get -tags $(GO_BUILD_TAGS)
|
||||
|
||||
lint:
|
||||
lint: prog/staticui/staticui.go prog/externalui/externalui.go
|
||||
./tools/lint
|
||||
|
||||
prog/staticui/staticui.go:
|
||||
@@ -278,7 +278,7 @@ realclean: clean
|
||||
$(DOCKERHUB_USER)/scope $(DOCKERHUB_USER)/cloud-agent \
|
||||
$(DOCKERHUB_USER)/scope:$(IMAGE_TAG) $(DOCKERHUB_USER)/cloud-agent:$(IMAGE_TAG) \
|
||||
weaveworks/weaveexec:$(WEAVENET_VERSION) \
|
||||
ubuntu:yakkety alpine:3.5 node:6.9.0 2>/dev/null || true
|
||||
ubuntu:bionic alpine:3.11 node:6.9.0 2>/dev/null || true
|
||||
|
||||
# Dependencies are intentionally build without enforcing any tags
|
||||
# since they are build on the host
|
||||
|
||||
@@ -166,7 +166,7 @@ type websocketState struct {
|
||||
}
|
||||
|
||||
func (wc *websocketState) update(ctx context.Context) error {
|
||||
span := ot.StartSpan("websocket.Render", ot.Tag{"topology", wc.topologyID})
|
||||
span := ot.StartSpan("websocket.Render", ot.Tag{Key: "topology", Value: wc.topologyID})
|
||||
defer span.Finish()
|
||||
ctx = ot.ContextWithSpan(ctx, span)
|
||||
// We measure how much time has passed since the channel was opened
|
||||
|
||||
@@ -213,7 +213,7 @@ func NewAWSCollector(config AWSCollectorConfig) (AWSCollector, error) {
|
||||
}
|
||||
|
||||
func (c *awsCollector) flushLoop() {
|
||||
for _ = range c.ticker.C {
|
||||
for range c.ticker.C {
|
||||
c.flushPending(context.Background())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ type consulClient struct {
|
||||
|
||||
// Get and deserialise a JSON value from consul.
|
||||
func (c *consulClient) Get(ctx context.Context, key string, out interface{}) error {
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "Consul Get", opentracing.Tag{"key", key})
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "Consul Get", opentracing.Tag{Key: "key", Value: key})
|
||||
defer span.Finish()
|
||||
kvp, _, err := c.kv.Get(key, queryOptions)
|
||||
if err != nil {
|
||||
@@ -76,7 +76,7 @@ func (c *consulClient) Get(ctx context.Context, key string, out interface{}) err
|
||||
// CAS atomically modify a value in a callback.
|
||||
// If value doesn't exist you'll get nil as a argument to your callback.
|
||||
func (c *consulClient) CAS(ctx context.Context, key string, out interface{}, f CASCallback) error {
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "Consul CAS", opentracing.Tag{"key", key})
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "Consul CAS", opentracing.Tag{Key: "key", Value: key})
|
||||
defer span.Finish()
|
||||
var (
|
||||
index = uint64(0)
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"context"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/gorilla/websocket"
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
@@ -289,7 +290,7 @@ func (pr *consulPipeRouter) Get(ctx context.Context, id string, e app.End) (xfer
|
||||
}
|
||||
key := fmt.Sprintf("%s%s-%s", pr.prefix, userID, id)
|
||||
log.Infof("Get %s:%s", key, e)
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "PipeRouter Get", opentracing.Tag{"key", key})
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "PipeRouter Get", opentracing.Tag{Key: "key", Value: key})
|
||||
defer span.Finish()
|
||||
|
||||
// Try to ensure the given end of the given pipe
|
||||
@@ -333,7 +334,7 @@ func (pr *consulPipeRouter) Release(ctx context.Context, id string, e app.End) e
|
||||
}
|
||||
key := fmt.Sprintf("%s%s-%s", pr.prefix, userID, id)
|
||||
log.Infof("Release %s:%s", key, e)
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "PipeRouter Release", opentracing.Tag{"key", key})
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "PipeRouter Release", opentracing.Tag{Key: "key", Value: key})
|
||||
defer span.Finish()
|
||||
|
||||
// atomically clear my end of the pipe in consul
|
||||
@@ -360,7 +361,7 @@ func (pr *consulPipeRouter) Delete(ctx context.Context, id string) error {
|
||||
}
|
||||
key := fmt.Sprintf("%s%s-%s", pr.prefix, userID, id)
|
||||
log.Infof("Delete %s", key)
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "PipeRouter Delete", opentracing.Tag{"key", key})
|
||||
span, ctx := opentracing.StartSpanFromContext(ctx, "PipeRouter Delete", opentracing.Tag{Key: "key", Value: key})
|
||||
defer span.Finish()
|
||||
|
||||
return pr.client.CAS(ctx, key, &consulPipe{}, func(in interface{}) (interface{}, bool, error) {
|
||||
|
||||
52
bin/release
52
bin/release
@@ -39,7 +39,7 @@ setup() {
|
||||
else
|
||||
echo "Cannot determine version - multiple tags point at HEAD:" >&2
|
||||
for TAG in $HEAD_TAGS; do
|
||||
echo -e "\t$TAG" >&2
|
||||
echo -e "\\t$TAG" >&2
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
@@ -65,8 +65,8 @@ build() {
|
||||
|
||||
echo "== Clone repo at $LATEST_TAG for version $VERSION"
|
||||
if [ -d "$RELEASE_DIR" ]; then
|
||||
echo -e "\u2757 Release directory $RELEASE_DIR already exists, you may want to" >&2
|
||||
echo -e "\trm -rf $RELEASE_DIR" >&2
|
||||
echo -e "\\u2757 Release directory $RELEASE_DIR already exists, you may want to" >&2
|
||||
echo -e "\\trm -rf $RELEASE_DIR" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -78,7 +78,7 @@ build() {
|
||||
## Check that the top changelog entry is this version
|
||||
if ! latest_changelog=$(perl -nle'print $& if m{(?<=^## Release ).*}' ./CHANGELOG.md | head -1) \
|
||||
|| ! [ "$latest_changelog" = "$VERSION" ]; then
|
||||
echo -e "\u2757 Latest changelog entry \"$latest_changelog\" does not match the release version $VERSION" >&2
|
||||
echo -e "\\u2757 Latest changelog entry \"$latest_changelog\" does not match the release version $VERSION" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -93,7 +93,7 @@ build() {
|
||||
if make tests SUDO="$SUDO"; then
|
||||
echo -e '\u2713 Tests pass'
|
||||
else
|
||||
echo -e "\u2757 Tests failed, probably best not publish this one" >&2
|
||||
echo -e "\\u2757 Tests failed, probably best not publish this one" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -119,20 +119,20 @@ draft() {
|
||||
|
||||
## Check that the tag exists by looking at github
|
||||
if ! curl -sSf "https://api.github.com/repos/$GITHUB_USER/scope/git/tags/$LATEST_TAG_SHA" >/dev/null 2>&1; then
|
||||
echo -e "\u2757 Tag $LATEST_TAG is not on GitHub, or is not the same as the local tag" >&2
|
||||
echo -e "\thttps://github.com/$GITHUB_USER/scope/tags" >&2
|
||||
echo -e "\\u2757 Tag $LATEST_TAG is not on GitHub, or is not the same as the local tag" >&2
|
||||
echo -e "\\thttps://github.com/$GITHUB_USER/scope/tags" >&2
|
||||
echo "You may need to" >&2
|
||||
echo -e "\tgit push git@github.com:$GITHUB_USER/scope $LATEST_TAG"
|
||||
echo -e "\\tgit push git@github.com:$GITHUB_USER/scope $LATEST_TAG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\u2713 Tag $LATEST_TAG exists in GitHub repo $GITHUB_USER/scope"
|
||||
echo -e "\\u2713 Tag $LATEST_TAG exists in GitHub repo $GITHUB_USER/scope"
|
||||
|
||||
## Check that the version does not already exist by looking at github
|
||||
## releases
|
||||
if github-release info --user "$GITHUB_USER" --repo scope --tag "$LATEST_TAG" >/dev/null 2>&1; then
|
||||
echo -e "\u2757 Release $LATEST_TAG already exists on GitHub" >&2
|
||||
echo -e "\thttps://github.com/$GITHUB_USER/scope/releases/$LATEST_TAG" >&2
|
||||
echo -e "\\u2757 Release $LATEST_TAG already exists on GitHub" >&2
|
||||
echo -e "\\thttps://github.com/$GITHUB_USER/scope/releases/$LATEST_TAG" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -144,7 +144,7 @@ draft() {
|
||||
fi
|
||||
|
||||
echo "== Creating GitHub release $RELEASE_ARGS $RELEASE_NAME $VERSION"
|
||||
github-release release $RELEASE_ARGS \
|
||||
github-release release "$RELEASE_ARGS" \
|
||||
--user "$GITHUB_USER" \
|
||||
--repo scope \
|
||||
--tag "$LATEST_TAG" \
|
||||
@@ -159,7 +159,7 @@ draft() {
|
||||
--file "./scope"
|
||||
|
||||
echo "** Draft $TYPE $RELEASE_NAME $VERSION created at"
|
||||
echo -e "\thttps://github.com/$GITHUB_USER/scope/releases/$LATEST_TAG"
|
||||
echo -e "\\thttps://github.com/$GITHUB_USER/scope/releases/$LATEST_TAG"
|
||||
}
|
||||
|
||||
publish() {
|
||||
@@ -177,22 +177,22 @@ publish() {
|
||||
--tag "$LATEST_TAG"
|
||||
|
||||
echo "** Pre-release $RELEASE_NAME $VERSION published at"
|
||||
echo -e "\thttps://github.com/$GITHUB_USER/scope/releases/$LATEST_TAG"
|
||||
echo -e "\\thttps://github.com/$GITHUB_USER/scope/releases/$LATEST_TAG"
|
||||
else
|
||||
echo "== Sanity checks"
|
||||
if ! [ "$LATEST_TAG_COMMIT_SHA" == "$LATEST_RELEASE_COMMIT_SHA" ]; then
|
||||
echo -e "\u2757 The tag latest_release does not point to the same commit as $LATEST_TAG" >&2
|
||||
echo -e "\\u2757 The tag latest_release does not point to the same commit as $LATEST_TAG" >&2
|
||||
echo "You may need to" >&2
|
||||
echo -e "\tgit tag -af latest_release $LATEST_TAG" >&2
|
||||
echo -e "\\tgit tag -af latest_release $LATEST_TAG" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## Check that the 'latest_release' tag exists by looking at github
|
||||
if ! curl -sSf "https://api.github.com/repos/$GITHUB_USER/scope/git/tags/$LATEST_RELEASE_SHA" >/dev/null 2>&1; then
|
||||
echo -e "\u2757 Tag latest_release is not on GitHub, or is not the same as the local tag" >&2
|
||||
echo -e "\thttps://github.com/$GITHUB_USER/scope/tags" >&2
|
||||
echo -e "\\u2757 Tag latest_release is not on GitHub, or is not the same as the local tag" >&2
|
||||
echo -e "\\thttps://github.com/$GITHUB_USER/scope/tags" >&2
|
||||
echo "You may need to" >&2
|
||||
echo -e "\tgit push -f git@github.com:$GITHUB_USER/scope latest_release" >&2
|
||||
echo -e "\\tgit push -f git@github.com:$GITHUB_USER/scope latest_release" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo '** Sanity checks OK for publishing tag' "$LATEST_TAG" as "$DOCKERHUB_USER/scope:$VERSION"
|
||||
@@ -229,8 +229,8 @@ publish() {
|
||||
--file "./scope"
|
||||
|
||||
echo "** Release $RELEASE_NAME $VERSION published at"
|
||||
echo -e "\thttps://github.com/$GITHUB_USER/scope/releases/$LATEST_TAG"
|
||||
echo -e "\thttps://github.com/$GITHUB_USER/scope/releases/latest_release"
|
||||
echo -e "\\thttps://github.com/$GITHUB_USER/scope/releases/$LATEST_TAG"
|
||||
echo -e "\\thttps://github.com/$GITHUB_USER/scope/releases/latest_release"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -254,19 +254,19 @@ push_images() {
|
||||
|
||||
usage() {
|
||||
echo "Usage:"
|
||||
echo -e "\t./bin/release build"
|
||||
echo -e "\\t./bin/release build"
|
||||
echo "-- Build artefacts for the latest version tag"
|
||||
echo -e "\t./bin/release draft"
|
||||
echo -e "\\t./bin/release draft"
|
||||
echo "-- Create draft release with artefacts in GitHub"
|
||||
echo -e "\t./bin/release publish"
|
||||
echo -e "\\t./bin/release publish"
|
||||
echo "-- Publish the GitHub release and update DockerHub"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Ensure required tooling is installed
|
||||
if ! which github-release >/dev/null; then
|
||||
if ! command -v github-release >/dev/null; then
|
||||
echo "Please install git-release:" >&2
|
||||
echo -e "\tgo get github.com/weaveworks/github-release" >&2
|
||||
echo -e "\\tgo get github.com/weaveworks/github-release" >&2
|
||||
echo "and create a git token per https://github.com/weaveworks/github-release" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -5171,7 +5171,7 @@ func (m *LinuxPodSandboxConfig) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += n7
|
||||
}
|
||||
if len(m.Sysctls) > 0 {
|
||||
for k, _ := range m.Sysctls {
|
||||
for k := range m.Sysctls {
|
||||
dAtA[i] = 0x1a
|
||||
i++
|
||||
v := m.Sysctls[k]
|
||||
@@ -5291,7 +5291,7 @@ func (m *PodSandboxConfig) MarshalTo(dAtA []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
if len(m.Labels) > 0 {
|
||||
for k, _ := range m.Labels {
|
||||
for k := range m.Labels {
|
||||
dAtA[i] = 0x32
|
||||
i++
|
||||
v := m.Labels[k]
|
||||
@@ -5308,7 +5308,7 @@ func (m *PodSandboxConfig) MarshalTo(dAtA []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
if len(m.Annotations) > 0 {
|
||||
for k, _ := range m.Annotations {
|
||||
for k := range m.Annotations {
|
||||
dAtA[i] = 0x3a
|
||||
i++
|
||||
v := m.Annotations[k]
|
||||
@@ -5649,7 +5649,7 @@ func (m *PodSandboxStatus) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += n16
|
||||
}
|
||||
if len(m.Labels) > 0 {
|
||||
for k, _ := range m.Labels {
|
||||
for k := range m.Labels {
|
||||
dAtA[i] = 0x3a
|
||||
i++
|
||||
v := m.Labels[k]
|
||||
@@ -5666,7 +5666,7 @@ func (m *PodSandboxStatus) MarshalTo(dAtA []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
if len(m.Annotations) > 0 {
|
||||
for k, _ := range m.Annotations {
|
||||
for k := range m.Annotations {
|
||||
dAtA[i] = 0x42
|
||||
i++
|
||||
v := m.Annotations[k]
|
||||
@@ -5711,7 +5711,7 @@ func (m *PodSandboxStatusResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += n17
|
||||
}
|
||||
if len(m.Info) > 0 {
|
||||
for k, _ := range m.Info {
|
||||
for k := range m.Info {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
v := m.Info[k]
|
||||
@@ -5785,7 +5785,7 @@ func (m *PodSandboxFilter) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += n18
|
||||
}
|
||||
if len(m.LabelSelector) > 0 {
|
||||
for k, _ := range m.LabelSelector {
|
||||
for k := range m.LabelSelector {
|
||||
dAtA[i] = 0x1a
|
||||
i++
|
||||
v := m.LabelSelector[k]
|
||||
@@ -5874,7 +5874,7 @@ func (m *PodSandbox) MarshalTo(dAtA []byte) (int, error) {
|
||||
i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt))
|
||||
}
|
||||
if len(m.Labels) > 0 {
|
||||
for k, _ := range m.Labels {
|
||||
for k := range m.Labels {
|
||||
dAtA[i] = 0x2a
|
||||
i++
|
||||
v := m.Labels[k]
|
||||
@@ -5891,7 +5891,7 @@ func (m *PodSandbox) MarshalTo(dAtA []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
if len(m.Annotations) > 0 {
|
||||
for k, _ := range m.Annotations {
|
||||
for k := range m.Annotations {
|
||||
dAtA[i] = 0x32
|
||||
i++
|
||||
v := m.Annotations[k]
|
||||
@@ -6550,7 +6550,7 @@ func (m *ContainerConfig) MarshalTo(dAtA []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
if len(m.Labels) > 0 {
|
||||
for k, _ := range m.Labels {
|
||||
for k := range m.Labels {
|
||||
dAtA[i] = 0x4a
|
||||
i++
|
||||
v := m.Labels[k]
|
||||
@@ -6567,7 +6567,7 @@ func (m *ContainerConfig) MarshalTo(dAtA []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
if len(m.Annotations) > 0 {
|
||||
for k, _ := range m.Annotations {
|
||||
for k := range m.Annotations {
|
||||
dAtA[i] = 0x52
|
||||
i++
|
||||
v := m.Annotations[k]
|
||||
@@ -6904,7 +6904,7 @@ func (m *ContainerFilter) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += copy(dAtA[i:], m.PodSandboxId)
|
||||
}
|
||||
if len(m.LabelSelector) > 0 {
|
||||
for k, _ := range m.LabelSelector {
|
||||
for k := range m.LabelSelector {
|
||||
dAtA[i] = 0x22
|
||||
i++
|
||||
v := m.LabelSelector[k]
|
||||
@@ -7015,7 +7015,7 @@ func (m *Container) MarshalTo(dAtA []byte) (int, error) {
|
||||
i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt))
|
||||
}
|
||||
if len(m.Labels) > 0 {
|
||||
for k, _ := range m.Labels {
|
||||
for k := range m.Labels {
|
||||
dAtA[i] = 0x42
|
||||
i++
|
||||
v := m.Labels[k]
|
||||
@@ -7032,7 +7032,7 @@ func (m *Container) MarshalTo(dAtA []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
if len(m.Annotations) > 0 {
|
||||
for k, _ := range m.Annotations {
|
||||
for k := range m.Annotations {
|
||||
dAtA[i] = 0x4a
|
||||
i++
|
||||
v := m.Annotations[k]
|
||||
@@ -7200,7 +7200,7 @@ func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += copy(dAtA[i:], m.Message)
|
||||
}
|
||||
if len(m.Labels) > 0 {
|
||||
for k, _ := range m.Labels {
|
||||
for k := range m.Labels {
|
||||
dAtA[i] = 0x62
|
||||
i++
|
||||
v := m.Labels[k]
|
||||
@@ -7217,7 +7217,7 @@ func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
if len(m.Annotations) > 0 {
|
||||
for k, _ := range m.Annotations {
|
||||
for k := range m.Annotations {
|
||||
dAtA[i] = 0x6a
|
||||
i++
|
||||
v := m.Annotations[k]
|
||||
@@ -7280,7 +7280,7 @@ func (m *ContainerStatusResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += n43
|
||||
}
|
||||
if len(m.Info) > 0 {
|
||||
for k, _ := range m.Info {
|
||||
for k := range m.Info {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
v := m.Info[k]
|
||||
@@ -7912,7 +7912,7 @@ func (m *ImageStatusResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += n51
|
||||
}
|
||||
if len(m.Info) > 0 {
|
||||
for k, _ := range m.Info {
|
||||
for k := range m.Info {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
v := m.Info[k]
|
||||
@@ -8331,7 +8331,7 @@ func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += n58
|
||||
}
|
||||
if len(m.Info) > 0 {
|
||||
for k, _ := range m.Info {
|
||||
for k := range m.Info {
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
v := m.Info[k]
|
||||
@@ -8606,7 +8606,7 @@ func (m *ContainerStatsFilter) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += copy(dAtA[i:], m.PodSandboxId)
|
||||
}
|
||||
if len(m.LabelSelector) > 0 {
|
||||
for k, _ := range m.LabelSelector {
|
||||
for k := range m.LabelSelector {
|
||||
dAtA[i] = 0x1a
|
||||
i++
|
||||
v := m.LabelSelector[k]
|
||||
@@ -8687,7 +8687,7 @@ func (m *ContainerAttributes) MarshalTo(dAtA []byte) (int, error) {
|
||||
i += n64
|
||||
}
|
||||
if len(m.Labels) > 0 {
|
||||
for k, _ := range m.Labels {
|
||||
for k := range m.Labels {
|
||||
dAtA[i] = 0x1a
|
||||
i++
|
||||
v := m.Labels[k]
|
||||
@@ -8704,7 +8704,7 @@ func (m *ContainerAttributes) MarshalTo(dAtA []byte) (int, error) {
|
||||
}
|
||||
}
|
||||
if len(m.Annotations) > 0 {
|
||||
for k, _ := range m.Annotations {
|
||||
for k := range m.Annotations {
|
||||
dAtA[i] = 0x22
|
||||
i++
|
||||
v := m.Annotations[k]
|
||||
@@ -10741,7 +10741,7 @@ func (this *LinuxPodSandboxConfig) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForSysctls := make([]string, 0, len(this.Sysctls))
|
||||
for k, _ := range this.Sysctls {
|
||||
for k := range this.Sysctls {
|
||||
keysForSysctls = append(keysForSysctls, k)
|
||||
}
|
||||
sortkeys.Strings(keysForSysctls)
|
||||
@@ -10776,7 +10776,7 @@ func (this *PodSandboxConfig) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabels := make([]string, 0, len(this.Labels))
|
||||
for k, _ := range this.Labels {
|
||||
for k := range this.Labels {
|
||||
keysForLabels = append(keysForLabels, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabels)
|
||||
@@ -10786,7 +10786,7 @@ func (this *PodSandboxConfig) String() string {
|
||||
}
|
||||
mapStringForLabels += "}"
|
||||
keysForAnnotations := make([]string, 0, len(this.Annotations))
|
||||
for k, _ := range this.Annotations {
|
||||
for k := range this.Annotations {
|
||||
keysForAnnotations = append(keysForAnnotations, k)
|
||||
}
|
||||
sortkeys.Strings(keysForAnnotations)
|
||||
@@ -10912,7 +10912,7 @@ func (this *PodSandboxStatus) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabels := make([]string, 0, len(this.Labels))
|
||||
for k, _ := range this.Labels {
|
||||
for k := range this.Labels {
|
||||
keysForLabels = append(keysForLabels, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabels)
|
||||
@@ -10922,7 +10922,7 @@ func (this *PodSandboxStatus) String() string {
|
||||
}
|
||||
mapStringForLabels += "}"
|
||||
keysForAnnotations := make([]string, 0, len(this.Annotations))
|
||||
for k, _ := range this.Annotations {
|
||||
for k := range this.Annotations {
|
||||
keysForAnnotations = append(keysForAnnotations, k)
|
||||
}
|
||||
sortkeys.Strings(keysForAnnotations)
|
||||
@@ -10949,7 +10949,7 @@ func (this *PodSandboxStatusResponse) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForInfo := make([]string, 0, len(this.Info))
|
||||
for k, _ := range this.Info {
|
||||
for k := range this.Info {
|
||||
keysForInfo = append(keysForInfo, k)
|
||||
}
|
||||
sortkeys.Strings(keysForInfo)
|
||||
@@ -10980,7 +10980,7 @@ func (this *PodSandboxFilter) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabelSelector := make([]string, 0, len(this.LabelSelector))
|
||||
for k, _ := range this.LabelSelector {
|
||||
for k := range this.LabelSelector {
|
||||
keysForLabelSelector = append(keysForLabelSelector, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabelSelector)
|
||||
@@ -11012,7 +11012,7 @@ func (this *PodSandbox) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabels := make([]string, 0, len(this.Labels))
|
||||
for k, _ := range this.Labels {
|
||||
for k := range this.Labels {
|
||||
keysForLabels = append(keysForLabels, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabels)
|
||||
@@ -11022,7 +11022,7 @@ func (this *PodSandbox) String() string {
|
||||
}
|
||||
mapStringForLabels += "}"
|
||||
keysForAnnotations := make([]string, 0, len(this.Annotations))
|
||||
for k, _ := range this.Annotations {
|
||||
for k := range this.Annotations {
|
||||
keysForAnnotations = append(keysForAnnotations, k)
|
||||
}
|
||||
sortkeys.Strings(keysForAnnotations)
|
||||
@@ -11196,7 +11196,7 @@ func (this *ContainerConfig) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabels := make([]string, 0, len(this.Labels))
|
||||
for k, _ := range this.Labels {
|
||||
for k := range this.Labels {
|
||||
keysForLabels = append(keysForLabels, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabels)
|
||||
@@ -11206,7 +11206,7 @@ func (this *ContainerConfig) String() string {
|
||||
}
|
||||
mapStringForLabels += "}"
|
||||
keysForAnnotations := make([]string, 0, len(this.Annotations))
|
||||
for k, _ := range this.Annotations {
|
||||
for k := range this.Annotations {
|
||||
keysForAnnotations = append(keysForAnnotations, k)
|
||||
}
|
||||
sortkeys.Strings(keysForAnnotations)
|
||||
@@ -11331,7 +11331,7 @@ func (this *ContainerFilter) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabelSelector := make([]string, 0, len(this.LabelSelector))
|
||||
for k, _ := range this.LabelSelector {
|
||||
for k := range this.LabelSelector {
|
||||
keysForLabelSelector = append(keysForLabelSelector, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabelSelector)
|
||||
@@ -11364,7 +11364,7 @@ func (this *Container) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabels := make([]string, 0, len(this.Labels))
|
||||
for k, _ := range this.Labels {
|
||||
for k := range this.Labels {
|
||||
keysForLabels = append(keysForLabels, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabels)
|
||||
@@ -11374,7 +11374,7 @@ func (this *Container) String() string {
|
||||
}
|
||||
mapStringForLabels += "}"
|
||||
keysForAnnotations := make([]string, 0, len(this.Annotations))
|
||||
for k, _ := range this.Annotations {
|
||||
for k := range this.Annotations {
|
||||
keysForAnnotations = append(keysForAnnotations, k)
|
||||
}
|
||||
sortkeys.Strings(keysForAnnotations)
|
||||
@@ -11423,7 +11423,7 @@ func (this *ContainerStatus) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabels := make([]string, 0, len(this.Labels))
|
||||
for k, _ := range this.Labels {
|
||||
for k := range this.Labels {
|
||||
keysForLabels = append(keysForLabels, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabels)
|
||||
@@ -11433,7 +11433,7 @@ func (this *ContainerStatus) String() string {
|
||||
}
|
||||
mapStringForLabels += "}"
|
||||
keysForAnnotations := make([]string, 0, len(this.Annotations))
|
||||
for k, _ := range this.Annotations {
|
||||
for k := range this.Annotations {
|
||||
keysForAnnotations = append(keysForAnnotations, k)
|
||||
}
|
||||
sortkeys.Strings(keysForAnnotations)
|
||||
@@ -11467,7 +11467,7 @@ func (this *ContainerStatusResponse) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForInfo := make([]string, 0, len(this.Info))
|
||||
for k, _ := range this.Info {
|
||||
for k := range this.Info {
|
||||
keysForInfo = append(keysForInfo, k)
|
||||
}
|
||||
sortkeys.Strings(keysForInfo)
|
||||
@@ -11658,7 +11658,7 @@ func (this *ImageStatusResponse) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForInfo := make([]string, 0, len(this.Info))
|
||||
for k, _ := range this.Info {
|
||||
for k := range this.Info {
|
||||
keysForInfo = append(keysForInfo, k)
|
||||
}
|
||||
sortkeys.Strings(keysForInfo)
|
||||
@@ -11807,7 +11807,7 @@ func (this *StatusResponse) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForInfo := make([]string, 0, len(this.Info))
|
||||
for k, _ := range this.Info {
|
||||
for k := range this.Info {
|
||||
keysForInfo = append(keysForInfo, k)
|
||||
}
|
||||
sortkeys.Strings(keysForInfo)
|
||||
@@ -11910,7 +11910,7 @@ func (this *ContainerStatsFilter) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabelSelector := make([]string, 0, len(this.LabelSelector))
|
||||
for k, _ := range this.LabelSelector {
|
||||
for k := range this.LabelSelector {
|
||||
keysForLabelSelector = append(keysForLabelSelector, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabelSelector)
|
||||
@@ -11942,7 +11942,7 @@ func (this *ContainerAttributes) String() string {
|
||||
return "nil"
|
||||
}
|
||||
keysForLabels := make([]string, 0, len(this.Labels))
|
||||
for k, _ := range this.Labels {
|
||||
for k := range this.Labels {
|
||||
keysForLabels = append(keysForLabels, k)
|
||||
}
|
||||
sortkeys.Strings(keysForLabels)
|
||||
@@ -11952,7 +11952,7 @@ func (this *ContainerAttributes) String() string {
|
||||
}
|
||||
mapStringForLabels += "}"
|
||||
keysForAnnotations := make([]string, 0, len(this.Annotations))
|
||||
for k, _ := range this.Annotations {
|
||||
for k := range this.Annotations {
|
||||
keysForAnnotations = append(keysForAnnotations, k)
|
||||
}
|
||||
sortkeys.Strings(keysForAnnotations)
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
set -e
|
||||
|
||||
./in_parallel.sh "make RM=" "$(find . -maxdepth 2 -name "*.go" -printf "%h\n" | sort -u | sed -n 's/\.\/\(.*\)/\1\/\1/p')"
|
||||
./in_parallel.sh "make RM=" "$(find . -maxdepth 2 -name "*.go" -printf "%h\\n" | sort -u | sed -n 's/\.\/\(.*\)/\1\/\1/p')"
|
||||
|
||||
@@ -23,7 +23,7 @@ while true; do
|
||||
rand=$(((RANDOM % max_dialer) + 1))
|
||||
container=${dialer[$rand]}
|
||||
docker rm -f "$container" >/dev/null &
|
||||
unset dialer[$rand]
|
||||
unset "dialer[$rand]"
|
||||
dialer=("${dialer[@]}")
|
||||
fi
|
||||
|
||||
|
||||
1
extras/example/vendor/github.com/richo/GOSHOUT/README.MD
generated
vendored
1
extras/example/vendor/github.com/richo/GOSHOUT/README.MD
generated
vendored
@@ -1 +0,0 @@
|
||||
GOLANG LIBRARY TO PROD [SHOUTCLOUD](SHOUTCLOUD.IO)
|
||||
46
extras/example/vendor/github.com/richo/GOSHOUT/SHOUT.go
generated
vendored
46
extras/example/vendor/github.com/richo/GOSHOUT/SHOUT.go
generated
vendored
@@ -1,46 +0,0 @@
|
||||
package SHOUTCLOUD
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type SHOUTREQUEST struct {
|
||||
INPUT string
|
||||
}
|
||||
|
||||
type SHOUTRESPONSE struct {
|
||||
INPUT string
|
||||
OUTPUT string
|
||||
}
|
||||
|
||||
func UPCASE(THING_TO_YELL string) (string, error) {
|
||||
REQUEST := &SHOUTREQUEST{THING_TO_YELL}
|
||||
ENCODED, ERR := json.Marshal(REQUEST)
|
||||
if ERR != nil {
|
||||
return "", errors.New("COULDN'T MARSHALL THE REQUEST")
|
||||
}
|
||||
READER := bytes.NewReader(ENCODED)
|
||||
|
||||
// NO TLS, SO MUCH SADNESS.
|
||||
RESP, ERR := http.Post("http://API.SHOUTCLOUD.IO/V1/SHOUT",
|
||||
"application/json", READER)
|
||||
if ERR != nil {
|
||||
return "", errors.New("REQUEST FAILED CAN'T UPCASE ERROR MESSAGE HALP")
|
||||
}
|
||||
|
||||
BODYBYTES, ERR := ioutil.ReadAll(RESP.Body)
|
||||
if ERR != nil {
|
||||
return "", errors.New("COULDN'T READ BODY HALP")
|
||||
}
|
||||
|
||||
var BODY SHOUTRESPONSE
|
||||
if json.Unmarshal(BODYBYTES, &BODY) != nil {
|
||||
return "", errors.New("COULDN'T UNPACK RESPONSE")
|
||||
}
|
||||
|
||||
return BODY.OUTPUT, nil
|
||||
}
|
||||
11
extras/example/vendor/manifest
vendored
11
extras/example/vendor/manifest
vendored
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"version": 0,
|
||||
"dependencies": [
|
||||
{
|
||||
"importpath": "github.com/richo/GOSHOUT",
|
||||
"repository": "https://github.com/richo/GOSHOUT",
|
||||
"revision": "da80b9993cbabeba5d04ee1c31688313dd730ad8",
|
||||
"branch": "master"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -211,7 +211,7 @@ function generate_latest_map() {
|
||||
func (m ${latest_map_type}) String() string {
|
||||
buf := bytes.NewBufferString("{")
|
||||
for _, val := range m {
|
||||
fmt.Fprintf(buf, "%s: %s,\n", val.key, val.String())
|
||||
fmt.Fprintf(buf, "%s: %s,\\n", val.key, val.String())
|
||||
}
|
||||
fmt.Fprintf(buf, "}")
|
||||
return buf.String()
|
||||
|
||||
2
go.mod
2
go.mod
@@ -58,7 +58,7 @@ require (
|
||||
github.com/peterbourgon/runsvinit v2.0.0+incompatible
|
||||
github.com/pkg/errors v0.8.1
|
||||
github.com/prometheus/client_golang v1.5.0
|
||||
github.com/richo/GOSHOUT v0.0.0-20190205170632-a1a6db7f26e9
|
||||
github.com/richo/GOSHOUT v0.0.0-20160308183402-8e98c504bfae
|
||||
github.com/russross/blackfriday v0.0.0-20151020174500-a18a46c9b943 // indirect
|
||||
github.com/shurcooL/sanitized_anchor_name v0.0.0-20150822220530-244f5ac324cb // indirect
|
||||
github.com/sirupsen/logrus v1.4.2
|
||||
|
||||
2
go.sum
2
go.sum
@@ -266,6 +266,8 @@ github.com/prometheus/procfs v0.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURm
|
||||
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
|
||||
github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/richo/GOSHOUT v0.0.0-20160308183402-8e98c504bfae h1:/NoALPFmRKJ/attvODMptyCS0DUsPeiXYC5LfqV0ecM=
|
||||
github.com/richo/GOSHOUT v0.0.0-20160308183402-8e98c504bfae/go.mod h1:MSTsYcO3SGF1j/eewqZORAzbp3BUbisi2094EDP3+To=
|
||||
github.com/richo/GOSHOUT v0.0.0-20190205170632-a1a6db7f26e9 h1:2bCoptIvAKQ1O70dbwQHob8Pop8zIXJHlnVLRtf9pG8=
|
||||
github.com/richo/GOSHOUT v0.0.0-20190205170632-a1a6db7f26e9/go.mod h1:MSTsYcO3SGF1j/eewqZORAzbp3BUbisi2094EDP3+To=
|
||||
github.com/russross/blackfriday v0.0.0-20151020174500-a18a46c9b943 h1:Bn2ofKCNwK+UtM3PAsMzGGaxgViklwyVrl1cyzsHHGc=
|
||||
|
||||
@@ -20,7 +20,7 @@ PROBEID=$(docker_on "$HOST1" logs weavescope 2>&1 | grep "probe starting" | sed
|
||||
# container's PATH settings are respected, which isn't the case for
|
||||
# login shells.
|
||||
PIPEID=$(curl -s -f -X POST "http://$HOST1:4040/api/control/$PROBEID/$CID;<container>/docker_exec_container" | jq -r '.pipe')
|
||||
assert "(sleep 1 && echo 'echo \$PATH' && sleep 1) | wscat -b 'ws://$HOST1:4040/api/pipe/$PIPEID' | col -pb" "/ # 6necho \$PATH\n/home:/usr/bin\n/ # 6n"
|
||||
assert "(sleep 1 && echo 'echo \$PATH' && sleep 1) | wscat -b 'ws://$HOST1:4040/api/pipe/$PIPEID' | col -pb" "/ # 6necho \$PATH\\n/home:/usr/bin\\n/ # 6n"
|
||||
|
||||
assert_raises "curl -f -X POST 'http://$HOST1:4040/api/control/$PROBEID/$CID;<container>/docker_stop_container'"
|
||||
|
||||
|
||||
@@ -15,6 +15,6 @@ HOSTID=$($SSH "$HOST1" hostname)
|
||||
|
||||
# Execute 'echo foo' in the host tty and check its output
|
||||
PIPEID=$(curl -s -f -X POST "http://$HOST1:4040/api/control/$PROBEID/$HOSTID;<host>/host_exec" | jq -r '.pipe')
|
||||
assert "(sleep 1 && echo \"PS1=''; echo foo\" && sleep 1) | wscat -b 'ws://$HOST1:4040/api/pipe/$PIPEID' | col -pb | tail -n 1" "foo\n"
|
||||
assert "(sleep 1 && echo \"PS1=''; echo foo\" && sleep 1) | wscat -b 'ws://$HOST1:4040/api/pipe/$PIPEID' | col -pb | tail -n 1" "foo\\n"
|
||||
|
||||
scope_end_suite
|
||||
|
||||
@@ -32,8 +32,8 @@ func dummyServer(t *testing.T, expectedToken, expectedID string, expectedVersion
|
||||
t.Errorf("want %q, have %q", expectedVersion, have)
|
||||
}
|
||||
|
||||
if have := r.Header.Get("user-agent"); "Scope_Probe/"+expectedVersion!=have {
|
||||
t.Errorf("want %q, have %q","Scope_Probe/"+expectedVersion,have)
|
||||
if have := r.Header.Get("user-agent"); "Scope_Probe/"+expectedVersion != have {
|
||||
t.Errorf("want %q, have %q", "Scope_Probe/"+expectedVersion, have)
|
||||
}
|
||||
|
||||
var have report.Report
|
||||
|
||||
@@ -46,8 +46,7 @@ func (pc ProbeConfig) authorizeHeaders(headers http.Header) {
|
||||
}
|
||||
headers.Set(xfer.ScopeProbeIDHeader, pc.ProbeID)
|
||||
headers.Set(xfer.ScopeProbeVersionHeader, pc.ProbeVersion)
|
||||
headers.Set("user-agent","Scope_Probe/"+pc.ProbeVersion )
|
||||
|
||||
headers.Set("user-agent", "Scope_Probe/"+pc.ProbeVersion)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -399,7 +399,6 @@ func (c *container) controls() []string {
|
||||
default:
|
||||
return []string{StartContainer, RemoveContainer}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *container) GetNode() report.Node {
|
||||
|
||||
@@ -121,13 +121,13 @@ func NewRegistry(options RegistryOptions) (Registry, error) {
|
||||
images: map[string]docker_client.APIImages{},
|
||||
pipeIDToexecID: map[string]string{},
|
||||
|
||||
client: client,
|
||||
pipes: options.Pipes,
|
||||
interval: options.Interval,
|
||||
collectStats: options.CollectStats,
|
||||
hostID: options.HostID,
|
||||
handlerRegistry: options.HandlerRegistry,
|
||||
quit: make(chan chan struct{}),
|
||||
client: client,
|
||||
pipes: options.Pipes,
|
||||
interval: options.Interval,
|
||||
collectStats: options.CollectStats,
|
||||
hostID: options.HostID,
|
||||
handlerRegistry: options.HandlerRegistry,
|
||||
quit: make(chan chan struct{}),
|
||||
noCommandLineArguments: options.NoCommandLineArguments,
|
||||
noEnvironmentVariables: options.NoEnvironmentVariables,
|
||||
}
|
||||
|
||||
@@ -373,6 +373,7 @@ func (t *EbpfTracker) isDead() bool {
|
||||
return t.dead
|
||||
}
|
||||
|
||||
// Stop the tracker and wait for it to signal it has stopped
|
||||
func (t *EbpfTracker) Stop() {
|
||||
t.stop()
|
||||
if t.stopping != nil {
|
||||
|
||||
@@ -49,8 +49,8 @@ func servicePortString(p apiv1.ServicePort) string {
|
||||
|
||||
func (s *service) GetNode(probeID string) report.Node {
|
||||
latest := map[string]string{
|
||||
IP: s.Spec.ClusterIP,
|
||||
Type: string(s.Spec.Type),
|
||||
IP: s.Spec.ClusterIP,
|
||||
Type: string(s.Spec.Type),
|
||||
report.ControlProbeID: probeID,
|
||||
}
|
||||
if s.Spec.LoadBalancerIP != "" {
|
||||
|
||||
6
scope
6
scope
@@ -18,7 +18,7 @@ SCOPE_IMAGE="$SCOPE_IMAGE_NAME:$IMAGE_VERSION"
|
||||
# with care.
|
||||
SCOPE_CONTAINER_NAME="${SCOPE_CONTAINER_NAME:-weavescope}"
|
||||
SCOPE_APP_CONTAINER_NAME="${SCOPE_APP_CONTAINER_NAME:-weavescope-app}"
|
||||
IP_REGEXP="[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
|
||||
IP_REGEXP="[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}"
|
||||
IP_ADDR_CMD="find /sys/class/net -type l | xargs -n1 basename | grep -vE 'docker|veth|lo' | \
|
||||
xargs -n1 ip addr show | grep inet | awk '{ print \$2 }' | grep -oE '$IP_REGEXP'"
|
||||
LISTENING_IP_ADDR_CMD="for I in \$( $IP_ADDR_CMD ); do if curl -m 1 -s \${I}:4040 > /dev/null ; then echo \${I}; fi; done"
|
||||
@@ -112,11 +112,11 @@ check_docker_version() {
|
||||
}
|
||||
|
||||
check_probe_only() {
|
||||
echo "${ARGS}" | grep -q -E "\-\-no\-app|\-\-service\-token|\-\-probe\-only"
|
||||
echo "${ARGS}" | grep -q -E -e "--no-app|--service-token|--probe-only"
|
||||
}
|
||||
|
||||
check_listen_address_arg() {
|
||||
echo "${ARGS}" | grep -q -E "\-\-app\.http\.address"
|
||||
echo "${ARGS}" | grep -q -E -e "--app\\.http\\.address"
|
||||
}
|
||||
|
||||
check_docker_for_mac() {
|
||||
|
||||
@@ -241,13 +241,13 @@ var (
|
||||
ServerContainerNodeID: report.MakeNodeWith(
|
||||
|
||||
ServerContainerNodeID, map[string]string{
|
||||
docker.ContainerID: ServerContainerID,
|
||||
docker.ContainerName: ServerContainerName,
|
||||
docker.ContainerHostname: ServerContainerHostname,
|
||||
docker.ContainerState: report.StateRunning,
|
||||
docker.ContainerStateHuman: report.StateRunning,
|
||||
docker.ImageID: ServerContainerImageID,
|
||||
report.HostNodeID: ServerHostNodeID,
|
||||
docker.ContainerID: ServerContainerID,
|
||||
docker.ContainerName: ServerContainerName,
|
||||
docker.ContainerHostname: ServerContainerHostname,
|
||||
docker.ContainerState: report.StateRunning,
|
||||
docker.ContainerStateHuman: report.StateRunning,
|
||||
docker.ImageID: ServerContainerImageID,
|
||||
report.HostNodeID: ServerHostNodeID,
|
||||
docker.LabelPrefix + detailed.AmazonECSContainerNameLabel: "server",
|
||||
docker.LabelPrefix + "foo1": "bar1",
|
||||
docker.LabelPrefix + "foo2": "bar2",
|
||||
|
||||
@@ -10,11 +10,11 @@ jobs:
|
||||
steps:
|
||||
- checkout
|
||||
- run: cd build; make
|
||||
- run: docker run --rm -v "$PWD:$PWD" -w "$PWD" --entrypoint sh weaveworks/build-golang -c ./lint .
|
||||
- run: docker run --rm -v "$PWD:$PWD" -w "$PWD" --entrypoint sh weaveworks/build-golang -c ./shell-lint .
|
||||
- run: docker run --rm -v "$PWD/cover:/go/src/cover" -w "/go/src/cover" --entrypoint sh weaveworks/build-golang -c make
|
||||
- run: docker run --rm -v "$PWD/socks:/go/src/socks" -w "/go/src/socks" --entrypoint sh weaveworks/build-golang -c "make proxy"
|
||||
- run: docker run --rm -v "$PWD/runner:/go/src/runner" -w "/go/src/runner" --entrypoint sh weaveworks/build-golang -c make
|
||||
- run: docker run --rm -v "$PWD:$PWD" -w "$PWD" --entrypoint sh weaveworks/build-golang -c "./shell-lint ."
|
||||
- run: docker run --rm -v "$PWD:/go/src" -w "/go/src/cover" --entrypoint sh weaveworks/build-golang -c make
|
||||
- run: docker run --rm -v "$PWD:/go/src" -w "/go/src/socks" --entrypoint sh weaveworks/build-golang -c "make proxy"
|
||||
- run: docker run --rm -v "$PWD:/go/src" -w "/go/src/runner" --entrypoint sh weaveworks/build-golang -c make
|
||||
- run: docker run --rm -v "$PWD:/go/src" -w "/go/src" --entrypoint sh weaveworks/build-golang -c "./lint ./build ./config_management ./cover ./dependencies ./integration ./provisioning ./runner ./scheduler ./socks"
|
||||
|
||||
- deploy:
|
||||
command: |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.13.1-stretch
|
||||
FROM golang:1.14.4-stretch
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
curl \
|
||||
@@ -8,13 +8,16 @@ RUN apt-get update && \
|
||||
libprotobuf-dev \
|
||||
make \
|
||||
protobuf-compiler \
|
||||
python-pip \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python-requests \
|
||||
python-yaml \
|
||||
libssl-dev \
|
||||
python-openssl \
|
||||
shellcheck \
|
||||
unzip && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
RUN pip install attrs pyhcl yapf==0.16.2 flake8==3.3.0
|
||||
RUN pip3 install attrs==19.2.0 pyhcl yapf==0.16.2 flake8==3.3.0
|
||||
RUN curl -fsSLo shfmt https://github.com/mvdan/sh/releases/download/v1.3.0/shfmt_v1.3.0_linux_amd64 && \
|
||||
echo "b1925c2c405458811f0c227266402cf1868b4de529f114722c2e3a5af4ac7bb2 shfmt" | sha256sum -c && \
|
||||
chmod +x shfmt && \
|
||||
@@ -34,7 +37,7 @@ RUN go get -tags netgo \
|
||||
github.com/golang/protobuf/protoc-gen-go \
|
||||
github.com/kisielk/errcheck \
|
||||
github.com/mjibson/esc \
|
||||
github.com/prometheus/prometheus/cmd/promtool && \
|
||||
&& \
|
||||
rm -rf /go/pkg /go/src
|
||||
RUN mkdir protoc && \
|
||||
cd protoc && \
|
||||
|
||||
@@ -80,8 +80,9 @@ def cross_versions(config):
|
||||
def main(argv):
|
||||
try:
|
||||
config = _validate_input(argv)
|
||||
print(linesep.join('\t'.join(triple)
|
||||
for triple in cross_versions(config)))
|
||||
print(
|
||||
linesep.join('\t'.join(triple)
|
||||
for triple in cross_versions(config)))
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
exit(_ERROR_RUNTIME)
|
||||
|
||||
23
tools/lint
23
tools/lint
@@ -219,12 +219,16 @@ matches_any() {
|
||||
return 1
|
||||
}
|
||||
|
||||
filter_out() {
|
||||
read_patterns() {
|
||||
local patterns_file="$1"
|
||||
if [ -n "$patterns_file" ] && [ -r "$patterns_file" ]; then
|
||||
local patterns
|
||||
patterns=$(sed '/^#.*$/d ; /^\s*$/d' "$patterns_file") # Remove blank lines and comments before we start iterating.
|
||||
[ -n "$DEBUG" ] && echo >&2 "> Filters:" && echo >&2 "$patterns"
|
||||
sed '/^#.*$/d ; /^\s*$/d' "$patterns_file" # Remove blank lines and comments.
|
||||
fi
|
||||
}
|
||||
|
||||
filter_out() {
|
||||
local patterns="$1"
|
||||
if [ -n "$patterns" ]; then
|
||||
local filtered_out=()
|
||||
while read -r filename; do
|
||||
matches_any "$filename" "$patterns" && filtered_out+=("$filename") || echo "$filename"
|
||||
@@ -238,11 +242,13 @@ filter_out() {
|
||||
lint_directory() {
|
||||
local dirname="$1"
|
||||
local lint_result=0
|
||||
matches_any "$dirname" "$PATTERNS" && return 0
|
||||
[ -n "$DEBUG" ] && echo >&2 "> Linting directory: $dirname"
|
||||
# This test is just checking if there are any Go files in the directory
|
||||
if compgen -G "$dirname/*.go" >/dev/null; then
|
||||
lint_go "${dirname}" || lint_result=1
|
||||
fi
|
||||
find . -maxdepth 1 "$dirname" | filter_out "$LINT_IGNORE_FILE" | lint_files
|
||||
find "$dirname" -maxdepth 1 | filter_out "$PATTERNS" | lint_files || lint_result=1
|
||||
return $lint_result
|
||||
}
|
||||
|
||||
@@ -255,11 +261,12 @@ lint_directories() {
|
||||
}
|
||||
|
||||
list_directories() {
|
||||
if [ $# -gt 0 ]; then
|
||||
find "$@" \( -name vendor -o -name .git -o -name .cache -o -name .pkg \) -prune -o -type d
|
||||
fi
|
||||
find "$@" \( -name vendor -o -name .git -o -name .cache -o -name .pkg \) -prune -o -type d
|
||||
}
|
||||
|
||||
PATTERNS=$(read_patterns "$LINT_IGNORE_FILE")
|
||||
[ -n "$DEBUG" ] && echo >&2 "> Filters:" && echo >&2 "$PATTERNS"
|
||||
|
||||
if [ $# = 1 ] && [ -f "$1" ]; then
|
||||
lint "$1"
|
||||
else
|
||||
|
||||
@@ -18,8 +18,10 @@ resource "google_compute_instance" "tf_test_vm" {
|
||||
zone = "${var.gcp_zone}"
|
||||
count = "${var.num_hosts}"
|
||||
|
||||
disk {
|
||||
image = "${var.gcp_image}"
|
||||
boot_disk {
|
||||
initialize_params {
|
||||
image = "${var.gcp_image}"
|
||||
}
|
||||
}
|
||||
|
||||
tags = [
|
||||
|
||||
@@ -3,11 +3,11 @@ output "username" {
|
||||
}
|
||||
|
||||
output "public_ips" {
|
||||
value = ["${google_compute_instance.tf_test_vm.*.network_interface.0.access_config.0.assigned_nat_ip}"]
|
||||
value = ["${google_compute_instance.tf_test_vm.*.network_interface.0.access_config.0.nat_ip}"]
|
||||
}
|
||||
|
||||
output "private_ips" {
|
||||
value = ["${google_compute_instance.tf_test_vm.*.network_interface.0.address}"]
|
||||
value = ["${google_compute_instance.tf_test_vm.*.network_interface.0.network_ip}"]
|
||||
}
|
||||
|
||||
output "hostnames" {
|
||||
@@ -24,7 +24,7 @@ output "hostnames" {
|
||||
output "private_etc_hosts" {
|
||||
value = "${join("\n",
|
||||
"${formatlist("%v %v.%v.%v",
|
||||
google_compute_instance.tf_test_vm.*.network_interface.0.address,
|
||||
google_compute_instance.tf_test_vm.*.network_interface.0.network_ip,
|
||||
google_compute_instance.tf_test_vm.*.name,
|
||||
google_compute_instance.tf_test_vm.*.zone,
|
||||
var.app
|
||||
@@ -36,7 +36,7 @@ output "private_etc_hosts" {
|
||||
output "public_etc_hosts" {
|
||||
value = "${join("\n",
|
||||
"${formatlist("%v %v.%v.%v",
|
||||
google_compute_instance.tf_test_vm.*.network_interface.0.access_config.0.assigned_nat_ip,
|
||||
google_compute_instance.tf_test_vm.*.network_interface.0.access_config.0.nat_ip,
|
||||
google_compute_instance.tf_test_vm.*.name,
|
||||
google_compute_instance.tf_test_vm.*.zone,
|
||||
var.app
|
||||
@@ -47,8 +47,8 @@ output "public_etc_hosts" {
|
||||
output "ansible_inventory" {
|
||||
value = "${format("[all]\n%s", join("\n",
|
||||
"${formatlist("%v private_ip=%v",
|
||||
google_compute_instance.tf_test_vm.*.network_interface.0.access_config.0.assigned_nat_ip,
|
||||
google_compute_instance.tf_test_vm.*.network_interface.0.address
|
||||
google_compute_instance.tf_test_vm.*.network_interface.0.access_config.0.nat_ip,
|
||||
google_compute_instance.tf_test_vm.*.network_interface.0.network_ip
|
||||
)}"
|
||||
))}"
|
||||
}
|
||||
|
||||
@@ -23,41 +23,33 @@ $ pip install -r requirements.txt -t lib
|
||||
|
||||
- Run:
|
||||
```console
|
||||
$ appcfg.py --version $(date '+%Y%m%dt%H%M%S') update .
|
||||
XX:XX PM Application: positive-cocoa-90213; version: 1
|
||||
XX:XX PM Host: appengine.google.com
|
||||
XX:XX PM Starting update of app: positive-cocoa-90213, version: 1
|
||||
XX:XX PM Getting current resource limits.
|
||||
Your browser has been opened to visit:
|
||||
$ gcloud app deploy --version $(date '+%Y%m%dt%H%M%S') --project positive-cocoa-90213
|
||||
Services to deploy:
|
||||
|
||||
https://accounts.google.com/o/oauth2/auth?scope=...
|
||||
descriptor: [/Users/simon/weave/build-tools/scheduler/app.yaml]
|
||||
source: [/Users/simon/weave/build-tools/scheduler]
|
||||
target project: [positive-cocoa-90213]
|
||||
target service: [default]
|
||||
target version: [20200512t154238]
|
||||
target url: [https://positive-cocoa-90213.appspot.com]
|
||||
|
||||
If your browser is on a different machine then exit and re-run this
|
||||
application with the command-line parameter
|
||||
|
||||
--noauth_local_webserver
|
||||
Do you want to continue (Y/n)?
|
||||
|
||||
Authentication successful.
|
||||
XX:XX PM Scanning files on local disk.
|
||||
XX:XX PM Scanned 500 files.
|
||||
XX:XX PM Scanned 1000 files.
|
||||
XX:XX PM Cloning 1220 application files.
|
||||
XX:XX PM Uploading 28 files and blobs.
|
||||
XX:XX PM Uploaded 28 files and blobs.
|
||||
XX:XX PM Compilation starting.
|
||||
XX:XX PM Compilation completed.
|
||||
XX:XX PM Starting deployment.
|
||||
XX:XX PM Checking if deployment succeeded.
|
||||
XX:XX PM Will check again in 1 seconds.
|
||||
XX:XX PM Checking if deployment succeeded.
|
||||
XX:XX PM Will check again in 2 seconds.
|
||||
XX:XX PM Checking if deployment succeeded.
|
||||
XX:XX PM Will check again in 4 seconds.
|
||||
XX:XX PM Checking if deployment succeeded.
|
||||
XX:XX PM Deployment successful.
|
||||
XX:XX PM Checking if updated app version is serving.
|
||||
XX:XX PM Completed update of app: positive-cocoa-90213, version: 1
|
||||
XX:XX PM Uploading cron entries.
|
||||
Beginning deployment of service [default]...
|
||||
╔════════════════════════════════════════════════════════════╗
|
||||
╠═ Uploading 433 files to Google Cloud Storage ═╣
|
||||
╚════════════════════════════════════════════════════════════╝
|
||||
File upload done.
|
||||
Updating service [default]...done.
|
||||
Setting traffic split for service [default]...done.
|
||||
Deployed service [default] to [https://positive-cocoa-90213.appspot.com]
|
||||
|
||||
You can stream logs from the command line by running:
|
||||
$ gcloud app logs tail -s default
|
||||
|
||||
To view your application in the web browser run:
|
||||
$ gcloud app browse --project=positive-cocoa-90213
|
||||
```
|
||||
|
||||
- Go to [console.cloud.google.com](https://console.cloud.google.com) > Weave Integration Tests (`positive-cocoa-90213`) > AppEngine > Versions and ensure traffic is being directed to the newly deployed version.
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
application: positive-cocoa-90213
|
||||
version: 1
|
||||
runtime: python27
|
||||
api_version: 1
|
||||
threadsafe: true
|
||||
|
||||
@@ -82,14 +82,14 @@ def schedule(test_run, shard_count, shard):
|
||||
test_times_dict = dict(test_times)
|
||||
test_times.sort(key=operator.itemgetter(1))
|
||||
|
||||
shards = {i: [] for i in xrange(shard_count)}
|
||||
shards = {i: [] for i in range(shard_count)}
|
||||
while test_times:
|
||||
test_name, time = test_times.pop()
|
||||
|
||||
# find shortest shard and put it in that
|
||||
s, _ = min(
|
||||
((i, sum(test_times_dict[t] for t in shards[i]))
|
||||
for i in xrange(shard_count)),
|
||||
for i in range(shard_count)),
|
||||
key=operator.itemgetter(1))
|
||||
|
||||
shards[s].append(test_name)
|
||||
@@ -123,9 +123,6 @@ def _matches_any_regex(name, regexes):
|
||||
return matches
|
||||
|
||||
|
||||
# See also: https://circleci.com/account/api
|
||||
CIRCLE_CI_API_TOKEN = 'cffb83afd920cfa109cbd3e9eecb7511a2d18bb9'
|
||||
|
||||
# N.B.: When adding a project below, please ensure:
|
||||
# - its CircleCI project is either public, or is followed by the user attached
|
||||
# to the above API token
|
||||
@@ -137,8 +134,7 @@ PROJECTS = [
|
||||
('weaveworks/weave', 'positive-cocoa-90213', 'us-central1-a', True, None),
|
||||
('weaveworks/scope', 'scope-integration-tests', 'us-central1-a', False,
|
||||
None),
|
||||
('weaveworks/wks', 'wks-tests', 'us-central1-a', True,
|
||||
CIRCLE_CI_API_TOKEN),
|
||||
('weaveworks/wksctl', 'wks-tests', 'us-central1-a', True, None),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
flask==1.0.0
|
||||
google-api-python-client==1.6.7
|
||||
werkzeug<1.0
|
||||
|
||||
8
vendor/github.com/richo/GOSHOUT/SHOUT.go
generated
vendored
8
vendor/github.com/richo/GOSHOUT/SHOUT.go
generated
vendored
@@ -25,19 +25,13 @@ func UPCASE(THING_TO_YELL string) (string, error) {
|
||||
}
|
||||
READER := bytes.NewReader(ENCODED)
|
||||
|
||||
CLIENT := &http.Client{
|
||||
Timeout:time.Second * 20,
|
||||
}
|
||||
|
||||
// NO TLS, SO MUCH SADNESS.
|
||||
RESP, ERR := CLIENT.Post("http://API.SHOUTCLOUD.IO/V1/SHOUT",
|
||||
RESP, ERR := http.Post("http://API.SHOUTCLOUD.IO/V1/SHOUT",
|
||||
"application/json", READER)
|
||||
if ERR != nil {
|
||||
return "", errors.New("REQUEST FAILED CAN'T UPCASE ERROR MESSAGE HALP")
|
||||
}
|
||||
|
||||
defer RESP.Body.Close()
|
||||
|
||||
BODYBYTES, ERR := ioutil.ReadAll(RESP.Body)
|
||||
if ERR != nil {
|
||||
return "", errors.New("COULDN'T READ BODY HALP")
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -269,7 +269,7 @@ github.com/prometheus/common/model
|
||||
github.com/prometheus/procfs
|
||||
github.com/prometheus/procfs/internal/fs
|
||||
github.com/prometheus/procfs/internal/util
|
||||
# github.com/richo/GOSHOUT v0.0.0-20190205170632-a1a6db7f26e9
|
||||
# github.com/richo/GOSHOUT v0.0.0-20160308183402-8e98c504bfae
|
||||
github.com/richo/GOSHOUT
|
||||
# github.com/russross/blackfriday v0.0.0-20151020174500-a18a46c9b943
|
||||
github.com/russross/blackfriday
|
||||
|
||||
Reference in New Issue
Block a user