@@ -23,6 +23,8 @@ import (
2323 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
2424 "sigs.k8s.io/controller-runtime/pkg/log"
2525
26+ "github.com/pomerium/pomerium/config"
27+ "github.com/pomerium/pomerium/pkg/cryptutil"
2628 pb "github.com/pomerium/pomerium/pkg/grpc/config"
2729 "github.com/pomerium/sdk-go"
2830 "github.com/pomerium/sdk-go/proto/pomerium"
@@ -341,7 +343,11 @@ func (r *APIReconciler) SetConfig(ctx context.Context, cfg *model.Config) (chang
341343 pbConfig .Settings .Certificates = nil
342344 pbConfig .Settings .CertificateAuthority = nil
343345
344- settings , err := convertProto [* pomerium.Settings ](pbConfig .Settings )
346+ // Apply all Core defaults.
347+ mergedSettings := config .NewDefaultOptions ()
348+ mergedSettings .ApplySettings (ctx , cryptutil .NewCertificatesIndex (), pbConfig .Settings )
349+
350+ settings , err := convertProto [* pomerium.Settings ](mergedSettings .ToProto ().GetSettings ())
345351 if err != nil {
346352 return false , err
347353 }
@@ -350,18 +356,10 @@ func (r *APIReconciler) SetConfig(ctx context.Context, cfg *model.Config) (chang
350356 if err != nil {
351357 return false , err
352358 }
353-
354- // Mask any settings that cannot be set via the Pomerium CRD
355359 existing := resp .Msg .Settings
356- existing .Address = nil
357- existing .Autocert = nil
358- existing .ClusterId = nil
359- existing .GrpcAddress = nil
360- existing .GrpcInsecure = nil
361- existing .Id = nil
362- existing .InsecureServer = nil
363- existing .NamespaceId = nil
364- existing .SharedSecret = nil
360+
361+ // Preserve any settings that cannot be set via the Pomerium CRD.
362+ settings .AutoApplyChangesets = existing .AutoApplyChangesets
365363
366364 // Mask timestamp metadata.
367365 existing .CreatedAt = nil
0 commit comments