diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 39cd49a..ec0d31b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -15,15 +15,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version: '1.23.x' check-latest: true - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 #v6.1.1 with: version: v1.62 working-directory: . args: --config .github/golangci.yaml - skip-pkg-cache: true - skip-build-cache: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8f4ddd1..5cd40f8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,7 +15,7 @@ concurrency: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} SEMANTIC_RELEASE_PACKAGE: ${{ github.repository }} - GO_VERSION: '1.23' + GO_VERSION: '1.23.x' APP_NAME: orb-agent permissions: @@ -34,7 +34,7 @@ jobs: with: node-version: "lts/*" - name: Write package.json - uses: DamianReeves/write-file-action@master + uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 #v1.3 with: path: ./package.json write-mode: overwrite @@ -48,7 +48,7 @@ jobs: } } - name: Write .releaserc.json - uses: DamianReeves/write-file-action@master + uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 #v1.3 with: path: ./.releaserc.json write-mode: overwrite @@ -132,13 +132,13 @@ jobs: uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf #v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 #v3.8.0 - name: Login to Docker Hub - uses: docker/login-action@v3 + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 #v3.3.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -149,7 +149,7 @@ jobs: echo $BUILD_VERSION > ./agent/version/BUILD_VERSION.txt - name: Build image and push - uses: docker/build-push-action@v6 + uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 #v6.10.0 with: context: . file: agent/docker/Dockerfile @@ -174,7 +174,7 @@ jobs: with: node-version: "lts/*" - name: Write package.json - uses: DamianReeves/write-file-action@master + uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 #v1.3 with: path: ./package.json write-mode: overwrite @@ -188,7 +188,7 @@ jobs: } } - name: Write .releaserc.json - uses: DamianReeves/write-file-action@master + uses: DamianReeves/write-file-action@6929a9a6d1807689191dcc8bbe62b54d70a32b42 #v1.3 with: path: ./.releaserc.json write-mode: overwrite diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8d20830..4bdf64f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -32,9 +32,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version: '1.23.x' check-latest: true - name: Run go build run: go build ./... @@ -54,14 +54,14 @@ jobs: if: always() run: cat .coverage/test-report.md - name: Find comment - uses: peter-evans/find-comment@v3 + uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e #v3.1.0 id: existing-comment with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' body-includes: Go test coverage - name: Post comment - uses: peter-evans/create-or-update-comment@v4 + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 #v4.0.0 with: comment-id: ${{ steps.existing-comment.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} diff --git a/agent/backend/devicediscovery/device_discovery.go b/agent/backend/devicediscovery/device_discovery.go index 2ace611..40bfe25 100644 --- a/agent/backend/devicediscovery/device_discovery.go +++ b/agent/backend/devicediscovery/device_discovery.go @@ -109,12 +109,14 @@ func (d *deviceDiscoveryBackend) Start(ctx context.Context, cancelFunc context.C "--host", d.apiHost, "--port", d.apiPort, "--diode-target", d.diodeTarget, - "--diode-api-key", d.diodeAPIKey, + "--diode-api-key", "********", "--diode-app-name-prefix", d.diodeAppNamePrefix, } d.logger.Info("device-discovery startup", zap.Strings("arguments", pvOptions)) + pvOptions[7] = d.diodeAPIKey + d.proc = cmd.NewCmdOptions(cmd.Options{ Buffered: false, Streaming: true, diff --git a/agent/backend/networkdiscovery/network_discovery.go b/agent/backend/networkdiscovery/network_discovery.go index c9f331e..9882ed9 100644 --- a/agent/backend/networkdiscovery/network_discovery.go +++ b/agent/backend/networkdiscovery/network_discovery.go @@ -109,12 +109,14 @@ func (d *networkDiscoveryBackend) Start(ctx context.Context, cancelFunc context. "--host", d.apiHost, "--port", d.apiPort, "--diode-target", d.diodeTarget, - "--diode-api-key", d.diodeAPIKey, + "--diode-api-key", "********", "--diode-app-name-prefix", d.diodeAppNamePrefix, } d.logger.Info("network-discovery startup", zap.Strings("arguments", pvOptions)) + pvOptions[7] = d.diodeAPIKey + d.proc = cmd.NewCmdOptions(cmd.Options{ Buffered: false, Streaming: true, diff --git a/agent/config/cloud.go b/agent/config/cloud.go index 894f0a5..064b63e 100644 --- a/agent/config/cloud.go +++ b/agent/config/cloud.go @@ -70,7 +70,6 @@ func (cc *cloudConfigManager) request(address string, token string, response int return err } req.Header.Add("Content-Type", "application/json") - cc.logger.Debug("cloud api request", zap.String("url", req.URL.String()), zap.ByteString("body", body)) req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token)) res, getErr := client.Do(req)