Skip to content

Commit 7fea9a3

Browse files
authored
upgrade ocm sdk-go (#448)
Signed-off-by: Wei Liu <liuweixa@redhat.com>
1 parent 7587be3 commit 7fea9a3

File tree

13 files changed

+68
-54
lines changed

13 files changed

+68
-54
lines changed

.github/workflows/e2e.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ jobs:
1717
e2e:
1818
runs-on: ubuntu-22.04
1919
steps:
20+
- name: Check initial disk usage
21+
run: df -h /
22+
- name: Free disk space (optional cleanup)
23+
run: |
24+
sudo rm -rf /usr/local/lib/android
25+
sudo rm -rf /opt/hostedtoolcache
26+
docker system prune -af
27+
df -h /
2028
- name: Checkout
2129
uses: actions/checkout@v4
2230
- name: Setup Go
@@ -35,6 +43,14 @@ jobs:
3543
e2e-broadcast-subscription:
3644
runs-on: ubuntu-22.04
3745
steps:
46+
- name: Check initial disk usage
47+
run: df -h /
48+
- name: Free disk space (optional cleanup)
49+
run: |
50+
sudo rm -rf /usr/local/lib/android
51+
sudo rm -rf /opt/hostedtoolcache
52+
docker system prune -af
53+
df -h /
3854
- name: Checkout
3955
uses: actions/checkout@v4
4056
- name: Setup Go
@@ -53,6 +69,14 @@ jobs:
5369
e2e-with-istio:
5470
runs-on: ubuntu-22.04
5571
steps:
72+
- name: Check initial disk usage
73+
run: df -h /
74+
- name: Free disk space (optional cleanup)
75+
run: |
76+
sudo rm -rf /usr/local/lib/android
77+
sudo rm -rf /opt/hostedtoolcache
78+
docker system prune -af
79+
df -h /
5680
- name: Checkout
5781
uses: actions/checkout@v4
5882
- name: Setup Go
@@ -68,6 +92,14 @@ jobs:
6892
e2e-grpc-broker:
6993
runs-on: ubuntu-22.04
7094
steps:
95+
- name: Check initial disk usage
96+
run: df -h /
97+
- name: Free disk space (optional cleanup)
98+
run: |
99+
sudo rm -rf /usr/local/lib/android
100+
sudo rm -rf /opt/hostedtoolcache
101+
docker system prune -af
102+
df -h /
71103
- name: Checkout
72104
uses: actions/checkout@v4
73105
- name: Setup Go

.tekton/integration-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ spec:
4848
dnf -y install jq git make
4949
5050
# Install golang with a given version
51-
export GOVERSION=1.24.4
51+
export GOVERSION=1.25.0
5252
curl -O -J https://dl.google.com/go/go$GOVERSION.linux-amd64.tar.gz
5353
rm -rf /usr/local/go && tar -C /usr/local -xzf go$GOVERSION.linux-amd64.tar.gz
5454

.tekton/unit-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ spec:
4848
dnf -y install jq git make
4949
5050
# Install golang with a given version
51-
export GOVERSION=1.24.4
51+
export GOVERSION=1.25.0
5252
curl -O -J https://dl.google.com/go/go$GOVERSION.linux-amd64.tar.gz
5353
rm -rf /usr/local/go && tar -C /usr/local -xzf go$GOVERSION.linux-amd64.tar.gz
5454

Containerfile.rhtap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.24 AS builder
1+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.25 AS builder
22

33
ENV SOURCE_DIR=/maestro
44
WORKDIR $SOURCE_DIR

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24 AS builder
1+
FROM golang:1.25 AS builder
22

33
ENV SOURCE_DIR=/maestro
44
WORKDIR $SOURCE_DIR

Dockerfile.e2e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24 AS builder
1+
FROM golang:1.25 AS builder
22

33
ENV SOURCE_DIR=/maestro
44
WORKDIR $SOURCE_DIR

cmd/maestro/server/event_server.go

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,25 +92,20 @@ func (s *MessageQueueEventServer) Start(ctx context.Context) {
9292
// startSubscription initiates the subscription to resource status update messages.
9393
// It runs asynchronously in the background until the provided context is canceled.
9494
func (s *MessageQueueEventServer) startSubscription(ctx context.Context) {
95-
s.sourceClient.Subscribe(ctx, func(subCtx context.Context, action types.ResourceAction, resource *api.Resource) error {
96-
logger := klog.FromContext(subCtx).WithValues("resourceID", resource.ID, "action", action)
97-
logger.Info("received action for resource")
95+
s.sourceClient.Subscribe(ctx, func(subCtx context.Context, resource *api.Resource) error {
96+
logger := klog.FromContext(subCtx).WithValues("resourceID", resource.ID)
97+
logger.Info("received status update for resource")
9898
subCtx = klog.NewContext(subCtx, logger)
9999

100-
switch action {
101-
case types.StatusModified:
102-
if !s.statusDispatcher.Dispatch(resource.ConsumerName) {
103-
// the resource is not owned by the current instance, skip
104-
logger.Info("skipping resource status update as it is not owned by the current instance")
105-
return nil
106-
}
100+
if !s.statusDispatcher.Dispatch(resource.ConsumerName) {
101+
// the resource is not owned by the current instance, skip
102+
logger.Info("skipping resource status update as it is not owned by the current instance")
103+
return nil
104+
}
107105

108-
// handle the resource status update according status update type
109-
if err := handleStatusUpdate(subCtx, resource, s.resourceService, s.statusEventService); err != nil {
110-
return fmt.Errorf("failed to handle resource status update %s: %s", resource.ID, err.Error())
111-
}
112-
default:
113-
return fmt.Errorf("failed to handle resource status update %s: unsupported action %s", resource.ID, action)
106+
// handle the resource status update according status update type
107+
if err := handleStatusUpdate(subCtx, resource, s.resourceService, s.statusEventService); err != nil {
108+
return fmt.Errorf("failed to handle resource status update %s: %s", resource.ID, err.Error())
114109
}
115110

116111
return nil

cmd/maestro/server/grpc_broker.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ import (
2929
"github.com/openshift-online/maestro/pkg/services"
3030
)
3131

32-
type resourceHandler func(res *api.Resource) error
33-
34-
// subscriber defines a subscriber that can receive and handle resource spec.
35-
type subscriber struct {
36-
clusterName string
37-
handler resourceHandler
38-
errChan chan<- error
39-
}
40-
4132
var _ EventServer = &GRPCBroker{}
4233

4334
type GRPCBrokerService struct {

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/openshift-online/maestro
22

3-
go 1.24.4
3+
go 1.25.0
44

55
require (
66
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0
@@ -55,9 +55,9 @@ require (
5555
k8s.io/component-base v0.34.2
5656
k8s.io/klog/v2 v2.130.1
5757
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
58-
open-cluster-management.io/api v1.1.1-0.20251124092621-2337d27c3b7f
58+
open-cluster-management.io/api v1.1.1-0.20251215032811-ee922fbb996c
5959
open-cluster-management.io/ocm v1.1.1-0.20251211014758-deb61b0a60d5
60-
open-cluster-management.io/sdk-go v1.1.1-0.20251209031938-62521c9935ac
60+
open-cluster-management.io/sdk-go v1.1.1-0.20251218031856-08bb1caedf74
6161
sigs.k8s.io/yaml v1.6.0
6262
)
6363

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,12 +829,14 @@ k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOP
829829
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=
830830
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
831831
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
832-
open-cluster-management.io/api v1.1.1-0.20251124092621-2337d27c3b7f h1:aOEXqgXvWSykMvzw9drHsLGUNP3xhsk1PcdRzfOVXoM=
833-
open-cluster-management.io/api v1.1.1-0.20251124092621-2337d27c3b7f/go.mod h1:Hk/3c114t6Ba5qhpqw+RoA93yEbE2CosG+JzzBZ6aCo=
832+
open-cluster-management.io/api v1.1.1-0.20251215032811-ee922fbb996c h1:LWZ+5dwVSNVM84eMBiQkygyYIlAudXSwQ6IM5LXr7QY=
833+
open-cluster-management.io/api v1.1.1-0.20251215032811-ee922fbb996c/go.mod h1:Hk/3c114t6Ba5qhpqw+RoA93yEbE2CosG+JzzBZ6aCo=
834834
open-cluster-management.io/ocm v1.1.1-0.20251211014758-deb61b0a60d5 h1:02XVQtUt8v/fw6n3Rbf7Tu4FHJVVW2MiQLSpThWLwro=
835835
open-cluster-management.io/ocm v1.1.1-0.20251211014758-deb61b0a60d5/go.mod h1:kaFjiXsxtUUwWChYIy/ojANeMMrDW1KUrliuKA55z/Q=
836836
open-cluster-management.io/sdk-go v1.1.1-0.20251209031938-62521c9935ac h1:Wt7rzenZqrtyYI58+lpe9tmf9e5Ft8Wwd0MyDwuJ4ck=
837837
open-cluster-management.io/sdk-go v1.1.1-0.20251209031938-62521c9935ac/go.mod h1:0EZ9M7AtD0b+x9lUo5pYlyFF2aKOk1y88looeOVybwU=
838+
open-cluster-management.io/sdk-go v1.1.1-0.20251218031856-08bb1caedf74 h1:Sf+w+8ZzJgUQez/ADk2FLhoVDl1hD4rJqLQfvCFuM1o=
839+
open-cluster-management.io/sdk-go v1.1.1-0.20251218031856-08bb1caedf74/go.mod h1:3xQf3gISaZ3377vFnwjH3QH8EF2UNaf8D9igLPUBChk=
838840
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM=
839841
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
840842
sigs.k8s.io/controller-runtime v0.22.4 h1:GEjV7KV3TY8e+tJ2LCTxUTanW4z/FmNB7l327UfMq9A=

0 commit comments

Comments
 (0)