@@ -42,7 +42,6 @@ import (
42
42
43
43
eventing "knative.dev/eventing/pkg/client/clientset/versioned"
44
44
"knative.dev/eventing/test/lib/duck"
45
- ti "knative.dev/eventing/test/test_images"
46
45
)
47
46
48
47
// Client holds instances of interfaces for making requests to Knative.
@@ -61,8 +60,8 @@ type Client struct {
61
60
62
61
podsCreated []string
63
62
64
- tracingEnv corev1. EnvVar
65
- loggingEnv * corev1. EnvVar
63
+ TracingCfg string
64
+ loggingCfg string
66
65
67
66
cleanup func ()
68
67
}
@@ -105,12 +104,12 @@ func NewClient(namespace string, t *testing.T) (*Client, error) {
105
104
client .EventListener = NewEventListener (client .Kube , client .Namespace , client .T .Logf )
106
105
client .Cleanup (client .EventListener .Stop )
107
106
108
- client .tracingEnv , err = getTracingConfig (client .Kube )
107
+ client .TracingCfg , err = getTracingConfig (client .Kube )
109
108
if err != nil {
110
109
return nil , err
111
110
}
112
111
113
- client .loggingEnv , err = getLoggingConfig (client .Kube )
112
+ client .loggingCfg , err = getLoggingConfig (client .Kube )
114
113
if err != nil {
115
114
t .Log ("Cannot retrieve the logging config map: " , err )
116
115
}
@@ -161,40 +160,40 @@ func getGenericResource(tm metav1.TypeMeta) runtime.Object {
161
160
return & duckv1.KResource {}
162
161
}
163
162
164
- func getTracingConfig (c kubernetes.Interface ) (corev1. EnvVar , error ) {
163
+ func getTracingConfig (c kubernetes.Interface ) (string , error ) {
165
164
cm , err := c .CoreV1 ().ConfigMaps (system .Namespace ()).Get (context .Background (), configtracing .ConfigName , metav1.GetOptions {})
166
165
if err != nil {
167
- return corev1. EnvVar {} , fmt .Errorf ("error while retrieving the %s config map: %+v" , configtracing .ConfigName , errors .WithStack (err ))
166
+ return "" , fmt .Errorf ("error while retrieving the %s config map: %+v" , configtracing .ConfigName , errors .WithStack (err ))
168
167
}
169
168
170
169
config , err := configtracing .NewTracingConfigFromConfigMap (cm )
171
170
if err != nil {
172
- return corev1. EnvVar {} , fmt .Errorf ("error while parsing the %s config map: %+v" , configtracing .ConfigName , errors .WithStack (err ))
171
+ return "" , fmt .Errorf ("error while parsing the %s config map: %+v" , configtracing .ConfigName , errors .WithStack (err ))
173
172
}
174
173
175
174
configSerialized , err := configtracing .TracingConfigToJSON (config )
176
175
if err != nil {
177
- return corev1. EnvVar {} , fmt .Errorf ("error while serializing the %s config map: %+v" , configtracing .ConfigName , errors .WithStack (err ))
176
+ return "" , fmt .Errorf ("error while serializing the %s config map: %+v" , configtracing .ConfigName , errors .WithStack (err ))
178
177
}
179
178
180
- return corev1. EnvVar { Name : ti . ConfigTracingEnv , Value : configSerialized } , nil
179
+ return configSerialized , nil
181
180
}
182
181
183
- func getLoggingConfig (c kubernetes.Interface ) (* corev1. EnvVar , error ) {
182
+ func getLoggingConfig (c kubernetes.Interface ) (string , error ) {
184
183
cm , err := c .CoreV1 ().ConfigMaps (system .Namespace ()).Get (context .Background (), logging .ConfigMapName (), metav1.GetOptions {})
185
184
if err != nil {
186
- return nil , fmt .Errorf ("error while retrieving the %s config map: %+v" , logging .ConfigMapName (), errors .WithStack (err ))
185
+ return "" , fmt .Errorf ("error while retrieving the %s config map: %+v" , logging .ConfigMapName (), errors .WithStack (err ))
187
186
}
188
187
189
188
config , err := logging .NewConfigFromMap (cm .Data )
190
189
if err != nil {
191
- return nil , fmt .Errorf ("error while parsing the %s config map: %+v" , logging .ConfigMapName (), errors .WithStack (err ))
190
+ return "" , fmt .Errorf ("error while parsing the %s config map: %+v" , logging .ConfigMapName (), errors .WithStack (err ))
192
191
}
193
192
194
193
configSerialized , err := logging .ConfigToJSON (config )
195
194
if err != nil {
196
- return nil , fmt .Errorf ("error while serializing the %s config map: %+v" , logging .ConfigMapName (), errors .WithStack (err ))
195
+ return "" , fmt .Errorf ("error while serializing the %s config map: %+v" , logging .ConfigMapName (), errors .WithStack (err ))
197
196
}
198
197
199
- return & corev1. EnvVar { Name : ti . ConfigLoggingEnv , Value : configSerialized } , nil
198
+ return configSerialized , nil
200
199
}
0 commit comments