Skip to content

Commit 0ce0361

Browse files
authored
Merge pull request #65 from sttts/sttts-deepcopy-panic
query/v1alpha1: fix deepcopy panic for non-objects in JSON
2 parents 5a36ec6 + 7d30942 commit 0ce0361

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
submodules: true
4242

4343
- name: Setup Go
44-
uses: actions/setup-go@v2
44+
uses: actions/setup-go@v5
4545
with:
4646
go-version: ${{ env.GO_VERSION }}
4747

@@ -70,10 +70,11 @@ jobs:
7070
# this action because it leaves 'annotations' (i.e. it comments on PRs to
7171
# point out linter violations).
7272
- name: Lint
73-
uses: golangci/golangci-lint-action@v2
73+
uses: golangci/golangci-lint-action@v4
7474
with:
7575
version: ${{ env.GOLANGCI_VERSION }}
76-
skip-go-installation: true
76+
skip-pkg-cache: true
77+
skip-build-cache: true
7778

7879
check-diff:
7980
runs-on: ubuntu-20.04
@@ -87,7 +88,7 @@ jobs:
8788
submodules: true
8889

8990
- name: Setup Go
90-
uses: actions/setup-go@v2
91+
uses: actions/setup-go@v5
9192
with:
9293
go-version: ${{ env.GO_VERSION }}
9394

@@ -130,7 +131,7 @@ jobs:
130131
run: git fetch --prune --unshallow
131132

132133
- name: Setup Go
133-
uses: actions/setup-go@v2
134+
uses: actions/setup-go@v5
134135
with:
135136
go-version: ${{ env.GO_VERSION }}
136137

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ linters:
101101
- govet
102102
- gocyclo
103103
- gocritic
104-
- interfacer
104+
# - interfacer # panic in spaces/v1alpha1
105105
- goconst
106106
- goimports
107107
- gofmt # We enable this as well as goimports for its simplify mode.

apis/query/v1alpha1/json.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (j *JSON) DeepCopy() *JSON {
5252
if j == nil {
5353
return nil
5454
}
55-
return &JSON{Object: runtime.DeepCopyJSONValue(j.Object).(map[string]interface{})}
55+
return &JSON{Object: runtime.DeepCopyJSONValue(j.Object)}
5656
}
5757

5858
// DeepCopyInto copies the receiver, writing into out.
@@ -64,7 +64,7 @@ func (j *JSON) DeepCopyInto(target *JSON) {
6464
target.Object = nil // shouldn't happen
6565
return
6666
}
67-
target.Object = runtime.DeepCopyJSONValue(j.Object).(map[string]interface{})
67+
target.Object = runtime.DeepCopyJSONValue(j.Object)
6868
}
6969

7070
// MarshalJSON implements json.Marshaler.

apis/spaces/v1alpha1/backup_types.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ package v1alpha1
1717
import (
1818
"reflect"
1919

20-
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
2120
corev1 "k8s.io/api/core/v1"
2221
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2322
"k8s.io/apimachinery/pkg/types"
23+
24+
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
2425
)
2526

2627
// +kubebuilder:object:root=true
@@ -194,6 +195,7 @@ type BackupStatus struct {
194195
Details BackupStatusDetails `json:"details,omitempty"`
195196
}
196197

198+
// BackupStatusDetails contains additional information about a backup.
197199
type BackupStatusDetails struct {
198200
// UploadedFileName is the name of the uploaded file.
199201
UploadedFileName string `json:"uploadedFileName,omitempty"`
@@ -207,6 +209,7 @@ type BackupStatusDetails struct {
207209
ControlPlane *PreciseLocalObjectReference `json:"controlPlane,omitempty"`
208210
}
209211

212+
// PreciseLocalObjectReference references by name and uid.
210213
type PreciseLocalObjectReference struct {
211214
// Name is the name of the referenced object.
212215
// +optional

0 commit comments

Comments
 (0)