Skip to content

Commit bfcb666

Browse files
committed
make selecting ARS easier by labelling them with the agent name
On-behalf-of: @SAP [email protected]
1 parent 23b8553 commit bfcb666

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

internal/controller/apiresourceschema/controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ func (r *Reconciler) createAPIResourceSchema(ctx context.Context, log *zap.Sugar
210210
syncagentv1alpha1.SourceGenerationAnnotation: fmt.Sprintf("%d", projectedCRD.Generation),
211211
syncagentv1alpha1.AgentNameAnnotation: r.agentName,
212212
}
213+
ars.Labels = map[string]string{
214+
syncagentv1alpha1.AgentNameLabel: r.agentName,
215+
}
213216
ars.Spec.Group = converted.Spec.Group
214217
ars.Spec.Names = converted.Spec.Names
215218
ars.Spec.Scope = converted.Spec.Scope

sdk/apis/syncagent/v1alpha1/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ const (
2020
// AgentNameAnnotation records which Sync Agent has created an APIResourceSchema.
2121
AgentNameAnnotation = "syncagent.kcp.io/agent-name"
2222

23+
// AgentNameLabel records which Sync Agent has created an APIResourceSchema.
24+
AgentNameLabel = "syncagent.kcp.io/agent-name"
25+
2326
// SourceGenerationAnnotation is the annotation on APIResourceSchemas that tells us
2427
// what generation of the CRD it was based on. This can be helpful in debugging,
2528
// as ARS resources cannot be updated, i.e. changes to CRDs are not reflected in ARS.

0 commit comments

Comments
 (0)