Skip to content

Commit 7b4760d

Browse files
authored
fix(application): selector with targetNamespace (#1502)
1 parent 48967e3 commit 7b4760d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Diff for: api/application/v1/conversion.go

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func AddFieldLabelConversionsForApp(scheme *runtime.Scheme) error {
4747
case "spec.tenantID",
4848
"spec.name",
4949
"spec.targetCluster",
50+
"spec.targetNamespace",
5051
"spec.type",
5152
"metadata.name":
5253
return label, value, nil

Diff for: pkg/application/registry/application/strategy.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ func MatchApplication(label labels.Selector, field fields.Selector) storage.Sele
159159
"spec.name",
160160
"spec.type",
161161
"spec.targetCluster",
162+
"spec.targetNamespace",
162163
"metadata.name",
163164
},
164165
}
@@ -168,10 +169,11 @@ func MatchApplication(label labels.Selector, field fields.Selector) storage.Sele
168169
func ToSelectableFields(app *application.App) fields.Set {
169170
objectMetaFieldsSet := genericregistry.ObjectMetaFieldsSet(&app.ObjectMeta, false)
170171
specificFieldsSet := fields.Set{
171-
"spec.tenantID": app.Spec.TenantID,
172-
"spec.name": app.Spec.Name,
173-
"spec.type": string(app.Spec.Type),
174-
"spec.targetCluster": app.Spec.TargetCluster,
172+
"spec.tenantID": app.Spec.TenantID,
173+
"spec.name": app.Spec.Name,
174+
"spec.type": string(app.Spec.Type),
175+
"spec.targetCluster": app.Spec.TargetCluster,
176+
"spec.targetNamespace": app.Spec.TargetNamespace,
175177
}
176178
return genericregistry.MergeFieldsSets(objectMetaFieldsSet, specificFieldsSet)
177179
}

0 commit comments

Comments
 (0)