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
2 changes: 1 addition & 1 deletion .github/workflows/ci-check-gomod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6
- name: check
uses: codeready-toolchain/toolchain-cicd/gomod-check@master
4 changes: 2 additions & 2 deletions .github/workflows/ci-golang-sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Install Go
uses: actions/setup-go@v6
Expand All @@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Install Go
uses: actions/setup-go@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Run govulncheck
uses: codeready-toolchain/toolchain-cicd/govulncheck-action@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/operator-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-operators-for-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
# Checkout from PR event - in that case the comment field is empty
- name: Checkout code from PR event
uses: actions/checkout@v5
uses: actions/checkout@v6
if: ${{ github.event.comment == '' }}
with:
ref: ${{github.event.pull_request.head.ref}}
Expand All @@ -38,7 +38,7 @@ jobs:
# Checkout the code based on the data retrieved from the previous step
# Is executed only for comment events - in that case the pull_request field is empty
- name: Checkout code from PR
uses: actions/checkout@v5
uses: actions/checkout@v6
if: ${{ github.event.pull_request == '' }}
with:
repository: ${{ fromJson(steps.request.outputs.data).head.repo.full_name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-with-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
Expand Down
8 changes: 5 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"github.com/codeready-toolchain/host-operator/pkg/apis"
"github.com/codeready-toolchain/host-operator/pkg/capacity"
"github.com/codeready-toolchain/host-operator/pkg/cluster"
"github.com/codeready-toolchain/host-operator/pkg/constants"
"github.com/codeready-toolchain/host-operator/pkg/metrics"
"github.com/codeready-toolchain/host-operator/pkg/segment"
"github.com/codeready-toolchain/host-operator/pkg/templates/nstemplatetiers"
Expand All @@ -51,7 +52,7 @@
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth"

Check warning on line 55 in cmd/main.go

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add a comment explaining why this blank import is needed.

See more on https://sonarcloud.io/project/issues?id=codeready-toolchain_host-operator&issues=AZq8WmBYycWSRzrXTFiS&open=AZq8WmBYycWSRzrXTFiS&pullRequest=1215
"k8s.io/client-go/rest"
klogv1 "k8s.io/klog"
klogv2 "k8s.io/klog/v2"
Expand Down Expand Up @@ -181,12 +182,12 @@

if crtConfig.RegistrationService().Verification().CaptchaEnabled() {
if err := createCaptchaFileFromSecret(crtConfig.RegistrationService()); err != nil {
panic(fmt.Sprintf("failed to create captcha file: %s", err.Error()))

Check failure on line 185 in cmd/main.go

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Return an error instead of using panic for normal error conditions.

See more on https://sonarcloud.io/project/issues?id=codeready-toolchain_host-operator&issues=AZq8WmBYycWSRzrXTFiT&open=AZq8WmBYycWSRzrXTFiT&pullRequest=1215
}

// set application credentials env var required for recaptcha client
if err := os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", toolchainconfig.CaptchaFilePath); err != nil {
panic(fmt.Sprintf("cannot set captcha credentials: %s", err.Error()))

Check failure on line 190 in cmd/main.go

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Return an error instead of using panic for normal error conditions.

See more on https://sonarcloud.io/project/issues?id=codeready-toolchain_host-operator&issues=AZq8WmBYycWSRzrXTFiU&open=AZq8WmBYycWSRzrXTFiU&pullRequest=1215
}
}

Expand Down Expand Up @@ -227,9 +228,10 @@

// Setup all Controllers
if err = (&toolchainclusterresources.Reconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Templates: &deploy.ToolchainClusterTemplateFS,
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Templates: &deploy.ToolchainClusterTemplateFS,
FieldManager: constants.HostOperatorFieldManager,
}).SetupWithManager(mgr, namespace); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "ToolchainClusterResources")
os.Exit(1)
Expand Down
2 changes: 2 additions & 0 deletions deploy/templates/nstemplatetiers/base/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ objects:
limits.cpu: 40000m
limits.memory: ${MEMORY_LIMIT}
limits.ephemeral-storage: 15Gi
limits.nvidia.com/gpu: 0
requests.cpu: 6000m
requests.memory: ${MEMORY_REQUEST}
requests.storage: 60Gi
requests.ephemeral-storage: 15Gi
requests.nvidia.com/gpu: 0
count/persistentvolumeclaims: "5"
selector:
annotations: null
Expand Down
4 changes: 4 additions & 0 deletions deploy/templates/nstemplatetiers/base1ns/ns_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ objects:
hard:
limits.cpu: 30000m
limits.memory: ${MEMORY_LIMIT}
limits.nvidia.com/gpu: 0
requests.cpu: 3000m
requests.memory: ${MEMORY_REQUEST}
requests.nvidia.com/gpu: 0
- apiVersion: v1
kind: ResourceQuota
metadata:
Expand All @@ -88,8 +90,10 @@ objects:
hard:
limits.cpu: 20000m
limits.memory: ${MEMORY_BUILD_LIMIT}
limits.nvidia.com/gpu: 0
requests.cpu: 3000m
requests.memory: ${MEMORY_BUILD_REQUEST}
requests.nvidia.com/gpu: 0
- apiVersion: v1
kind: ResourceQuota
metadata:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/codeready-toolchain/host-operator
require (
cloud.google.com/go/recaptchaenterprise/v2 v2.13.0
github.com/codeready-toolchain/api v0.0.0-20251008084914-06282b83d4cd
github.com/codeready-toolchain/toolchain-common v0.0.0-20251006132314-2591ebe0bdb1
github.com/codeready-toolchain/toolchain-common v0.0.0-20251125180949-6ed5aeed75e4
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/go-logr/logr v1.4.2
github.com/gofrs/uuid v4.4.0+incompatible
Expand Down
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZ
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/codeready-toolchain/api v0.0.0-20251008084914-06282b83d4cd h1:A6WOUwlUdgOf4PDzzgKvycRj4Pk+1F6npWV4YoPVFcM=
github.com/codeready-toolchain/api v0.0.0-20251008084914-06282b83d4cd/go.mod h1:TiQ/yNv3cGL4nxo3fgRtcHyYYuRf+nAgs6B1IAqvxOU=
github.com/codeready-toolchain/toolchain-common v0.0.0-20251006132314-2591ebe0bdb1 h1:jqs4yOuJbfW3CKe1EMJkkDo47wTKQ4M1OKox4DYWsKg=
github.com/codeready-toolchain/toolchain-common v0.0.0-20251006132314-2591ebe0bdb1/go.mod h1:eySMK8JR/Py9eoUJlAkOXqvfPp1vjl39scgrECr99XM=
github.com/codeready-toolchain/toolchain-common v0.0.0-20251121173236-e8b11c5f0284 h1:19VrHE1M0XtKvuZyh0yrFTGf4NC/Z2Js7a/LkF5pGaE=
github.com/codeready-toolchain/toolchain-common v0.0.0-20251121173236-e8b11c5f0284/go.mod h1:5i7k9O0yVftzJwsjSjJjoXMYtUPkiirVsEswuaC8/5I=
github.com/codeready-toolchain/toolchain-common v0.0.0-20251125180949-6ed5aeed75e4 h1:OZd7C6PZMc3BL5CD2NAHxWc1VKtuSjRUJtvEuFBVDEE=
github.com/codeready-toolchain/toolchain-common v0.0.0-20251125180949-6ed5aeed75e4/go.mod h1:5i7k9O0yVftzJwsjSjJjoXMYtUPkiirVsEswuaC8/5I=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -200,6 +202,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/metlos/toolchain-common v0.0.0-20251111121252-51518cd65180 h1:MFy4SQFym+uNVFWmVwXr2T6F0o92WTXM1DOvLIgs09c=
github.com/metlos/toolchain-common v0.0.0-20251111121252-51518cd65180/go.mod h1:5i7k9O0yVftzJwsjSjJjoXMYtUPkiirVsEswuaC8/5I=
github.com/migueleliasweb/go-github-mock v0.0.18 h1:0lWt9MYmZQGnQE2rFtjlft/YtD6hzxuN6JJRFpujzEI=
github.com/migueleliasweb/go-github-mock v0.0.18/go.mod h1:CcgXcbMoRnf3rRVHqGssuBquZDIcaplxL2W6G+xs7kM=
github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
Expand Down
Loading