Skip to content

Commit

Permalink
deps: update nix lock file (#870)
Browse files Browse the repository at this point in the history
* deps: update nix lock file

* azure-no-agent: run nix fmt

* qemu-static: use upstream src

* go: remove deprecated linter

> "The linter 'exportloopref' is deprecated (since v1.60.2) due to:
> Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by
> copyloopvar.

We already use copyloopvar.

* memstore: don't use predeclared identifier clear

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tom Dohrmann <[email protected]>
  • Loading branch information
renovate[bot] and Freax13 authored Sep 11, 2024
1 parent db8e64b commit e58e0c6
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 62 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ linters:
- errchkjson
- errname
- errorlint
- exportloopref
- forcetypeassert
- gocheckcompilerdirectives
- gochecknoinits
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions internal/memstore/memstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func TestStoreConcurrent(t *testing.T) {
defer wg.Done()
s.Set(key, value)
}
clear := func() {
clearStore := func() {
defer wg.Done()
s.Clear()
}
Expand All @@ -187,10 +187,10 @@ func TestStoreConcurrent(t *testing.T) {
}

wg.Add(16)
go clear()
go clear()
go clear()
go clear()
go clearStore()
go clearStore()
go clearStore()
go clearStore()
go set("foo", 1)
go set("bar", 2)
go set("baz", 3)
Expand All @@ -199,10 +199,10 @@ func TestStoreConcurrent(t *testing.T) {
go getAll()
go getAll()
go getAll()
go clear()
go clear()
go clear()
go clear()
go clearStore()
go clearStore()
go clearStore()
go clearStore()
wg.Wait()

s.Clear()
Expand Down
74 changes: 36 additions & 38 deletions packages/by-name/azure-no-agent/no-agent.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
#!/bin/bash
# Copyright 2024 Edgeless Systems GmbH
# SPDX-License-Identifier: AGPL-3.0-only

attempts=1
until [ "$attempts" -gt 5 ]
do
echo "obtaining goal state - attempt $attempts"
goalstate=$(curl --fail -v -X 'GET' -H "x-ms-agent-name: azure-vm-register" \
-H "Content-Type: text/xml;charset=utf-8" \
-H "x-ms-version: 2012-11-30" \
"http://168.63.129.16/machine/?comp=goalstate")
# shellcheck disable=SC2181
if [ $? -eq 0 ]
then
echo "successfully retrieved goal state"
retrieved_goal_state=true
break
fi
sleep 5
attempts=$((attempts+1))
until [ "$attempts" -gt 5 ]; do
echo "obtaining goal state - attempt $attempts"
goalstate=$(curl --fail -v -X 'GET' -H "x-ms-agent-name: azure-vm-register" \
-H "Content-Type: text/xml;charset=utf-8" \
-H "x-ms-version: 2012-11-30" \
"http://168.63.129.16/machine/?comp=goalstate")
# shellcheck disable=SC2181
if [ $? -eq 0 ]; then
echo "successfully retrieved goal state"
retrieved_goal_state=true
break
fi
sleep 5
attempts=$((attempts + 1))
done

if [ "$retrieved_goal_state" != "true" ]
then
echo "failed to obtain goal state - cannot register this VM"
exit 1
if [ "$retrieved_goal_state" != "true" ]; then
echo "failed to obtain goal state - cannot register this VM"
exit 1
fi

container_id=$(grep ContainerId <<< "$goalstate" | sed 's/\s*<\/*ContainerId>//g' | sed 's/\r$//')
instance_id=$(grep InstanceId <<< "$goalstate" | sed 's/\s*<\/*InstanceId>//g' | sed 's/\r$//')
container_id=$(grep ContainerId <<<"$goalstate" | sed 's/\s*<\/*ContainerId>//g' | sed 's/\r$//')
instance_id=$(grep InstanceId <<<"$goalstate" | sed 's/\s*<\/*InstanceId>//g' | sed 's/\r$//')

ready_doc=$(cat << EOF
ready_doc=$(
cat <<EOF
<?xml version="1.0" encoding="utf-8"?>
<Health xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GoalStateIncarnation>1</GoalStateIncarnation>
Expand All @@ -48,19 +48,17 @@ EOF
)

attempts=1
until [ "$attempts" -gt 5 ]
do
echo "registering with Azure - attempt $attempts"
curl --fail -v -X 'POST' -H "x-ms-agent-name: azure-vm-register" \
-H "Content-Type: text/xml;charset=utf-8" \
-H "x-ms-version: 2012-11-30" \
-d "$ready_doc" \
"http://168.63.129.16/machine?comp=health"
# shellcheck disable=SC2181
if [ $? -eq 0 ]
then
echo "successfully register with Azure"
break
fi
sleep 5 # sleep to prevent throttling from wire server
until [ "$attempts" -gt 5 ]; do
echo "registering with Azure - attempt $attempts"
curl --fail -v -X 'POST' -H "x-ms-agent-name: azure-vm-register" \
-H "Content-Type: text/xml;charset=utf-8" \
-H "x-ms-version: 2012-11-30" \
-d "$ready_doc" \
"http://168.63.129.16/machine?comp=health"
# shellcheck disable=SC2181
if [ $? -eq 0 ]; then
echo "successfully register with Azure"
break
fi
sleep 5 # sleep to prevent throttling from wire server
done
8 changes: 0 additions & 8 deletions packages/by-name/qemu-static/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
qemu,
libaio,
dtc,
fetchurl,
python3Packages,
}:
let
Expand All @@ -29,13 +28,6 @@ in
hostCpuTargets = [ "x86_64-softmmu" ];
})).overrideAttrs
(previousAttrs: rec {
version = "9.1.0-rc4";

src = fetchurl {
url = "https://download.qemu.org/qemu-${version}.tar.xz";
hash = "sha256-gnvAOou9nR+yU67yK4Sa2fM2ZChR8zINoLy12ZROhSw=";
};

configureFlags = previousAttrs.configureFlags ++ [
"-Dlinux_aio_path=${libaio}/lib"
"-Dlinux_fdt_path=${patchedDtc}/lib"
Expand Down

0 comments on commit e58e0c6

Please sign in to comment.