Skip to content

Commit

Permalink
fix: use mapping key for data
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Feb 4, 2025
1 parent 95bc37d commit 16798da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api/v1alpha1/nats_config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import (

type ConfigPhase string

const (
// SecretConfigKey is the key for the config in the secret
SecretConfigKey = "config.json"
)

// New returns a new Config object.
func New() Config {
return Config{}
Expand Down
2 changes: 1 addition & 1 deletion controllers/natsconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (r *NatsConfigReconciler) reconcileConfig(ctx context.Context, obj *natsv1a
c.Namespace = obj.Namespace
c.Name = obj.Name
c.Data = map[string][]byte{
"config.conf": b,
natsv1alpha1.SecretConfigKey: b,
}

_, err = controllerutil.CreateOrUpdate(ctx, r.Client, c, func() error {
Expand Down
3 changes: 3 additions & 0 deletions examples/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ spec:
gateways:
- name: harry
namespace: default
config:
host: 0.0.0.0
port: 4222

0 comments on commit 16798da

Please sign in to comment.