Skip to content

Commit 39d2db1

Browse files
committed
update crds
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>
1 parent 4b21f35 commit 39d2db1

File tree

3 files changed

+17
-31
lines changed

3 files changed

+17
-31
lines changed

deploy/crd/kcp.io/syncagent.kcp.io_publishedresources.yaml

-9
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,6 @@ spec:
410410
type: object
411411
type: array
412412
type: object
413-
<<<<<<< HEAD
414-
<<<<<<< HEAD
415413
object:
416414
description: |-
417415
Object describes how the related resource can be found on the origin side
@@ -654,13 +652,6 @@ spec:
654652
type: string
655653
type: object
656654
type: object
657-
=======
658-
optional:
659-
description: Optional indicates whether the related resource must be referenced.
660-
type: boolean
661-
>>>>>>> 2f5479b (update codegen)
662-
=======
663-
>>>>>>> 05c1537 (add the unit tests for related resources)
664655
origin:
665656
description: '"service" or "kcp"'
666657
type: string

internal/sync/syncer_related_test.go

+17-14
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,16 @@ func TestSyncerProcessingRelatedResources(t *testing.T) {
8383
localCRD: loadCRD("things"),
8484
pubRes: newPublishedResources([]syncagentv1alpha1.RelatedResourceSpec{
8585
{
86-
Identifier: "optional-secret",
86+
Identifier: "optional-credentials",
8787
Origin: "kcp",
8888
Kind: "Secret",
89-
Reference: syncagentv1alpha1.RelatedResourceReference{
90-
Name: syncagentv1alpha1.ResourceLocator{
91-
Path: "metadata.name",
92-
Regex: &syncagentv1alpha1.RegexResourceLocator{
93-
Replacement: "optional-credentials",
89+
Object: syncagentv1alpha1.RelatedResourceObject{
90+
RelatedResourceObjectSpec: syncagentv1alpha1.RelatedResourceObjectSpec{
91+
Reference: &syncagentv1alpha1.RelatedResourceObjectReference{
92+
Path: "metadata.name",
93+
Regex: &syncagentv1alpha1.RegularExpression{
94+
Replacement: "optional-credentials",
95+
},
9496
},
9597
},
9698
},
@@ -140,11 +142,13 @@ func TestSyncerProcessingRelatedResources(t *testing.T) {
140142
Identifier: "mandatory-credentials",
141143
Origin: "kcp",
142144
Kind: "Secret",
143-
Reference: syncagentv1alpha1.RelatedResourceReference{
144-
Name: syncagentv1alpha1.ResourceLocator{
145-
Path: "metadata.name",
146-
Regex: &syncagentv1alpha1.RegexResourceLocator{
147-
Replacement: "mandatory-credentials",
145+
Object: syncagentv1alpha1.RelatedResourceObject{
146+
RelatedResourceObjectSpec: syncagentv1alpha1.RelatedResourceObjectSpec{
147+
Reference: &syncagentv1alpha1.RelatedResourceObjectReference{
148+
Path: "metadata.name",
149+
Regex: &syncagentv1alpha1.RegularExpression{
150+
Replacement: "mandatory-credentials",
151+
},
148152
},
149153
},
150154
},
@@ -240,13 +244,12 @@ func TestSyncerProcessingRelatedResources(t *testing.T) {
240244
remoteClient := buildFakeClient(testcase.remoteObject, testcase.remoteRelatedSecret)
241245

242246
syncer, err := NewResourceSyncer(
243-
// zap.Must(zap.NewDevelopment()).Sugar(),
244-
zap.NewNop().Sugar(),
247+
zap.Must(zap.NewDevelopment()).Sugar(),
248+
//zap.NewNop().Sugar(),
245249
localClient,
246250
remoteClient,
247251
testcase.pubRes,
248252
testcase.localCRD,
249-
testcase.remoteAPIGroup,
250253
nil,
251254
stateNamespace,
252255
"textor-the-doctor",

sdk/applyconfiguration/syncagent/v1alpha1/relatedresourcespec.go

-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)