Skip to content

Commit 57e8d1f

Browse files
committed
feat: add discription to RuleS2S spec
1 parent 8d2a283 commit 57e8d1f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

api/v1alpha1/rules2s_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ type RuleS2SSpec struct {
3737
// ServiceRef is a reference to the target service
3838
// +kubebuilder:validation:Required
3939
ServiceRef NamespacedObjectReference `json:"serviceRef"`
40+
41+
// +optional
42+
Description string `json:"description,omitempty"`
4043
}
4144

4245
// RuleS2SStatus defines the observed state of RuleS2S.

config/crd/bases/netguard.sgroups.io_rules2ses.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ spec:
3939
spec:
4040
description: RuleS2SSpec defines the desired state of RuleS2S.
4141
properties:
42+
description:
43+
type: string
4244
serviceLocalRef:
4345
description: ServiceLocalRef is a reference to the local service
4446
properties:

internal/controller/rules2s_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ func (r *RuleS2SReconciler) couldBeLegacyRuleForRuleS2S(
17611761
return false
17621762
}
17631763

1764-
// Check if rule has empty ports (the main indicator of the problem we're fixing)
1764+
// Check if rule has empty ports
17651765
if len(rule.Spec.Ports) > 0 && rule.Spec.Ports[0].D == "" {
17661766
// This is likely an orphaned rule with empty ports that should be deleted
17671767
return true

0 commit comments

Comments
 (0)