Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changes/unreleased/Feature-20260217-165944.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Feature
body: Add the ability to register the runner for a given queue.
time: 2026-02-17T16:59:44.911992-05:00
2 changes: 1 addition & 1 deletion src/cmd/faktory.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

worker "github.com/contribsys/faktory_worker_go"
"github.com/mitchellh/mapstructure"
"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/opslevel/opslevel-runner/pkg"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func init() {
rootCmd.PersistentFlags().Int("job-pod-log-max-interval", 30, "The max amount of time between when pod logs are shipped to OpsLevel. Works in tandem with 'job-pod-log-max-size'")
rootCmd.PersistentFlags().Int("job-pod-log-max-size", 1000000, "The max amount in bytes to buffer before pod logs are shipped to OpsLevel. Works in tandem with 'job-pod-log-max-interval'")
rootCmd.PersistentFlags().Bool("job-agent-mode", false, "Enable agent mode with privileged security context for Container-in-Container support. WARNING: This grants elevated privileges and should only be enabled for trusted workloads.")
rootCmd.PersistentFlags().String("queue", "", "The queue this runner should process jobs from. Empty means the default queue.")

rootCmd.PersistentFlags().String("runner-pod-name", "", "overrides environment variable 'RUNNER_POD_NAME'")
rootCmd.PersistentFlags().String("runner-pod-namespace", "default", "The kubernetes namespace the runner pod is deployed in. Overrides environment variable 'RUNNER_POD_NAMESPACE'")
Expand All @@ -73,6 +74,7 @@ func init() {
viper.BindEnv("job-pod-log-max-interval", "OPSLEVEL_JOB_POD_LOG_MAX_INTERVAL")
viper.BindEnv("job-pod-log-max-size", "OPSLEVEL_JOB_POD_LOG_MAX_SIZE")
viper.BindEnv("job-agent-mode", "OPSLEVEL_JOB_AGENT_MODE")
viper.BindEnv("queue", "OPSLEVEL_QUEUE")

viper.BindEnv("runner-pod-name", "RUNNER_POD_NAME")
viper.BindEnv("runner-pod-namespace", "RUNNER_POD_NAMESPACE")
Expand Down
9 changes: 7 additions & 2 deletions src/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/opslevel/opslevel-runner/signal"

"github.com/getsentry/sentry-go"
"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/opslevel/opslevel-runner/pkg"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -53,7 +53,12 @@ func doRun(cmd *cobra.Command, args []string) {
runFaktory()
case "api":
client := pkg.NewGraphClient()
runner, err := client.RunnerRegister()
var registerArgs []string
if queue := viper.GetString("queue"); queue != "" {
log.Info().Str("queue", queue).Msg("Registering with queue")
registerArgs = append(registerArgs, queue)
}
runner, err := client.RunnerRegister(registerArgs...)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this + root.go are the only real changes, the rest is updating opslvel-go

pkg.CheckErr(err)

pkg.StartMetricsServer(string(runner.Id), viper.GetInt("metrics-port"))
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"time"

"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/opslevel/opslevel-runner/pkg"
"github.com/opslevel/opslevel-runner/signal"
"github.com/rs/zerolog/log"
Expand Down
8 changes: 3 additions & 5 deletions src/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/getsentry/sentry-go v0.29.1
github.com/go-resty/resty/v2 v2.17.1
github.com/mitchellh/mapstructure v1.5.0
github.com/opslevel/opslevel-go/v2024 v2024.12.24
github.com/opslevel/opslevel-go/v2026 v2026.2.18
github.com/prometheus/client_golang v1.20.5
github.com/rocktavious/autopilot/v2023 v2023.12.7
github.com/rs/zerolog v1.34.0
Expand All @@ -28,7 +28,7 @@ require (
require (
dario.cat/mergo v1.0.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
Expand All @@ -54,8 +54,6 @@ require (
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gosimple/slug v1.15.0 // indirect
github.com/gosimple/unidecode v1.0.1 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
github.com/hasura/go-graphql-client v0.15.1 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
Expand Down Expand Up @@ -108,4 +106,4 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)

//replace github.com/opslevel/opslevel-go/v2024 => ./submodules/opslevel-go
// replace github.com/opslevel/opslevel-go/v2026 => /Users/jason/workspace/opslevel-go
16 changes: 4 additions & 12 deletions src/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs=
github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
Expand All @@ -29,8 +29,6 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
Expand Down Expand Up @@ -92,12 +90,6 @@ github.com/gosimple/slug v1.15.0 h1:wRZHsRrRcs6b0XnxMUBM6WK1U1Vg5B0R7VkIf1Xzobo=
github.com/gosimple/slug v1.15.0/go.mod h1:UiRaFH+GEilHstLUmcBgWcI42viBN7mAb818JrYOeFQ=
github.com/gosimple/unidecode v1.0.1 h1:hZzFTMMqSswvf0LBJZCZgThIZrpDHFXux9KeGmn6T/o=
github.com/gosimple/unidecode v1.0.1/go.mod h1:CP0Cr1Y1kogOtx0bJblKzsVWrqYaqfNOnHzpgWw4Awc=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48=
github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw=
github.com/hasura/go-graphql-client v0.15.1 h1:mCb5I+8Bk3FU3GKWvf/zDXkTh7FbGlqJmP3oisBdnN8=
github.com/hasura/go-graphql-client v0.15.1/go.mod h1:jfSZtBER3or+88Q9vFhWHiFMPppfYILRyl+0zsgPIIw=
github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI=
Expand Down Expand Up @@ -157,8 +149,8 @@ github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk=
github.com/opslevel/moredefaults v0.0.0-20240529152742-17d1318a3c12 h1:OQZ3W8kbyCcdS8QUWFTnZd6xtdkfhdckc7Paro7nXio=
github.com/opslevel/moredefaults v0.0.0-20240529152742-17d1318a3c12/go.mod h1:g2GSXVP6LO+5+AIsnMRPN+BeV86OXuFRTX7HXCDtYeI=
github.com/opslevel/opslevel-go/v2024 v2024.12.24 h1:yqByehj/HBKcHV2xnZK9ozAhE+qQfXSWxtp6KLS1f9s=
github.com/opslevel/opslevel-go/v2024 v2024.12.24/go.mod h1:cIwzFyu8HURaGdZKWtKn4pijsyYs8xP8uuDwqgohWgo=
github.com/opslevel/opslevel-go/v2026 v2026.2.18 h1:uNGxdtLY5FFhT3GN2r2jpdOGqLu4fVQ/DdHd+t09HC4=
github.com/opslevel/opslevel-go/v2026 v2026.2.18/go.mod h1:FClwt6mxlVa2f4l+z/dUi5u8eYEiNJuSOWMhB6Y9JqI=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/go-resty/resty/v2"

"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/faktoryRunnerAppendJobLogProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

faktory "github.com/contribsys/faktory/client"
faktoryWorker "github.com/contribsys/faktory_worker_go"
"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/rs/zerolog"
)

Expand Down
2 changes: 1 addition & 1 deletion src/pkg/faktorySetOutcomeProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

faktory "github.com/contribsys/faktory/client"
faktoryWorker "github.com/contribsys/faktory_worker_go"
"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/rs/zerolog"
)

Expand Down
5 changes: 3 additions & 2 deletions src/pkg/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/remotecommand"

"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/rs/zerolog"
"github.com/spf13/viper"
)
Expand Down Expand Up @@ -126,6 +126,7 @@ func (s *JobRunner) getConfigMapObject(identifier string, job opslevel.RunnerJob
for _, file := range job.Files {
data[file.Name] = file.Contents
}
immutable := true
return &corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: identifier,
Expand All @@ -139,7 +140,7 @@ func (s *JobRunner) getConfigMapObject(identifier string, job opslevel.RunnerJob
// },
//},
},
Immutable: opslevel.RefOf(true),
Immutable: &immutable,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny lint fix

Data: data,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/rocktavious/autopilot/v2023"
"github.com/rs/zerolog"
corev1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/leaderElection.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync"
"time"

"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/opslevelAppendLogProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/base64"
"time"

"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/rs/zerolog"
)

Expand Down
2 changes: 1 addition & 1 deletion src/pkg/sanitizeLogProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package pkg
import (
"strings"

"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
)

type SanitizeLogProcessor struct {
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/sanitizeLogProcessor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package pkg
import (
"testing"

"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/rocktavious/autopilot/v2023"
)

Expand Down
2 changes: 1 addition & 1 deletion src/pkg/setOutcomeVarLogProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"regexp"
"strings"

"github.com/opslevel/opslevel-go/v2024"
"github.com/opslevel/opslevel-go/v2026"
"github.com/rs/zerolog"
)

Expand Down