Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
update crds
Signed-off-by: Karol Szwaj <[email protected]>
  • Loading branch information
cnvergence committed Apr 11, 2025
commit 39d2db1c41480f037fb789b06072167bacf8cd9a
9 changes: 0 additions & 9 deletions deploy/crd/kcp.io/syncagent.kcp.io_publishedresources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@ spec:
type: object
type: array
type: object
<<<<<<< HEAD
<<<<<<< HEAD
object:
description: |-
Object describes how the related resource can be found on the origin side
Expand Down Expand Up @@ -654,13 +652,6 @@ spec:
type: string
type: object
type: object
=======
optional:
description: Optional indicates whether the related resource must be referenced.
type: boolean
>>>>>>> 2f5479b (update codegen)
=======
>>>>>>> 05c1537 (add the unit tests for related resources)
origin:
description: '"service" or "kcp"'
type: string
Expand Down
31 changes: 17 additions & 14 deletions internal/sync/syncer_related_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ func TestSyncerProcessingRelatedResources(t *testing.T) {
localCRD: loadCRD("things"),
pubRes: newPublishedResources([]syncagentv1alpha1.RelatedResourceSpec{
{
Identifier: "optional-secret",
Identifier: "optional-credentials",
Origin: "kcp",
Kind: "Secret",
Reference: syncagentv1alpha1.RelatedResourceReference{
Name: syncagentv1alpha1.ResourceLocator{
Path: "metadata.name",
Regex: &syncagentv1alpha1.RegexResourceLocator{
Replacement: "optional-credentials",
Object: syncagentv1alpha1.RelatedResourceObject{
RelatedResourceObjectSpec: syncagentv1alpha1.RelatedResourceObjectSpec{
Reference: &syncagentv1alpha1.RelatedResourceObjectReference{
Path: "metadata.name",
Regex: &syncagentv1alpha1.RegularExpression{
Replacement: "optional-credentials",
},
},
},
},
Expand Down Expand Up @@ -140,11 +142,13 @@ func TestSyncerProcessingRelatedResources(t *testing.T) {
Identifier: "mandatory-credentials",
Origin: "kcp",
Kind: "Secret",
Reference: syncagentv1alpha1.RelatedResourceReference{
Name: syncagentv1alpha1.ResourceLocator{
Path: "metadata.name",
Regex: &syncagentv1alpha1.RegexResourceLocator{
Replacement: "mandatory-credentials",
Object: syncagentv1alpha1.RelatedResourceObject{
RelatedResourceObjectSpec: syncagentv1alpha1.RelatedResourceObjectSpec{
Reference: &syncagentv1alpha1.RelatedResourceObjectReference{
Path: "metadata.name",
Regex: &syncagentv1alpha1.RegularExpression{
Replacement: "mandatory-credentials",
},
},
},
},
Expand Down Expand Up @@ -240,13 +244,12 @@ func TestSyncerProcessingRelatedResources(t *testing.T) {
remoteClient := buildFakeClient(testcase.remoteObject, testcase.remoteRelatedSecret)

syncer, err := NewResourceSyncer(
// zap.Must(zap.NewDevelopment()).Sugar(),
zap.NewNop().Sugar(),
zap.Must(zap.NewDevelopment()).Sugar(),
//zap.NewNop().Sugar(),
localClient,
remoteClient,
testcase.pubRes,
testcase.localCRD,
testcase.remoteAPIGroup,
nil,
stateNamespace,
"textor-the-doctor",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.