From 2c1da19988eec6ba562e9c3eec5ed04ee9385fe2 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:11:34 -0500 Subject: [PATCH 1/3] Fix index out of range error when no timestamp in log (#1215) Co-authored-by: Matthew Sandoval --- pkg/workceptor/kubernetes.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/workceptor/kubernetes.go b/pkg/workceptor/kubernetes.go index 063e750bb..4b208245f 100644 --- a/pkg/workceptor/kubernetes.go +++ b/pkg/workceptor/kubernetes.go @@ -385,14 +385,16 @@ func (kw *KubeUnit) kubeLoggingWithReconnect(streamWait *sync.WaitGroup, stdout } split := strings.SplitN(line, " ", 2) - timeStamp := ParseTime(split[0]) - if timeStamp != nil { - if !timeStamp.After(sinceTime) && !successfulWrite { + msg := line + timestamp := ParseTime(split[0]) + if timestamp != nil { + kw.GetWorkceptor().nc.GetLogger().Debug("No timestamp received, log line: '%s'", line) + if !timestamp.After(sinceTime) && !successfulWrite { continue } - sinceTime = *timeStamp + sinceTime = *timestamp + msg = split[1] } - msg := split[1] _, err = stdout.Write([]byte(msg)) if err != nil { From a2caa3ece7d5ddd559d025218eab59f3d1af41cb Mon Sep 17 00:00:00 2001 From: Matthew Sandoval Date: Wed, 20 Nov 2024 11:09:16 -0800 Subject: [PATCH 2/3] Update docs to include interacting with Receptor via unix sockets (#1212) --- docs/source/developer_guide.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/source/developer_guide.rst b/docs/source/developer_guide.rst index 7ba309606..c2924d4d3 100644 --- a/docs/source/developer_guide.rst +++ b/docs/source/developer_guide.rst @@ -11,6 +11,21 @@ Receptor is an open source project that lives at `ansible/receptor repository ` can be used to interact with unix sockets directly. + +Example: + +.. code-block:: bash + + echo -e '{"command": "work", "subcommand": "submit", "node": "execution", "worktype": "cat", }\n"Hi"' | socat - UNIX-CONNECT:/tmp/control.sock + ------- Linters ------- From 3d98c0136e1ac34905dc6ea24c7b48961bbd0ab3 Mon Sep 17 00:00:00 2001 From: Matthew Sandoval Date: Thu, 21 Nov 2024 09:10:41 -0800 Subject: [PATCH 3/3] Update GitHub actions to use go 1.22 (#1217) --- .github/workflows/build_binary_from_ref.yml | 2 +- .github/workflows/coverage_reporting.yml | 2 +- .github/workflows/promote.yml | 2 +- .github/workflows/pull_request.yml | 6 +++--- .github/workflows/test-reporting.yml | 2 +- .readthedocs.yaml | 2 +- docs/source/installation.rst | 2 +- go.mod | 2 +- packaging/container/Dockerfile | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_binary_from_ref.yml b/.github/workflows/build_binary_from_ref.yml index 9c28a66fe..10dce05c8 100644 --- a/.github/workflows/build_binary_from_ref.yml +++ b/.github/workflows/build_binary_from_ref.yml @@ -26,7 +26,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: build-all target run: make receptor diff --git a/.github/workflows/coverage_reporting.yml b/.github/workflows/coverage_reporting.yml index 6cd664415..7e64cf05d 100644 --- a/.github/workflows/coverage_reporting.yml +++ b/.github/workflows/coverage_reporting.yml @@ -7,7 +7,7 @@ on: # yamllint disable-line rule:truthy branches: [devel] env: - DESIRED_GO_VERSION: '1.20' + DESIRED_GO_VERSION: '1.22' jobs: go_test_coverage: diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index 6af6ca135..f576315d9 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -86,7 +86,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Build packages run: | diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9672f1613..bb1b2ef5e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,7 +5,7 @@ on: # yamllint disable-line rule:truthy pull_request: # yamllint disable-line rule:empty-values env: - DESIRED_GO_VERSION: '1.20' + DESIRED_GO_VERSION: '1.22' DESIRED_GOLANGCI_LINT_VERSION: 'v1.60' DESIRED_PYTHON_VERSION: '3.12' @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: ["1.20", "1.21"] + go-version: ["1.22"] steps: - name: Checkout uses: actions/checkout@v4 @@ -104,7 +104,7 @@ jobs: python-version: ${{ matrix.python-version }} session: tests-${{ matrix.python-version }} download-receptor: true - go-version: '1.20' + go-version: '1.22' lint-receptorctl: name: Lint receptorctl${{ '' }} # Nest jobs under the same sidebar category diff --git a/.github/workflows/test-reporting.yml b/.github/workflows/test-reporting.yml index bc2891063..6d2788890 100644 --- a/.github/workflows/test-reporting.yml +++ b/.github/workflows/test-reporting.yml @@ -7,7 +7,7 @@ on: # yamllint disable-line rule:truthy branches: [devel] env: - DESIRED_GO_VERSION: '1.20' + DESIRED_GO_VERSION: '1.22' jobs: generate_junit_test_report: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index fe21907be..740430fa0 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-lts-latest tools: - golang: "1.21" + golang: "1.22" python: "3.12" # You can also specify other tool versions: # nodejs: "20" diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 40b73ee9f..3e9a2f69e 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -6,7 +6,7 @@ Installation guide Download and extract precompiled binary for your OS and platform from `the releases page on GitHub `_ -Alternatively, you can compile Receptor from source code (Golang 1.20+ required) +Alternatively, you can compile Receptor from source code (Golang 1.22+ required) .. code-block:: bash diff --git a/go.mod b/go.mod index 576be26bf..d9def134b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ansible/receptor -go 1.21 +go 1.22 require ( github.com/creack/pty v1.1.23 diff --git a/packaging/container/Dockerfile b/packaging/container/Dockerfile index 7ec8d6640..21ec3566b 100644 --- a/packaging/container/Dockerfile +++ b/packaging/container/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/ubi:9.4 AS builder +FROM registry.access.redhat.com/ubi9/ubi:9.5 AS builder ARG VERSION RUN dnf -y update && \ @@ -9,7 +9,7 @@ ADD source.tar.gz /source WORKDIR /source RUN make VERSION=${VERSION} -FROM registry.access.redhat.com/ubi9/ubi:9.4 +FROM registry.access.redhat.com/ubi9/ubi:9.5 ARG VERSION LABEL license="ASL2"