Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump go to v1.23.4 #48

Merged
merged 1 commit into from
Feb 14, 2025
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
4 changes: 2 additions & 2 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM registry.suse.com/bci/golang:1.22.8
FROM registry.suse.com/bci/golang:1.23

Choose a reason for hiding this comment

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

Should this be pinned to 1.23.4?

Copy link
Member Author

Choose a reason for hiding this comment

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

From other related PRs, seems bci base image is 1.23 now, it may be slightly different with go version itself

https://github.com/rancher/support-bundle-kit/pull/132/files#diff-3598233dce47ce9c207a77a9f23394d45235397dd66d7dd9de909487e1bd8e8aL1

ARG DAPPER_HOST_ARCH
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}

RUN zypper -n rm container-suseconnect && \
zypper -n install git curl docker gzip tar wget awk
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.57.1
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.64.4

# The docker version in dapper is too old to have buildx. Install it manually.
RUN curl -sSfL https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-${ARCH} -o buildx-v0.17.1.linux-${ARCH} && \
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/harvester/harvester-load-balancer

go 1.22.8
go 1.23.4

replace (
github.com/containerd/containerd => github.com/containerd/containerd v1.6.18
Expand Down
4 changes: 4 additions & 0 deletions pkg/lb/servicelb/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,14 @@ func (m *Manager) generateOneProber(lb *lbv1.LoadBalancer, ep *discoveryv1.Endpo
if lb.Spec.HealthCheck.TimeoutSeconds == 0 {
option.Timeout = defaultTimeout
} else {
// escape gosec error: G115: integer overflow conversion uint -> int64 (gosec)
//#nosec
option.Timeout = time.Duration(lb.Spec.HealthCheck.TimeoutSeconds) * time.Second
}
if lb.Spec.HealthCheck.PeriodSeconds == 0 {
option.Period = defaultPeriod
} else {
//#nosec
option.Period = time.Duration(lb.Spec.HealthCheck.PeriodSeconds) * time.Second
}
if ep.Conditions.Ready != nil {
Expand All @@ -472,6 +475,7 @@ func unMarshalUID(uid string) (namespace, name string, err error) {
}

func marshalPorberAddress(lb *lbv1.LoadBalancer, ep *discoveryv1.Endpoint) string {
//#nosec
return ep.Addresses[0] + ":" + strconv.Itoa(int(lb.Spec.HealthCheck.Port))
}

Expand Down
16 changes: 10 additions & 6 deletions pkg/webhook/loadbalancer/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ func (c *converter) convertFromV1alpha1ToV1beta1(obj *unstructured.Unstructured)
for _, listener := range listeners {
l := listener.(map[string]interface{})
v1beta1Listeners = append(v1beta1Listeners, lbv1beta1.Listener{
Name: l[keyName].(string),
Port: int32(l[keyPort].(int64)),
Protocol: corev1.Protocol(l[keyProtocol].(string)),
Name: l[keyName].(string),
//#nosec
Port: int32(l[keyPort].(int64)),
Protocol: corev1.Protocol(l[keyProtocol].(string)),
//#nosec
BackendPort: int32(l[keyBackendPort].(int64)),
})
}
Expand Down Expand Up @@ -133,9 +135,11 @@ func (c *converter) convertFromV1beta1ToV1alpha1(obj *unstructured.Unstructured)
for _, listener := range listeners {
l := listener.(map[string]interface{})
v1alpha1Listeners = append(v1alpha1Listeners, &lbv1alpha1.Listener{
Name: l[keyName].(string),
Port: int32(l[keyPort].(int64)),
Protocol: corev1.Protocol(l[keyProtocol].(string)),
Name: l[keyName].(string),
//#nosec
Port: int32(l[keyPort].(int64)),
Protocol: corev1.Protocol(l[keyProtocol].(string)),
//#nosec
BackendPort: int32(l[keyBackendPort].(int64)),
})
}
Expand Down
1 change: 1 addition & 0 deletions pkg/webhook/loadbalancer/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func checkHealthyCheck(lb *lbv1.LoadBalancer) error {
wrongProtocol := false
for _, listener := range lb.Spec.Listeners {
// check listener port and protocol, only TCP is supported now
//#nosec
if uint(listener.BackendPort) == lb.Spec.HealthCheck.Port {
if listener.Protocol == corev1.ProtocolTCP {
if lb.Spec.HealthCheck.SuccessThreshold == 0 {
Expand Down
Loading