Skip to content

Commit

Permalink
Merge pull request #1021 from openshift-kni/even-more-gh-actions-bump
Browse files Browse the repository at this point in the history
gh actions: bump setup-go, fix inconsistent naming
  • Loading branch information
ffromani authored Sep 24, 2024
2 parents cdc1f41 + ccbc373 commit c58a482
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.4

Expand All @@ -34,7 +34,7 @@ jobs:
fetch-depth: 0

- name: Set up golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.4

Expand All @@ -55,7 +55,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.4

Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Set up golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Set up golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.4

Expand All @@ -49,7 +49,7 @@ jobs:
run: |
# kind is part of 20.04 image, see relevant READMEs in https://github.com/actions/virtual-environments/tree/main/images/linux
kind version
kind create cluster --config=hack/kind-config-e2e-no-registry.yaml --image kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb
kind create cluster --config=hack/kind-config-e2e-no-registry.yaml --image kindest/node:v1.30.4@sha256:976ea815844d5fa93be213437e3ff5754cd599b040946b5cca43ca45c2047114
kubectl label node kind-worker node-role.kubernetes.io/worker=''
- name: Deploy NUMA Resources Operator
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/e2e.yml → .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Set up golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.4

Expand All @@ -38,7 +38,8 @@ jobs:
- name: build test binary
run: |
make build-tools binary-e2e-rte binary-e2e-install binary-e2e-uninstall
make build-tools-all binary-e2e-rte binary-e2e-install binary-e2e-uninstall bin/catkubeletconfmap
ls -lh bin/
- name: Build image
run: |
Expand All @@ -48,7 +49,7 @@ jobs:
run: |
# kind is part of 20.04 image, see relevant READMEs in https://github.com/actions/virtual-environments/tree/main/images/linux
kind version
kind create cluster --config=hack/kind-config-e2e-no-registry.yaml --image kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb
kind create cluster --config=hack/kind-config-e2e-no-registry.yaml --image kindest/node:v1.30.4@sha256:976ea815844d5fa93be213437e3ff5754cd599b040946b5cca43ca45c2047114
kubectl label node kind-worker node-role.kubernetes.io/worker=''
kind load docker-image ${built_image}
Expand All @@ -59,7 +60,7 @@ jobs:
- name: E2E Tests
run: |
export KUBECONFIG=${HOME}/.kube/config
bin/catkubeletconfigmap --namespace ${E2E_NAMESPACE_NAME} --prefix 'E2E_' >> $GITHUB_ENV
bin/catkubeletconfmap --wait 2m --namespace ${E2E_NAMESPACE_NAME} --prefix 'E2E_' >> $GITHUB_ENV
make test-e2e
- name: Export E2E Tests logs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.22.4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 0

- name: Setup golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
id: go
with:
go-version: 1.22.4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-testsuite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 0

- name: setup golang
uses: actions/setup-go@v4
uses: actions/setup-go@v5
id: go
with:
go-version: 1.22.4
Expand Down
2 changes: 0 additions & 2 deletions hack/kind-config-e2e-no-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ kubeadmConfigPatches:
topologyManagerPolicy: "single-numa-node"
topologyManagerScope: "container"
reservedSystemCPUs: "0"
featureGates:
KubeletPodResourcesGetAllocatable: true
memoryManagerPolicy: "Static"
systemReserved: {"memory" :"512Mi"}
kubeReserved: {"memory" :"512Mi"}
Expand Down
46 changes: 35 additions & 11 deletions tools/catkubeletconfmap/catkubeletconfmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ import (
"flag"
"fmt"
"log"
"time"

corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
k8swait "k8s.io/apimachinery/pkg/util/wait"

"sigs.k8s.io/controller-runtime/pkg/client"

Expand All @@ -32,26 +35,47 @@ import (
)

func main() {
var prefix string
var cmNamespace string
var cmName string
flag.StringVar(&cmNamespace, "namespace", "numaresources", "namespace to look the configmap into")
flag.StringVar(&cmName, "name", "numaresourcesoperator-worker", "name of the configmap to look for")
flag.StringVar(&prefix, "prefix", "", "prefix for the output")
prefix := ""
cmNamespace := "numaresources"
cmName := "numaresourcesoperator-worker"
waitTimeout := 0 * time.Second // no wait
waitInterval := 2 * time.Second // if we wait at all, this is the intervall between polls
waitImmediate := true // guarantee to call at least once, necessary with default timout

flag.StringVar(&cmNamespace, "namespace", cmNamespace, "namespace to look the configmap into")
flag.StringVar(&cmName, "name", cmName, "name of the configmap to look for")
flag.StringVar(&prefix, "prefix", prefix, "prefix for the output")
flag.DurationVar(&waitTimeout, "wait", waitTimeout, "retry till this time limit")
flag.Parse()

cli, err := clientutil.New()
if err != nil {
log.Fatalf("error creating a client: %v", err)
}

log.Printf("trying to fetch %s/%s...", cmNamespace, cmName)

ctx := context.Background()
key := client.ObjectKey{
Namespace: cmNamespace,
Name: cmName,
}
cm := corev1.ConfigMap{}
err = cli.Get(ctx, key, &cm)

err = k8swait.PollUntilContextTimeout(ctx, waitInterval, waitTimeout, waitImmediate, func(fctx context.Context) (bool, error) {
key := client.ObjectKey{
Namespace: cmNamespace,
Name: cmName,
}
ferr := cli.Get(fctx, key, &cm)
if ferr != nil {
if apierrors.IsNotFound(ferr) {
log.Printf("failed to get %s/%s - not found, retrying...", cmNamespace, cmName)
return false, nil
}
log.Printf("failed to get %s/%s: %v, aborting", cmNamespace, cmName, ferr)
return false, ferr
}
log.Printf("got %s/%s!", cmNamespace, cmName)
return true, nil
})

if err != nil {
log.Fatalf("error getting the ConfigMap %s/%s: %v", cmNamespace, cmName, err)
}
Expand Down

0 comments on commit c58a482

Please sign in to comment.