Skip to content

Commit 5c8e16d

Browse files
Fix panic in checking for resource quota (#14)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
1 parent b794526 commit 5c8e16d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22.0-alpine3.19 AS build
1+
FROM golang:1.24.0-alpine3.19 AS build
22
RUN apk add -U --no-cache make git bash
33
COPY . /src/cattle-drive
44
WORKDIR /src/cattle-drive

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module rancherlabs/cattle-drive
22

3-
go 1.21.4
3+
go 1.24.0
44

55
replace (
66
github.com/rancher/rancher/pkg/apis => github.com/rancher/rancher/pkg/apis v0.0.0-20240205102821-ed248439462a

pkg/cluster/project.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ func newProject(obj v3.Project, prtbs []*ProjectRoleTemplateBinding, namespaces
3434
// normalize will remove unneeded fields in the spec to make it easier to compare
3535
func (p *Project) normalize() {
3636
p.Obj.Spec.ClusterName = ""
37-
p.Obj.Spec.ResourceQuota.UsedLimit = v3.ResourceQuotaLimit{}
37+
if p.Obj.Spec.ResourceQuota != nil {
38+
p.Obj.Spec.ResourceQuota.UsedLimit = v3.ResourceQuotaLimit{}
39+
}
3840
}
3941

4042
// mutate will change the project object to be suitable for recreation to the target cluster

0 commit comments

Comments
 (0)