Skip to content

Commit cc64648

Browse files
stubbiclaude
authored andcommitted
feat(api): objectStorage.forcePathStyle, networkPolicy.extraEgress, netpol Enabled pointer fix
Three live-verification findings: (1) in-cluster MinIO requires path-style S3 addressing — new forcePathStyle field, defaulting true for provider=minio; (2) the operator-managed NetworkPolicy had no way to allow egress to an in-cluster object-storage endpoint — new extraEgress passthrough; (3) networkPolicy.enabled was a plain bool with omitempty + default=true, so an explicit false was dropped on marshal and re-defaulted by the API server — same bug class as PersistenceSpec.Enabled, now *bool. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 6e6e244 commit cc64648

12 files changed

Lines changed: 589 additions & 9 deletions

File tree

api/v1alpha1/paperclipinstance_types.go

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package v1alpha1
1818

1919
import (
2020
corev1 "k8s.io/api/core/v1"
21+
networkingv1 "k8s.io/api/networking/v1"
2122
"k8s.io/apimachinery/pkg/api/resource"
2223
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2324
)
@@ -502,6 +503,14 @@ type ObjectStorageSpec struct {
502503
// CredentialsSecretRef references a Secret containing AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
503504
// +optional
504505
CredentialsSecretRef *corev1.LocalObjectReference `json:"credentialsSecretRef,omitempty"`
506+
507+
// ForcePathStyle forces path-style S3 addressing (bucket in the URL path
508+
// rather than the hostname). Defaults to true when provider is "minio"
509+
// (virtual-hosted addressing needs wildcard DNS that in-cluster MinIO
510+
// deployments don't have), false otherwise. Maps to
511+
// PAPERCLIP_STORAGE_S3_FORCE_PATH_STYLE.
512+
// +optional
513+
ForcePathStyle *bool `json:"forcePathStyle,omitempty"`
505514
}
506515

507516
// HeartbeatSpec configures the agent heartbeat scheduler.
@@ -876,9 +885,12 @@ type SecuritySpec struct {
876885
// NetworkPolicySpec configures network isolation.
877886
type NetworkPolicySpec struct {
878887
// Enabled controls whether a NetworkPolicy is created. Defaults to true.
888+
// Pointer so an explicit `false` survives marshaling (a plain bool with
889+
// omitempty is dropped and re-defaulted to true by the API server on
890+
// every controller update — same bug class as PersistenceSpec.Enabled).
879891
// +kubebuilder:default=true
880892
// +optional
881-
Enabled bool `json:"enabled,omitempty"`
893+
Enabled *bool `json:"enabled,omitempty"`
882894

883895
// AllowIngressCIDRs specifies additional CIDR blocks allowed to reach the Paperclip service.
884896
// +optional
@@ -891,6 +903,14 @@ type NetworkPolicySpec struct {
891903
// +listType=set
892904
// +kubebuilder:validation:items:Pattern=`^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$`
893905
AllowEgressCIDRs []string `json:"allowEgressCIDRs,omitempty"`
906+
907+
// ExtraEgress appends additional egress rules verbatim to the
908+
// operator-managed NetworkPolicy — e.g. to reach an in-cluster
909+
// object-storage endpoint (spec.objectStorage) or other services the
910+
// default rules don't cover. Required when networkPolicy is enabled and
911+
// objectStorage points at an in-cluster endpoint.
912+
// +optional
913+
ExtraEgress []networkingv1.NetworkPolicyEgressRule `json:"extraEgress,omitempty"`
894914
}
895915

896916
// RBACSpec configures ServiceAccount and RBAC.
@@ -1279,6 +1299,14 @@ type BackupS3Spec struct {
12791299
// CredentialsSecretRef references a Secret containing AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
12801300
// +optional
12811301
CredentialsSecretRef *corev1.LocalObjectReference `json:"credentialsSecretRef,omitempty"`
1302+
1303+
// ForcePathStyle forces path-style S3 addressing (bucket in the URL path
1304+
// rather than the hostname). Defaults to true when provider is "minio"
1305+
// (virtual-hosted addressing needs wildcard DNS that in-cluster MinIO
1306+
// deployments don't have), false otherwise. Maps to
1307+
// PAPERCLIP_STORAGE_S3_FORCE_PATH_STYLE.
1308+
// +optional
1309+
ForcePathStyle *bool `json:"forcePathStyle,omitempty"`
12821310
}
12831311

12841312
// --- Status types ---

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)