@@ -12,7 +12,6 @@ import (
1212 networkingv1 "k8s.io/api/networking/v1"
1313 "sigs.k8s.io/controller-runtime/pkg/client"
1414 gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
15- "sigs.k8s.io/yaml"
1615
1716 types "github.com/api7/api7-ingress-controller/api/adc"
1817 "github.com/api7/api7-ingress-controller/api/v1alpha1"
@@ -119,12 +118,12 @@ func (d *adcClient) Delete(ctx context.Context, obj client.Object) error {
119118func (d * adcClient ) sync (task Task ) error {
120119 log .Debugw ("syncing resources" , zap .Any ("task" , task ))
121120
122- data , err := yaml .Marshal (task .Resources )
121+ data , err := json .Marshal (task .Resources )
123122 if err != nil {
124123 return err
125124 }
126125
127- tmpFile , err := os .CreateTemp ("" , "adc-task-*.yaml " )
126+ tmpFile , err := os .CreateTemp ("" , "adc-task-*.json " )
128127 if err != nil {
129128 return err
130129 }
@@ -133,7 +132,7 @@ func (d *adcClient) sync(task Task) error {
133132 _ = os .Remove (tmpFile .Name ())
134133 }()
135134
136- log .Debugw ("generated adc yaml" , zap . String ( "file" , tmpFile .Name ()), zap . String ( "yaml" , string (data ) ))
135+ log .Debugf ("generated adc file, filename: %s, json: %s \n " , tmpFile .Name (), string (data ))
137136
138137 if _ , err := tmpFile .Write (data ); err != nil {
139138 return err
0 commit comments