How to use Logs method of v1 Package

Best Testkube code snippet using v1.Logs

auditlogs_test.go

Source:auditlogs_test.go Github

copy

Full Screen

...89)90func sourceOwnerRef(name string, uid types.UID) metav1.OwnerReference {91 return metav1.OwnerReference{92 APIVersion: "events.cloud.google.com/v1",93 Kind: "CloudAuditLogsSource",94 Name: name,95 UID: uid,96 Controller: &trueVal,97 BlockOwnerDeletion: &trueVal,98 }99}100func patchFinalizers(namespace, name string, add bool) clientgotesting.PatchActionImpl {101 action := clientgotesting.PatchActionImpl{}102 action.Name = name103 action.Namespace = namespace104 var fname string105 if add {106 fname = fmt.Sprintf("%q", resourceGroup)107 }108 patch := `{"metadata":{"finalizers":[` + fname + `],"resourceVersion":""}}`109 action.Patch = []byte(patch)110 return action111}112func newSinkDestination() duckv1.Destination {113 return duckv1.Destination{114 Ref: &duckv1.KReference{115 APIVersion: "testing.cloud.google.com/v1",116 Kind: "Sink",117 Name: sinkName,118 },119 }120}121// TODO add a unit test for successfully creating a k8s service account, after issue https://github.com/google/knative-gcp/issues/657 gets solved.122func TestAllCases(t *testing.T) {123 calSinkURL := sinkURI124 table := TableTest{{125 Name: "bad workqueue key",126 Key: "too/many/parts",127 }, {128 Name: "key not found",129 // Make sure Reconcile handles good keys that don't exist.130 Key: "foo/not-found",131 }, {132 Name: "topic created, not yet been reconciled",133 Objects: []runtime.Object{134 v1.NewCloudAuditLogsSource(sourceName, testNS,135 v1.WithCloudAuditLogsSourceUID(sourceUID),136 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),137 v1.WithCloudAuditLogsSourceMethodName(testMethodName),138 v1.WithCloudAuditLogsSourceServiceName(testServiceName),139 v1.WithCloudAuditLogsSourceAnnotations(map[string]string{140 duck.ClusterNameAnnotation: testingMetadataClient.FakeClusterName,141 }),142 v1.WithCloudAuditLogsSourceSetDefaults,143 ),144 },145 Key: testNS + "/" + sourceName,146 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{147 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,148 v1.WithCloudAuditLogsSourceUID(sourceUID),149 v1.WithInitCloudAuditLogsSourceConditions,150 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),151 v1.WithCloudAuditLogsSourceMethodName(testMethodName),152 v1.WithCloudAuditLogsSourceServiceName(testServiceName),153 v1.WithCloudAuditLogsSourceTopicUnknown("TopicNotConfigured", failedToReconcileTopicMsg),154 v1.WithCloudAuditLogsSourceAnnotations(map[string]string{155 duck.ClusterNameAnnotation: testingMetadataClient.FakeClusterName,156 }),157 v1.WithCloudAuditLogsSourceSetDefaults,158 ),159 }},160 WantCreates: []runtime.Object{161 v1.NewTopic(sourceName, testNS,162 v1.WithTopicSpec(inteventsv1.TopicSpec{163 Topic: testTopicID,164 PropagationPolicy: "CreateDelete",165 EnablePublisher: &falseVal,166 }),167 v1.WithTopicLabels(map[string]string{168 "receive-adapter": receiveAdapterName,169 "events.cloud.google.com/source-name": sourceName,170 }),171 v1.WithTopicOwnerReferences([]metav1.OwnerReference{sourceOwnerRef(sourceName, sourceUID)}),172 v1.WithTopicAnnotations(map[string]string{173 duck.ClusterNameAnnotation: testingMetadataClient.FakeClusterName,174 }),175 v1.WithTopicSetDefaults,176 ),177 },178 WantPatches: []clientgotesting.PatchActionImpl{179 patchFinalizers(testNS, sourceName, true),180 },181 WantEvents: []string{182 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),183 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, "Reconcile PubSub failed with: Topic %q has not yet been reconciled", sourceName),184 },185 }, {186 Name: "topic exists, topic has not yet been reconciled",187 Objects: []runtime.Object{188 v1.NewCloudAuditLogsSource(sourceName, testNS,189 v1.WithCloudAuditLogsSourceUID(sourceUID),190 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),191 v1.WithCloudAuditLogsSourceMethodName(testMethodName),192 v1.WithCloudAuditLogsSourceServiceName(testServiceName),193 v1.WithCloudAuditLogsSourceAnnotations(map[string]string{194 duck.ClusterNameAnnotation: testingMetadataClient.FakeClusterName,195 }),196 v1.WithCloudAuditLogsSourceSetDefaults,197 ),198 v1.NewTopic(sourceName, testNS,199 v1.WithTopicSpec(inteventsv1.TopicSpec{200 Topic: testTopicID,201 PropagationPolicy: "CreateDelete",202 EnablePublisher: &falseVal,203 }),204 v1.WithTopicUnknown,205 v1.WithTopicSetDefaults,206 ),207 },208 Key: testNS + "/" + sourceName,209 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{210 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,211 v1.WithCloudAuditLogsSourceUID(sourceUID),212 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),213 v1.WithInitCloudAuditLogsSourceConditions,214 v1.WithCloudAuditLogsSourceMethodName(testMethodName),215 v1.WithCloudAuditLogsSourceServiceName(testServiceName),216 v1.WithCloudAuditLogsSourceAnnotations(map[string]string{217 duck.ClusterNameAnnotation: testingMetadataClient.FakeClusterName,218 }),219 v1.WithCloudAuditLogsSourceSetDefaults,220 ),221 }},222 WantPatches: []clientgotesting.PatchActionImpl{223 patchFinalizers(testNS, sourceName, true),224 },225 WantEvents: []string{226 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),227 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, "Reconcile PubSub failed with: the status of Topic %q is Unknown", sourceName),228 },229 }, {230 Name: "topic exists and is ready, no projectid",231 Objects: []runtime.Object{232 v1.NewCloudAuditLogsSource(sourceName, testNS,233 v1.WithCloudAuditLogsSourceUID(sourceUID),234 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),235 v1.WithCloudAuditLogsSourceMethodName(testMethodName),236 v1.WithCloudAuditLogsSourceServiceName(testServiceName),237 v1.WithCloudAuditLogsSourceSetDefaults,238 ),239 v1.NewTopic(sourceName, testNS,240 v1.WithTopicSpec(inteventsv1.TopicSpec{241 Topic: testTopicID,242 PropagationPolicy: "CreateDelete",243 EnablePublisher: &falseVal,244 }),245 v1.WithTopicReady(testTopicID),246 v1.WithTopicAddress(testTopicURI),247 v1.WithTopicSetDefaults,248 ),249 },250 Key: testNS + "/" + sourceName,251 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{252 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,253 v1.WithCloudAuditLogsSourceUID(sourceUID),254 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),255 v1.WithCloudAuditLogsSourceMethodName(testMethodName),256 v1.WithCloudAuditLogsSourceServiceName(testServiceName),257 v1.WithInitCloudAuditLogsSourceConditions,258 v1.WithCloudAuditLogsSourceSetDefaults,259 v1.WithCloudAuditLogsSourceTopicFailed("TopicNotReady", fmt.Sprintf(`Topic %q did not expose projectid`, sourceName)),260 ),261 }},262 WantPatches: []clientgotesting.PatchActionImpl{263 patchFinalizers(testNS, sourceName, true),264 },265 WantEvents: []string{266 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),267 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, "Reconcile PubSub failed with: Topic %q did not expose projectid", sourceName),268 },269 }, {270 Name: "topic exists and is ready, no topicid",271 Objects: []runtime.Object{272 v1.NewCloudAuditLogsSource(sourceName, testNS,273 v1.WithCloudAuditLogsSourceUID(sourceUID),274 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),275 v1.WithCloudAuditLogsSourceMethodName(testMethodName),276 v1.WithCloudAuditLogsSourceServiceName(testServiceName),277 v1.WithCloudAuditLogsSourceSetDefaults,278 ),279 v1.NewTopic(sourceName, testNS,280 v1.WithTopicSpec(inteventsv1.TopicSpec{281 Topic: testTopicID,282 PropagationPolicy: "CreateDelete",283 EnablePublisher: &falseVal,284 }),285 v1.WithTopicReady(""),286 v1.WithTopicProjectID(testProject),287 v1.WithTopicAddress(testTopicURI),288 v1.WithTopicSetDefaults,289 ),290 },291 Key: testNS + "/" + sourceName,292 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{293 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,294 v1.WithCloudAuditLogsSourceUID(sourceUID),295 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),296 v1.WithCloudAuditLogsSourceMethodName(testMethodName),297 v1.WithCloudAuditLogsSourceServiceName(testServiceName),298 v1.WithInitCloudAuditLogsSourceConditions,299 v1.WithCloudAuditLogsSourceSetDefaults,300 v1.WithCloudAuditLogsSourceTopicFailed("TopicNotReady", fmt.Sprintf("Topic %q did not expose topicid", sourceName)),301 ),302 }},303 WantPatches: []clientgotesting.PatchActionImpl{304 patchFinalizers(testNS, sourceName, true),305 },306 WantEvents: []string{307 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),308 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, "Reconcile PubSub failed with: Topic %q did not expose topicid", sourceName),309 },310 }, {311 Name: "topic exists and is ready, unexpected topicid",312 Objects: []runtime.Object{313 v1.NewCloudAuditLogsSource(sourceName, testNS,314 v1.WithCloudAuditLogsSourceUID(sourceUID),315 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),316 v1.WithCloudAuditLogsSourceMethodName(testMethodName),317 v1.WithCloudAuditLogsSourceServiceName(testServiceName),318 v1.WithCloudAuditLogsSourceSetDefaults,319 ),320 v1.NewTopic(sourceName, testNS,321 v1.WithTopicSpec(inteventsv1.TopicSpec{322 Topic: testTopicID,323 PropagationPolicy: "CreateDelete",324 EnablePublisher: &falseVal,325 }),326 v1.WithTopicReady("garbaaaaage"),327 v1.WithTopicProjectID(testProject),328 v1.WithTopicAddress(testTopicURI),329 v1.WithTopicSetDefaults,330 ),331 },332 Key: testNS + "/" + sourceName,333 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{334 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,335 v1.WithCloudAuditLogsSourceUID(sourceUID),336 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),337 v1.WithCloudAuditLogsSourceMethodName(testMethodName),338 v1.WithCloudAuditLogsSourceServiceName(testServiceName),339 v1.WithInitCloudAuditLogsSourceConditions,340 v1.WithCloudAuditLogsSourceSetDefaults,341 v1.WithCloudAuditLogsSourceTopicFailed("TopicNotReady", fmt.Sprintf(`Topic %q mismatch: expected %q got "garbaaaaage"`, sourceName, testTopicID)),342 ),343 }},344 WantPatches: []clientgotesting.PatchActionImpl{345 patchFinalizers(testNS, sourceName, true),346 },347 WantEvents: []string{348 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),349 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, fmt.Sprintf(`Reconcile PubSub failed with: Topic %q mismatch: expected %q got "garbaaaaage"`, sourceName, testTopicID)),350 },351 }, {352 Name: "topic exists and the status of topic is false",353 Objects: []runtime.Object{354 v1.NewCloudAuditLogsSource(sourceName, testNS,355 v1.WithCloudAuditLogsSourceUID(sourceUID),356 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),357 v1.WithCloudAuditLogsSourceMethodName(testMethodName),358 v1.WithCloudAuditLogsSourceServiceName(testServiceName),359 v1.WithCloudAuditLogsSourceSetDefaults,360 ),361 v1.NewTopic(sourceName, testNS,362 v1.WithTopicSpec(inteventsv1.TopicSpec{363 Topic: testTopicID,364 PropagationPolicy: "CreateDelete",365 EnablePublisher: &falseVal,366 }),367 v1.WithTopicFailed,368 v1.WithTopicSetDefaults,369 ),370 },371 Key: testNS + "/" + sourceName,372 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{373 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,374 v1.WithCloudAuditLogsSourceUID(sourceUID),375 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),376 v1.WithCloudAuditLogsSourceMethodName(testMethodName),377 v1.WithCloudAuditLogsSourceServiceName(testServiceName),378 v1.WithInitCloudAuditLogsSourceConditions,379 v1.WithCloudAuditLogsSourceTopicFailed("TopicFailed", "test message"),380 v1.WithCloudAuditLogsSourceSetDefaults,381 ),382 }},383 WantPatches: []clientgotesting.PatchActionImpl{384 patchFinalizers(testNS, sourceName, true),385 },386 WantEvents: []string{387 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),388 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, "Reconcile PubSub failed with: the status of Topic %q is False", sourceName),389 },390 }, {391 Name: "topic exists and the status of topic is unknown",392 Objects: []runtime.Object{393 v1.NewCloudAuditLogsSource(sourceName, testNS,394 v1.WithCloudAuditLogsSourceUID(sourceUID),395 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),396 v1.WithCloudAuditLogsSourceMethodName(testMethodName),397 v1.WithCloudAuditLogsSourceServiceName(testServiceName),398 v1.WithCloudAuditLogsSourceSetDefaults,399 ),400 v1.NewTopic(sourceName, testNS,401 v1.WithTopicSpec(inteventsv1.TopicSpec{402 Topic: testTopicID,403 PropagationPolicy: "CreateDelete",404 EnablePublisher: &falseVal,405 }),406 v1.WithTopicUnknown,407 v1.WithTopicSetDefaults,408 ),409 },410 Key: testNS + "/" + sourceName,411 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{412 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,413 v1.WithCloudAuditLogsSourceUID(sourceUID),414 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),415 v1.WithCloudAuditLogsSourceMethodName(testMethodName),416 v1.WithCloudAuditLogsSourceServiceName(testServiceName),417 v1.WithInitCloudAuditLogsSourceConditions,418 v1.WithCloudAuditLogsSourceTopicUnknown("", ""),419 v1.WithCloudAuditLogsSourceSetDefaults,420 ),421 }},422 WantPatches: []clientgotesting.PatchActionImpl{423 patchFinalizers(testNS, sourceName, true),424 },425 WantEvents: []string{426 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),427 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, "Reconcile PubSub failed with: the status of Topic %q is Unknown", sourceName),428 },429 }, {430 Name: "topic exists and is ready, pullsubscription created",431 Objects: []runtime.Object{432 v1.NewCloudAuditLogsSource(sourceName, testNS,433 v1.WithCloudAuditLogsSourceUID(sourceUID),434 v1.WithCloudAuditLogsSourceMethodName(testMethodName),435 v1.WithCloudAuditLogsSourceServiceName(testServiceName),436 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),437 v1.WithCloudAuditLogsSourceAnnotations(map[string]string{438 duck.ClusterNameAnnotation: testingMetadataClient.FakeClusterName,439 }),440 v1.WithCloudAuditLogsSourceSetDefaults,441 ),442 v1.NewTopic(sourceName, testNS,443 v1.WithTopicSpec(inteventsv1.TopicSpec{444 Topic: testTopicID,445 PropagationPolicy: "CreateDelete",446 EnablePublisher: &falseVal,447 }),448 v1.WithTopicReady(testTopicID),449 v1.WithTopicAddress(testTopicURI),450 v1.WithTopicProjectID(testProject),451 v1.WithTopicSetDefaults,452 ),453 },454 Key: testNS + "/" + sourceName,455 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{456 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,457 v1.WithCloudAuditLogsSourceUID(sourceUID),458 v1.WithCloudAuditLogsSourceMethodName(testMethodName),459 v1.WithCloudAuditLogsSourceServiceName(testServiceName),460 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),461 v1.WithCloudAuditLogsSourceProjectID(testProject),462 v1.WithInitCloudAuditLogsSourceConditions,463 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),464 v1.WithCloudAuditLogsSourceAnnotations(map[string]string{465 duck.ClusterNameAnnotation: testingMetadataClient.FakeClusterName,466 }),467 v1.WithCloudAuditLogsSourceSetDefaults,468 v1.WithCloudAuditLogsSourcePullSubscriptionUnknown("PullSubscriptionNotConfigured", failedToReconcilePullSubscriptionMsg),469 ),470 }},471 WantCreates: []runtime.Object{472 v1.NewPullSubscription(sourceName, testNS,473 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{474 Topic: testTopicID,475 PubSubSpec: gcpduckv1.PubSubSpec{476 Secret: &secret,477 },478 AdapterType: string(converters.CloudAuditLogs),479 }),480 v1.WithPullSubscriptionSink(sinkGVK, sinkName),481 v1.WithPullSubscriptionLabels(map[string]string{482 "receive-adapter": receiveAdapterName,483 "events.cloud.google.com/source-name": sourceName,484 }),485 v1.WithPullSubscriptionAnnotations(map[string]string{486 "metrics-resource-group": resourceGroup,487 duck.ClusterNameAnnotation: testingMetadataClient.FakeClusterName,488 }),489 v1.WithPullSubscriptionOwnerReferences([]metav1.OwnerReference{sourceOwnerRef(sourceName, sourceUID)}),490 v1.WithPullSubscriptionDefaultGCPAuth,491 ),492 },493 WantPatches: []clientgotesting.PatchActionImpl{494 patchFinalizers(testNS, sourceName, true),495 },496 WantEvents: []string{497 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),498 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, `Reconcile PubSub failed with: %s: PullSubscription %q has not yet been reconciled`, failedToPropagatePullSubscriptionStatusMsg, sourceName),499 },500 }, {501 Name: "topic exists and ready, pullsubscription exists but has not yet been reconciled",502 Objects: []runtime.Object{503 v1.NewCloudAuditLogsSource(sourceName, testNS,504 v1.WithCloudAuditLogsSourceUID(sourceUID),505 v1.WithCloudAuditLogsSourceMethodName(testMethodName),506 v1.WithCloudAuditLogsSourceServiceName(testServiceName),507 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),508 v1.WithCloudAuditLogsSourceSetDefaults,509 ),510 v1.NewTopic(sourceName, testNS,511 v1.WithTopicSpec(inteventsv1.TopicSpec{512 Topic: testTopicID,513 PropagationPolicy: "CreateDelete",514 EnablePublisher: &falseVal,515 }),516 v1.WithTopicReady(testTopicID),517 v1.WithTopicAddress(testTopicURI),518 v1.WithTopicProjectID(testProject),519 v1.WithTopicSetDefaults,520 ),521 v1.NewPullSubscription(sourceName, testNS,522 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{523 Topic: testTopicID,524 PubSubSpec: gcpduckv1.PubSubSpec{525 Secret: &secret,526 SourceSpec: duckv1.SourceSpec{527 Sink: newSinkDestination(),528 },529 },530 AdapterType: string(converters.CloudAuditLogs),531 })),532 },533 Key: testNS + "/" + sourceName,534 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{535 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,536 v1.WithCloudAuditLogsSourceUID(sourceUID),537 v1.WithCloudAuditLogsSourceMethodName(testMethodName),538 v1.WithCloudAuditLogsSourceServiceName(testServiceName),539 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),540 v1.WithCloudAuditLogsSourceProjectID(testProject),541 v1.WithInitCloudAuditLogsSourceConditions,542 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),543 v1.WithCloudAuditLogsSourceSetDefaults,544 v1.WithCloudAuditLogsSourcePullSubscriptionUnknown("PullSubscriptionNotConfigured", failedToReconcilePullSubscriptionMsg),545 ),546 }},547 WantPatches: []clientgotesting.PatchActionImpl{548 patchFinalizers(testNS, sourceName, true),549 },550 WantEvents: []string{551 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),552 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, `Reconcile PubSub failed with: %s: PullSubscription %q has not yet been reconciled`, failedToPropagatePullSubscriptionStatusMsg, sourceName),553 },554 }, {555 Name: "topic exists and ready, pullsubscription exists and the status of pullsubscription is false",556 Objects: []runtime.Object{557 v1.NewCloudAuditLogsSource(sourceName, testNS,558 v1.WithCloudAuditLogsSourceUID(sourceUID),559 v1.WithCloudAuditLogsSourceMethodName(testMethodName),560 v1.WithCloudAuditLogsSourceServiceName(testServiceName),561 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),562 v1.WithCloudAuditLogsSourceSetDefaults,563 ),564 v1.NewTopic(sourceName, testNS,565 v1.WithTopicSpec(inteventsv1.TopicSpec{566 Topic: testTopicID,567 PropagationPolicy: "CreateDelete",568 EnablePublisher: &falseVal,569 }),570 v1.WithTopicReady(testTopicID),571 v1.WithTopicAddress(testTopicURI),572 v1.WithTopicProjectID(testProject),573 v1.WithTopicSetDefaults,574 ),575 v1.NewPullSubscription(sourceName, testNS, v1.WithPullSubscriptionFailed(),576 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{577 Topic: testTopicID,578 PubSubSpec: gcpduckv1.PubSubSpec{579 Secret: &secret,580 SourceSpec: duckv1.SourceSpec{581 Sink: newSinkDestination(),582 },583 },584 AdapterType: string(converters.CloudAuditLogs),585 })),586 },587 Key: testNS + "/" + sourceName,588 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{589 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,590 v1.WithCloudAuditLogsSourceUID(sourceUID),591 v1.WithCloudAuditLogsSourceMethodName(testMethodName),592 v1.WithCloudAuditLogsSourceServiceName(testServiceName),593 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),594 v1.WithCloudAuditLogsSourceProjectID(testProject),595 v1.WithInitCloudAuditLogsSourceConditions,596 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),597 v1.WithCloudAuditLogsSourceSetDefaults,598 v1.WithCloudAuditLogsSourcePullSubscriptionFailed("InvalidSink", `sinks.testing.cloud.google.com "sink" not found`),599 ),600 }},601 WantPatches: []clientgotesting.PatchActionImpl{602 patchFinalizers(testNS, sourceName, true),603 },604 WantEvents: []string{605 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),606 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, `Reconcile PubSub failed with: %s: the status of PullSubscription %q is False`, failedToPropagatePullSubscriptionStatusMsg, sourceName),607 },608 }, {609 Name: "topic exists and ready, pullsubscription exists and the status of pullsubscription is unknown",610 Objects: []runtime.Object{611 v1.NewCloudAuditLogsSource(sourceName, testNS,612 v1.WithCloudAuditLogsSourceUID(sourceUID),613 v1.WithCloudAuditLogsSourceMethodName(testMethodName),614 v1.WithCloudAuditLogsSourceServiceName(testServiceName),615 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),616 v1.WithCloudAuditLogsSourceSetDefaults,617 ),618 v1.NewTopic(sourceName, testNS,619 v1.WithTopicSpec(inteventsv1.TopicSpec{620 Topic: testTopicID,621 PropagationPolicy: "CreateDelete",622 EnablePublisher: &falseVal,623 }),624 v1.WithTopicReady(testTopicID),625 v1.WithTopicAddress(testTopicURI),626 v1.WithTopicProjectID(testProject),627 v1.WithTopicSetDefaults,628 ),629 v1.NewPullSubscription(sourceName, testNS, v1.WithPullSubscriptionUnknown(),630 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{631 Topic: testTopicID,632 PubSubSpec: gcpduckv1.PubSubSpec{633 Secret: &secret,634 SourceSpec: duckv1.SourceSpec{635 Sink: newSinkDestination(),636 },637 },638 AdapterType: string(converters.CloudAuditLogs),639 })),640 },641 Key: testNS + "/" + sourceName,642 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{643 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,644 v1.WithCloudAuditLogsSourceUID(sourceUID),645 v1.WithCloudAuditLogsSourceMethodName(testMethodName),646 v1.WithCloudAuditLogsSourceServiceName(testServiceName),647 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),648 v1.WithCloudAuditLogsSourceProjectID(testProject),649 v1.WithInitCloudAuditLogsSourceConditions,650 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),651 v1.WithCloudAuditLogsSourcePullSubscriptionUnknown("", ""),652 v1.WithCloudAuditLogsSourceSetDefaults,653 ),654 }},655 WantPatches: []clientgotesting.PatchActionImpl{656 patchFinalizers(testNS, sourceName, true),657 },658 WantEvents: []string{659 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),660 Eventf(corev1.EventTypeWarning, reconciledPubSubFailedReason, "Reconcile PubSub failed with: %s: the status of PullSubscription %q is Unknown", failedToPropagatePullSubscriptionStatusMsg, sourceName),661 },662 }, {663 Name: "logging client create fails",664 Objects: []runtime.Object{665 v1.NewCloudAuditLogsSource(sourceName, testNS,666 v1.WithCloudAuditLogsSourceUID(sourceUID),667 v1.WithCloudAuditLogsSourceMethodName(testMethodName),668 v1.WithCloudAuditLogsSourceServiceName(testServiceName),669 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),670 v1.WithCloudAuditLogsSourceSetDefaults,671 ),672 v1.NewTopic(sourceName, testNS,673 v1.WithTopicSpec(inteventsv1.TopicSpec{674 Topic: testTopicID,675 PropagationPolicy: "CreateDelete",676 EnablePublisher: &falseVal,677 }),678 v1.WithTopicReady(testTopicID),679 v1.WithTopicAddress(testTopicURI),680 v1.WithTopicProjectID(testProject),681 v1.WithTopicSetDefaults,682 ),683 v1.NewPullSubscription(sourceName, testNS,684 v1.WithPullSubscriptionReady(sinkURI),685 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{686 Topic: testTopicID,687 PubSubSpec: gcpduckv1.PubSubSpec{688 Secret: &secret,689 SourceSpec: duckv1.SourceSpec{690 Sink: newSinkDestination(),691 },692 },693 AdapterType: string(converters.CloudAuditLogs),694 })),695 },696 Key: testNS + "/" + sourceName,697 OtherTestData: map[string]interface{}{698 "logadmin": glogadmintesting.TestClientConfiguration{699 CreateClientErr: errors.New("create-client-induced-error"),700 },701 },702 WantPatches: []clientgotesting.PatchActionImpl{703 patchFinalizers(testNS, sourceName, true),704 },705 WantEvents: []string{706 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),707 Eventf(corev1.EventTypeWarning, reconciledFailedReason, "Reconcile Sink failed with: create-client-induced-error"),708 },709 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{710 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,711 v1.WithCloudAuditLogsSourceUID(sourceUID),712 v1.WithCloudAuditLogsSourceMethodName(testMethodName),713 v1.WithCloudAuditLogsSourceServiceName(testServiceName),714 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),715 v1.WithCloudAuditLogsSourceProjectID(testProject),716 v1.WithCloudAuditLogsSourceSubscriptionID(v1.SubscriptionID),717 v1.WithInitCloudAuditLogsSourceConditions,718 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),719 v1.WithCloudAuditLogsSourcePullSubscriptionReady,720 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),721 v1.WithCloudAuditLogsSourceSetDefaults,722 v1.WithCloudAuditLogsSourceSinkNotReady("SinkCreateFailed", "%s: %s", failedToCreateSinkMsg, "create-client-induced-error"),723 ),724 }},725 }, {726 Name: "get sink fails",727 Objects: []runtime.Object{728 v1.NewCloudAuditLogsSource(sourceName, testNS,729 v1.WithCloudAuditLogsSourceUID(sourceUID),730 v1.WithCloudAuditLogsSourceMethodName(testMethodName),731 v1.WithCloudAuditLogsSourceServiceName(testServiceName),732 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),733 v1.WithCloudAuditLogsSourceSetDefaults,734 ),735 v1.NewTopic(sourceName, testNS,736 v1.WithTopicSpec(inteventsv1.TopicSpec{737 Topic: testTopicID,738 PropagationPolicy: "CreateDelete",739 EnablePublisher: &falseVal,740 }),741 v1.WithTopicReady(testTopicID),742 v1.WithTopicAddress(testTopicURI),743 v1.WithTopicProjectID(testProject),744 v1.WithTopicSetDefaults,745 ),746 v1.NewPullSubscription(sourceName, testNS,747 v1.WithPullSubscriptionReady(sinkURI),748 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{749 Topic: testTopicID,750 PubSubSpec: gcpduckv1.PubSubSpec{751 Secret: &secret,752 SourceSpec: duckv1.SourceSpec{753 Sink: newSinkDestination(),754 },755 },756 AdapterType: string(converters.CloudAuditLogs),757 })),758 },759 Key: testNS + "/" + sourceName,760 OtherTestData: map[string]interface{}{761 "logadmin": glogadmintesting.TestClientConfiguration{762 SinkErr: errors.New("create-client-induced-error"),763 },764 },765 WantPatches: []clientgotesting.PatchActionImpl{766 patchFinalizers(testNS, sourceName, true),767 },768 WantEvents: []string{769 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),770 Eventf(corev1.EventTypeWarning, reconciledFailedReason, "Reconcile Sink failed with: create-client-induced-error"),771 },772 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{773 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,774 v1.WithCloudAuditLogsSourceUID(sourceUID),775 v1.WithCloudAuditLogsSourceMethodName(testMethodName),776 v1.WithCloudAuditLogsSourceServiceName(testServiceName),777 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),778 v1.WithCloudAuditLogsSourceProjectID(testProject),779 v1.WithCloudAuditLogsSourceSubscriptionID(v1.SubscriptionID),780 v1.WithInitCloudAuditLogsSourceConditions,781 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),782 v1.WithCloudAuditLogsSourcePullSubscriptionReady,783 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),784 v1.WithCloudAuditLogsSourceSetDefaults,785 v1.WithCloudAuditLogsSourceSinkNotReady("SinkCreateFailed", "%s: %s", failedToCreateSinkMsg, "create-client-induced-error"),786 ),787 }},788 }, {789 Name: "create sink fails",790 Objects: []runtime.Object{791 v1.NewCloudAuditLogsSource(sourceName, testNS,792 v1.WithCloudAuditLogsSourceUID(sourceUID),793 v1.WithCloudAuditLogsSourceMethodName(testMethodName),794 v1.WithCloudAuditLogsSourceServiceName(testServiceName),795 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),796 v1.WithCloudAuditLogsSourceSetDefaults,797 ),798 v1.NewTopic(sourceName, testNS,799 v1.WithTopicSpec(inteventsv1.TopicSpec{800 Topic: testTopicID,801 PropagationPolicy: "CreateDelete",802 EnablePublisher: &falseVal,803 }),804 v1.WithTopicReady(testTopicID),805 v1.WithTopicAddress(testTopicURI),806 v1.WithTopicProjectID(testProject),807 v1.WithTopicSetDefaults,808 ),809 v1.NewPullSubscription(sourceName, testNS,810 v1.WithPullSubscriptionReady(sinkURI),811 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{812 Topic: testTopicID,813 PubSubSpec: gcpduckv1.PubSubSpec{814 Secret: &secret,815 SourceSpec: duckv1.SourceSpec{816 Sink: newSinkDestination(),817 },818 },819 AdapterType: string(converters.CloudAuditLogs),820 })),821 },822 Key: testNS + "/" + sourceName,823 OtherTestData: map[string]interface{}{824 "logadmin": glogadmintesting.TestClientConfiguration{825 CreateSinkErr: errors.New("create-client-induced-error"),826 },827 },828 WantPatches: []clientgotesting.PatchActionImpl{829 patchFinalizers(testNS, sourceName, true),830 },831 WantEvents: []string{832 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),833 Eventf(corev1.EventTypeWarning, reconciledFailedReason, "Reconcile Sink failed with: create-client-induced-error"),834 },835 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{836 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,837 v1.WithCloudAuditLogsSourceUID(sourceUID),838 v1.WithCloudAuditLogsSourceMethodName(testMethodName),839 v1.WithCloudAuditLogsSourceServiceName(testServiceName),840 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),841 v1.WithCloudAuditLogsSourceProjectID(testProject),842 v1.WithCloudAuditLogsSourceSubscriptionID(v1.SubscriptionID),843 v1.WithInitCloudAuditLogsSourceConditions,844 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),845 v1.WithCloudAuditLogsSourcePullSubscriptionReady,846 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),847 v1.WithCloudAuditLogsSourceSetDefaults,848 v1.WithCloudAuditLogsSourceSinkNotReady("SinkCreateFailed", "%s: %s", failedToCreateSinkMsg, "create-client-induced-error"),849 ),850 }},851 }, {852 Name: "sink created, pubsub client create fails",853 Objects: []runtime.Object{854 v1.NewCloudAuditLogsSource(sourceName, testNS,855 v1.WithCloudAuditLogsSourceUID(sourceUID),856 v1.WithCloudAuditLogsSourceMethodName(testMethodName),857 v1.WithCloudAuditLogsSourceServiceName(testServiceName),858 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),859 v1.WithCloudAuditLogsSourceSetDefaults,860 ),861 v1.NewTopic(sourceName, testNS,862 v1.WithTopicSpec(inteventsv1.TopicSpec{863 Topic: testTopicID,864 PropagationPolicy: "CreateDelete",865 EnablePublisher: &falseVal,866 }),867 v1.WithTopicReady(testTopicID),868 v1.WithTopicAddress(testTopicURI),869 v1.WithTopicProjectID(testProject),870 v1.WithTopicSetDefaults,871 ),872 v1.NewPullSubscription(sourceName, testNS,873 v1.WithPullSubscriptionReady(sinkURI),874 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{875 Topic: testTopicID,876 PubSubSpec: gcpduckv1.PubSubSpec{877 Secret: &secret,878 SourceSpec: duckv1.SourceSpec{879 Sink: newSinkDestination(),880 },881 },882 AdapterType: string(converters.CloudAuditLogs),883 })),884 },885 Key: testNS + "/" + sourceName,886 OtherTestData: map[string]interface{}{887 "pubsub": gpubsub.TestClientData{888 CreateClientErr: errors.New("create-client-induced-error"),889 },890 },891 WantPatches: []clientgotesting.PatchActionImpl{892 patchFinalizers(testNS, sourceName, true),893 },894 WantEvents: []string{895 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),896 Eventf(corev1.EventTypeWarning, reconciledFailedReason, "Reconcile Sink failed with: create-client-induced-error"),897 },898 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{899 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,900 v1.WithCloudAuditLogsSourceUID(sourceUID),901 v1.WithCloudAuditLogsSourceMethodName(testMethodName),902 v1.WithCloudAuditLogsSourceServiceName(testServiceName),903 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),904 v1.WithCloudAuditLogsSourceProjectID(testProject),905 v1.WithCloudAuditLogsSourceSubscriptionID(v1.SubscriptionID),906 v1.WithInitCloudAuditLogsSourceConditions,907 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),908 v1.WithCloudAuditLogsSourcePullSubscriptionReady,909 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),910 v1.WithCloudAuditLogsSourceSetDefaults,911 v1.WithCloudAuditLogsSourceSinkNotReady("SinkNotPublisher", "%s: %s", failedToSetPermissionsMsg, "create-client-induced-error"),912 ),913 }},914 }, {915 Name: "sink created, get pubsub IAM policy fails",916 Objects: []runtime.Object{917 v1.NewCloudAuditLogsSource(sourceName, testNS,918 v1.WithCloudAuditLogsSourceUID(sourceUID),919 v1.WithCloudAuditLogsSourceMethodName(testMethodName),920 v1.WithCloudAuditLogsSourceServiceName(testServiceName),921 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),922 v1.WithCloudAuditLogsSourceServiceName(testServiceName),923 v1.WithCloudAuditLogsSourceMethodName(testMethodName),924 v1.WithCloudAuditLogsSourceSetDefaults,925 ),926 v1.NewTopic(sourceName, testNS,927 v1.WithTopicSpec(inteventsv1.TopicSpec{928 Topic: testTopicID,929 PropagationPolicy: "CreateDelete",930 EnablePublisher: &falseVal,931 }),932 v1.WithTopicReady(testTopicID),933 v1.WithTopicAddress(testTopicURI),934 v1.WithTopicProjectID(testProject),935 v1.WithTopicSetDefaults,936 ),937 v1.NewPullSubscription(sourceName, testNS,938 v1.WithPullSubscriptionReady(sinkURI),939 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{940 Topic: testTopicID,941 PubSubSpec: gcpduckv1.PubSubSpec{942 Secret: &secret,943 SourceSpec: duckv1.SourceSpec{944 Sink: newSinkDestination(),945 },946 },947 AdapterType: string(converters.CloudAuditLogs),948 })),949 },950 Key: testNS + "/" + sourceName,951 OtherTestData: map[string]interface{}{952 "pubsub": gpubsub.TestClientData{953 HandleData: testiam.TestHandleData{954 PolicyErr: errors.New("create-client-induced-error"),955 },956 },957 "expectedSinks": map[string]*logadmin.Sink{958 testSinkID: {959 ID: testSinkID,960 Filter: testFilter,961 Destination: testTopicResource,962 }},963 },964 WantPatches: []clientgotesting.PatchActionImpl{965 patchFinalizers(testNS, sourceName, true),966 },967 WantEvents: []string{968 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),969 Eventf(corev1.EventTypeWarning, reconciledFailedReason, "Reconcile Sink failed with: create-client-induced-error"),970 },971 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{972 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,973 v1.WithCloudAuditLogsSourceUID(sourceUID),974 v1.WithCloudAuditLogsSourceMethodName(testMethodName),975 v1.WithCloudAuditLogsSourceServiceName(testServiceName),976 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),977 v1.WithCloudAuditLogsSourceServiceName(testServiceName),978 v1.WithCloudAuditLogsSourceMethodName(testMethodName),979 v1.WithCloudAuditLogsSourceProjectID(testProject),980 v1.WithCloudAuditLogsSourceSubscriptionID(v1.SubscriptionID),981 v1.WithInitCloudAuditLogsSourceConditions,982 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),983 v1.WithCloudAuditLogsSourcePullSubscriptionReady,984 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),985 v1.WithCloudAuditLogsSourceSetDefaults,986 v1.WithCloudAuditLogsSourceSinkNotReady("SinkNotPublisher", "%s: %s", failedToSetPermissionsMsg, "create-client-induced-error"),987 ),988 }},989 }, {990 Name: "sink created, set pubsub IAM policy fails",991 Objects: []runtime.Object{992 v1.NewCloudAuditLogsSource(sourceName, testNS,993 v1.WithCloudAuditLogsSourceUID(sourceUID),994 v1.WithCloudAuditLogsSourceMethodName(testMethodName),995 v1.WithCloudAuditLogsSourceServiceName(testServiceName),996 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),997 v1.WithCloudAuditLogsSourceServiceName(testServiceName),998 v1.WithCloudAuditLogsSourceMethodName(testMethodName),999 v1.WithCloudAuditLogsSourceSetDefaults,1000 ),1001 v1.NewTopic(sourceName, testNS,1002 v1.WithTopicSpec(inteventsv1.TopicSpec{1003 Topic: testTopicID,1004 PropagationPolicy: "CreateDelete",1005 EnablePublisher: &falseVal,1006 }),1007 v1.WithTopicReady(testTopicID),1008 v1.WithTopicAddress(testTopicURI),1009 v1.WithTopicProjectID(testProject),1010 v1.WithTopicSetDefaults,1011 ),1012 v1.NewPullSubscription(sourceName, testNS,1013 v1.WithPullSubscriptionReady(sinkURI),1014 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{1015 Topic: testTopicID,1016 PubSubSpec: gcpduckv1.PubSubSpec{1017 Secret: &secret,1018 SourceSpec: duckv1.SourceSpec{1019 Sink: newSinkDestination(),1020 },1021 },1022 AdapterType: string(converters.CloudAuditLogs),1023 })),1024 },1025 Key: testNS + "/" + sourceName,1026 OtherTestData: map[string]interface{}{1027 "pubsub": gpubsub.TestClientData{1028 HandleData: testiam.TestHandleData{1029 SetPolicyErr: errors.New("create-client-induced-error"),1030 },1031 },1032 "expectedSinks": map[string]*logadmin.Sink{1033 testSinkID: {1034 ID: testSinkID,1035 Filter: testFilter,1036 Destination: testTopicResource,1037 }},1038 },1039 WantPatches: []clientgotesting.PatchActionImpl{1040 patchFinalizers(testNS, sourceName, true),1041 },1042 WantEvents: []string{1043 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),1044 Eventf(corev1.EventTypeWarning, reconciledFailedReason, "Reconcile Sink failed with: create-client-induced-error"),1045 },1046 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{1047 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,1048 v1.WithCloudAuditLogsSourceUID(sourceUID),1049 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1050 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1051 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1052 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1053 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1054 v1.WithCloudAuditLogsSourceProjectID(testProject),1055 v1.WithCloudAuditLogsSourceSubscriptionID(v1.SubscriptionID),1056 v1.WithInitCloudAuditLogsSourceConditions,1057 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),1058 v1.WithCloudAuditLogsSourcePullSubscriptionReady,1059 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),1060 v1.WithCloudAuditLogsSourceSetDefaults,1061 v1.WithCloudAuditLogsSourceSinkNotReady("SinkNotPublisher", "%s: %s", failedToSetPermissionsMsg, "create-client-induced-error"),1062 ),1063 }},1064 }, {1065 Name: "sink created",1066 Objects: []runtime.Object{1067 v1.NewCloudAuditLogsSource(sourceName, testNS,1068 v1.WithCloudAuditLogsSourceUID(sourceUID),1069 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1070 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1071 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1072 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1073 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1074 v1.WithCloudAuditLogsSourceSetDefaults,1075 ),1076 v1.NewTopic(sourceName, testNS,1077 v1.WithTopicSpec(inteventsv1.TopicSpec{1078 Topic: testTopicID,1079 PropagationPolicy: "CreateDelete",1080 EnablePublisher: &falseVal,1081 }),1082 v1.WithTopicReady(testTopicID),1083 v1.WithTopicAddress(testTopicURI),1084 v1.WithTopicProjectID(testProject),1085 v1.WithTopicSetDefaults,1086 ),1087 v1.NewPullSubscription(sourceName, testNS,1088 v1.WithPullSubscriptionReady(sinkURI),1089 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{1090 Topic: testTopicID,1091 PubSubSpec: gcpduckv1.PubSubSpec{1092 Secret: &secret,1093 SourceSpec: duckv1.SourceSpec{1094 Sink: newSinkDestination(),1095 },1096 },1097 AdapterType: string(converters.CloudAuditLogs),1098 })),1099 },1100 Key: testNS + "/" + sourceName,1101 OtherTestData: map[string]interface{}{1102 "expectedSinks": map[string]*logadmin.Sink{1103 testSinkID: {1104 ID: testSinkID,1105 Filter: testFilter,1106 Destination: testTopicResource,1107 }},1108 },1109 WantPatches: []clientgotesting.PatchActionImpl{1110 patchFinalizers(testNS, sourceName, true),1111 },1112 WantEvents: []string{1113 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),1114 Eventf(corev1.EventTypeNormal, reconciledSuccessReason, `CloudAuditLogsSource reconciled: "%s/%s"`, testNS, sourceName),1115 },1116 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{1117 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,1118 v1.WithCloudAuditLogsSourceUID(sourceUID),1119 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1120 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1121 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1122 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1123 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1124 v1.WithCloudAuditLogsSourceProjectID(testProject),1125 v1.WithCloudAuditLogsSourceSubscriptionID(v1.SubscriptionID),1126 v1.WithInitCloudAuditLogsSourceConditions,1127 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),1128 v1.WithCloudAuditLogsSourcePullSubscriptionReady,1129 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),1130 v1.WithCloudAuditLogsSourceSinkReady,1131 v1.WithCloudAuditLogsSourceSinkID(testSinkID),1132 v1.WithCloudAuditLogsSourceSetDefaults,1133 ),1134 }},1135 }, {1136 Name: "sink exists",1137 Objects: []runtime.Object{1138 v1.NewCloudAuditLogsSource(sourceName, testNS,1139 v1.WithCloudAuditLogsSourceUID(sourceUID),1140 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1141 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1142 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1143 v1.WithCloudAuditLogsSourceSetDefaults,1144 ),1145 v1.NewTopic(sourceName, testNS,1146 v1.WithTopicSpec(inteventsv1.TopicSpec{1147 Topic: testTopicID,1148 PropagationPolicy: "CreateDelete",1149 EnablePublisher: &falseVal,1150 }),1151 v1.WithTopicReady(testTopicID),1152 v1.WithTopicAddress(testTopicURI),1153 v1.WithTopicProjectID(testProject),1154 v1.WithTopicSetDefaults,1155 ),1156 v1.NewPullSubscription(sourceName, testNS,1157 v1.WithPullSubscriptionReady(sinkURI),1158 v1.WithPullSubscriptionSpec(inteventsv1.PullSubscriptionSpec{1159 Topic: testTopicID,1160 PubSubSpec: gcpduckv1.PubSubSpec{1161 Secret: &secret,1162 SourceSpec: duckv1.SourceSpec{1163 Sink: newSinkDestination(),1164 },1165 },1166 AdapterType: string(converters.CloudAuditLogs),1167 })),1168 },1169 Key: testNS + "/" + sourceName,1170 OtherTestData: map[string]interface{}{1171 "existingSinks": []logadmin.Sink{{1172 ID: testSinkID,1173 Filter: testFilter,1174 Destination: testTopicResource,1175 }},1176 "expectedSinks": map[string]*logadmin.Sink{1177 testSinkID: {1178 ID: testSinkID,1179 Filter: testFilter,1180 Destination: testTopicResource,1181 }},1182 },1183 WantPatches: []clientgotesting.PatchActionImpl{1184 patchFinalizers(testNS, sourceName, true),1185 },1186 WantEvents: []string{1187 Eventf(corev1.EventTypeNormal, "FinalizerUpdate", "Updated %q finalizers", sourceName),1188 Eventf(corev1.EventTypeNormal, reconciledSuccessReason, `CloudAuditLogsSource reconciled: "%s/%s"`, testNS, sourceName),1189 },1190 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{1191 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,1192 v1.WithCloudAuditLogsSourceUID(sourceUID),1193 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1194 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1195 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1196 v1.WithCloudAuditLogsSourceProjectID(testProject),1197 v1.WithCloudAuditLogsSourceSubscriptionID(v1.SubscriptionID),1198 v1.WithInitCloudAuditLogsSourceConditions,1199 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),1200 v1.WithCloudAuditLogsSourcePullSubscriptionReady,1201 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),1202 v1.WithCloudAuditLogsSourceSinkReady,1203 v1.WithCloudAuditLogsSourceSinkID(testSinkID),1204 v1.WithCloudAuditLogsSourceSetDefaults,1205 ),1206 }},1207 }, {1208 Name: "sink delete fails",1209 Objects: []runtime.Object{1210 v1.NewCloudAuditLogsSource(sourceName, testNS,1211 v1.WithCloudAuditLogsSourceUID(sourceUID),1212 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1213 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1214 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1215 v1.WithCloudAuditLogsSourceProjectID(testProject),1216 v1.WithInitCloudAuditLogsSourceConditions,1217 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),1218 v1.WithCloudAuditLogsSourcePullSubscriptionReady,1219 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),1220 v1.WithCloudAuditLogsSourceSinkReady,1221 v1.WithCloudAuditLogsSourceSinkID(testSinkID),1222 v1.WithCloudAuditLogsSourceDeletionTimestamp,1223 v1.WithCloudAuditLogsSourceSetDefaults,1224 ),1225 v1.NewTopic(sourceName, testNS,1226 v1.WithTopicReady(testTopicID),1227 v1.WithTopicAddress(testTopicURI),1228 v1.WithTopicProjectID(testProject),1229 v1.WithTopicSetDefaults,1230 ),1231 v1.NewPullSubscription(sourceName, testNS,1232 v1.WithPullSubscriptionReady(sinkURI),1233 ),1234 },1235 Key: testNS + "/" + sourceName,1236 OtherTestData: map[string]interface{}{1237 "existingSinks": []logadmin.Sink{{1238 ID: testSinkID,1239 Filter: testFilter,1240 Destination: testTopicResource,1241 }},1242 "expectedSinks": map[string]*logadmin.Sink{1243 testSinkID: {1244 ID: testSinkID,1245 Filter: testFilter,1246 Destination: testTopicResource,1247 }},1248 "logadmin": glogadmintesting.TestClientConfiguration{1249 DeleteSinkErr: errors.New("delete-sink-induced-error"),1250 },1251 },1252 WantEvents: []string{1253 Eventf(corev1.EventTypeWarning, deleteSinkFailed, fmt.Sprintf("%s: delete-sink-induced-error", failedToDeleteSinkMsg)),1254 },1255 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{1256 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,1257 v1.WithCloudAuditLogsSourceUID(sourceUID),1258 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1259 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1260 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1261 v1.WithCloudAuditLogsSourceProjectID(testProject),1262 v1.WithInitCloudAuditLogsSourceConditions,1263 v1.WithCloudAuditLogsSourceSinkUnknown(deleteSinkFailed, fmt.Sprintf("%s: delete-sink-induced-error", failedToDeleteSinkMsg)),1264 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),1265 v1.WithCloudAuditLogsSourceSinkID(testSinkID),1266 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),1267 v1.WithCloudAuditLogsSourcePullSubscriptionReady,1268 v1.WithCloudAuditLogsSourceDeletionTimestamp,1269 v1.WithCloudAuditLogsSourceSetDefaults,1270 ),1271 }},1272 }, {1273 Name: "sink delete succeeds",1274 Objects: []runtime.Object{1275 v1.NewCloudAuditLogsSource(sourceName, testNS,1276 v1.WithCloudAuditLogsSourceUID(sourceUID),1277 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1278 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1279 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1280 v1.WithCloudAuditLogsSourceProjectID(testProject),1281 v1.WithInitCloudAuditLogsSourceConditions,1282 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),1283 v1.WithCloudAuditLogsSourcePullSubscriptionReady,1284 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),1285 v1.WithCloudAuditLogsSourceSinkReady,1286 v1.WithCloudAuditLogsSourceSinkID(testSinkID),1287 v1.WithCloudAuditLogsSourceDeletionTimestamp,1288 v1.WithCloudAuditLogsSourceSetDefaults,1289 ),1290 v1.NewTopic(sourceName, testNS,1291 v1.WithTopicReady(testTopicID),1292 v1.WithTopicAddress(testTopicURI),1293 v1.WithTopicProjectID(testProject),1294 v1.WithTopicSetDefaults,1295 ),1296 v1.NewPullSubscription(sourceName, testNS,1297 v1.WithPullSubscriptionReady(sinkURI),1298 ),1299 },1300 Key: testNS + "/" + sourceName,1301 OtherTestData: map[string]interface{}{1302 "existingSinks": []logadmin.Sink{{1303 ID: testSinkID,1304 Filter: testFilter,1305 Destination: testTopicResource,1306 }},1307 "expectedSinks": map[string]*logadmin.Sink{1308 testSinkID: nil,1309 },1310 },1311 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{1312 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,1313 v1.WithCloudAuditLogsSourceUID(sourceUID),1314 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1315 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1316 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1317 v1.WithInitCloudAuditLogsSourceConditions,1318 v1.WithCloudAuditLogsSourceSinkDeleted,1319 v1.WithCloudAuditLogsSourceTopicDeleted,1320 v1.WithCloudAuditLogsSourcePullSubscriptionDeleted,1321 v1.WithCloudAuditLogsSourceDeletionTimestamp,1322 v1.WithCloudAuditLogsSourceSetDefaults,1323 ),1324 }},1325 WantDeletes: []clientgotesting.DeleteActionImpl{1326 {ActionImpl: clientgotesting.ActionImpl{1327 Namespace: testNS, Verb: "delete", Resource: schema.GroupVersionResource{Group: "internal.events.cloud.google.com", Version: "v1", Resource: "topics"}},1328 Name: sourceName,1329 },1330 {ActionImpl: clientgotesting.ActionImpl{1331 Namespace: testNS, Verb: "delete", Resource: schema.GroupVersionResource{Group: "internal.events.cloud.google.com", Version: "v1", Resource: "pullsubscriptions"}},1332 Name: sourceName,1333 },1334 },1335 }, {1336 Name: "delete succeeds, sink does not exist",1337 Objects: []runtime.Object{1338 v1.NewCloudAuditLogsSource(sourceName, testNS,1339 v1.WithCloudAuditLogsSourceUID(sourceUID),1340 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1341 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1342 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1343 v1.WithCloudAuditLogsSourceProjectID(testProject),1344 v1.WithInitCloudAuditLogsSourceConditions,1345 v1.WithCloudAuditLogsSourceTopicReady(testTopicID),1346 v1.WithCloudAuditLogsSourcePullSubscriptionReady,1347 v1.WithCloudAuditLogsSourceSinkURI(calSinkURL),1348 v1.WithCloudAuditLogsSourceSinkReady,1349 v1.WithCloudAuditLogsSourceSinkID(testSinkID),1350 v1.WithCloudAuditLogsSourceDeletionTimestamp,1351 v1.WithCloudAuditLogsSourceSetDefaults,1352 ),1353 v1.NewTopic(sourceName, testNS,1354 v1.WithTopicReady(testTopicID),1355 v1.WithTopicAddress(testTopicURI),1356 v1.WithTopicProjectID(testProject),1357 v1.WithTopicSetDefaults,1358 ),1359 v1.NewPullSubscription(sourceName, testNS,1360 v1.WithPullSubscriptionReady(sinkURI),1361 ),1362 },1363 Key: testNS + "/" + sourceName,1364 OtherTestData: map[string]interface{}{1365 "expectedSinks": map[string]*logadmin.Sink{1366 testSinkID: nil,1367 },1368 },1369 WantStatusUpdates: []clientgotesting.UpdateActionImpl{{1370 Object: v1.NewCloudAuditLogsSource(sourceName, testNS,1371 v1.WithCloudAuditLogsSourceUID(sourceUID),1372 v1.WithCloudAuditLogsSourceMethodName(testMethodName),1373 v1.WithCloudAuditLogsSourceServiceName(testServiceName),1374 v1.WithCloudAuditLogsSourceSink(sinkGVK, sinkName),1375 v1.WithInitCloudAuditLogsSourceConditions,1376 v1.WithCloudAuditLogsSourceSinkDeleted,1377 v1.WithCloudAuditLogsSourceTopicDeleted,1378 v1.WithCloudAuditLogsSourcePullSubscriptionDeleted,1379 v1.WithCloudAuditLogsSourceDeletionTimestamp,1380 v1.WithCloudAuditLogsSourceSetDefaults,1381 ),1382 }},1383 WantDeletes: []clientgotesting.DeleteActionImpl{1384 {ActionImpl: clientgotesting.ActionImpl{1385 Namespace: testNS, Verb: "delete", Resource: schema.GroupVersionResource{Group: "internal.events.cloud.google.com", Version: "v1", Resource: "topics"}},1386 Name: sourceName,1387 },1388 {ActionImpl: clientgotesting.ActionImpl{1389 Namespace: testNS, Verb: "delete", Resource: schema.GroupVersionResource{Group: "internal.events.cloud.google.com", Version: "v1", Resource: "pullsubscriptions"}},1390 Name: sourceName,1391 },1392 },1393 }}1394 for _, tt := range table {1395 t.Run(tt.Name, func(t *testing.T) {1396 logadminClientProvider := glogadmintesting.TestClientCreator(tt.OtherTestData["logadmin"])1397 if existingSinks := tt.OtherTestData["existingSinks"]; existingSinks != nil {1398 createSinks(t, logadminClientProvider, existingSinks.([]logadmin.Sink))1399 }1400 tt.Test(t, MakeFactory(1401 func(ctx context.Context, listers *Listers, cmw configmap.Watcher, testData map[string]interface{}) controller.Reconciler {1402 r := &Reconciler{1403 PubSubBase: intevents.NewPubSubBase(ctx,1404 &intevents.PubSubBaseArgs{1405 ControllerAgentName: controllerAgentName,1406 ReceiveAdapterName: receiveAdapterName,1407 ReceiveAdapterType: string(converters.CloudAuditLogs),1408 ConfigWatcher: cmw,1409 }),1410 Identity: identity.NewIdentity(ctx, NoopIAMPolicyManager, NewGCPAuthTestStore(t, nil)),1411 auditLogsSourceLister: listers.GetCloudAuditLogsSourceLister(),1412 logadminClientProvider: logadminClientProvider,1413 pubsubClientProvider: gpubsub.TestClientCreator(testData["pubsub"]),1414 serviceAccountLister: listers.GetServiceAccountLister(),1415 }1416 return cloudauditlogssource.NewReconciler(ctx, r.Logger, r.RunClientSet, listers.GetCloudAuditLogsSourceLister(), r.Recorder, r)1417 }))1418 if expectedSinks := tt.OtherTestData["expectedSinks"]; expectedSinks != nil {1419 expectSinks(t, logadminClientProvider, expectedSinks.(map[string]*logadmin.Sink))1420 }1421 })1422 }1423}1424func createSinks(t *testing.T, clientProvider glogadmin.CreateFn, sinks []logadmin.Sink) {1425 logadminClient, err := clientProvider(context.Background(), testProject)1426 if err != nil {1427 t.Fatalf("failed to create logadmin client during setup: %s", err)1428 }1429 for _, sink := range sinks {1430 logadminClient.CreateSink(context.Background(), &sink)...

Full Screen

Full Screen

logs_service.pb.go

Source:logs_service.pb.go Github

copy

Full Screen

...33 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)34 // Verify that runtime/protoimpl is sufficiently up-to-date.35 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)36)37type ExportLogsServiceRequest struct {38 state protoimpl.MessageState39 sizeCache protoimpl.SizeCache40 unknownFields protoimpl.UnknownFields41 // An array of ResourceLogs.42 // For data coming from a single resource this array will typically contain one43 // element. Intermediary nodes (such as OpenTelemetry Collector) that receive44 // data from multiple origins typically batch the data before forwarding further and45 // in that case this array will contain multiple elements.46 ResourceLogs []*v1.ResourceLogs `protobuf:"bytes,1,rep,name=resource_logs,json=resourceLogs,proto3" json:"resource_logs,omitempty"`47}48func (x *ExportLogsServiceRequest) Reset() {49 *x = ExportLogsServiceRequest{}50 if protoimpl.UnsafeEnabled {51 mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[0]52 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))53 ms.StoreMessageInfo(mi)54 }55}56func (x *ExportLogsServiceRequest) String() string {57 return protoimpl.X.MessageStringOf(x)58}59func (*ExportLogsServiceRequest) ProtoMessage() {}60func (x *ExportLogsServiceRequest) ProtoReflect() protoreflect.Message {61 mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[0]62 if protoimpl.UnsafeEnabled && x != nil {63 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))64 if ms.LoadMessageInfo() == nil {65 ms.StoreMessageInfo(mi)66 }67 return ms68 }69 return mi.MessageOf(x)70}71// Deprecated: Use ExportLogsServiceRequest.ProtoReflect.Descriptor instead.72func (*ExportLogsServiceRequest) Descriptor() ([]byte, []int) {73 return file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescGZIP(), []int{0}74}75func (x *ExportLogsServiceRequest) GetResourceLogs() []*v1.ResourceLogs {76 if x != nil {77 return x.ResourceLogs78 }79 return nil80}81type ExportLogsServiceResponse struct {82 state protoimpl.MessageState83 sizeCache protoimpl.SizeCache84 unknownFields protoimpl.UnknownFields85}86func (x *ExportLogsServiceResponse) Reset() {87 *x = ExportLogsServiceResponse{}88 if protoimpl.UnsafeEnabled {89 mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[1]90 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))91 ms.StoreMessageInfo(mi)92 }93}94func (x *ExportLogsServiceResponse) String() string {95 return protoimpl.X.MessageStringOf(x)96}97func (*ExportLogsServiceResponse) ProtoMessage() {}98func (x *ExportLogsServiceResponse) ProtoReflect() protoreflect.Message {99 mi := &file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[1]100 if protoimpl.UnsafeEnabled && x != nil {101 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))102 if ms.LoadMessageInfo() == nil {103 ms.StoreMessageInfo(mi)104 }105 return ms106 }107 return mi.MessageOf(x)108}109// Deprecated: Use ExportLogsServiceResponse.ProtoReflect.Descriptor instead.110func (*ExportLogsServiceResponse) Descriptor() ([]byte, []int) {111 return file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescGZIP(), []int{1}112}113var File_opentelemetry_proto_collector_logs_v1_logs_service_proto protoreflect.FileDescriptor114var file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDesc = []byte{115 0x0a, 0x38, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2f,116 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f,117 0x6c, 0x6f, 0x67, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x73, 0x65, 0x72,118 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x6f, 0x70, 0x65, 0x6e,119 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,120 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x76,121 0x31, 0x1a, 0x26, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79,122 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6c,123 0x6f, 0x67, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, 0x0a, 0x18, 0x45, 0x78, 0x70,124 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65,125 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,126 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6f,127 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f,128 0x74, 0x6f, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75,129 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,130 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4c,131 0x6f, 0x67, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,132 0x73, 0x65, 0x32, 0x9d, 0x01, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69,133 0x63, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x06, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3f, 0x2e,134 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72,135 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6c, 0x6f,136 0x67, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x73,137 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40,138 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70,139 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6c,140 0x6f, 0x67, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x6f, 0x67,141 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,142 0x22, 0x00, 0x42, 0x70, 0x0a, 0x28, 0x69, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c,143 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6c,144 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x10,145 0x4c, 0x6f, 0x67, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f,146 0x50, 0x01, 0x5a, 0x30, 0x67, 0x6f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d,147 0x65, 0x74, 0x72, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74,148 0x6c, 0x70, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x6c, 0x6f, 0x67,149 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,150}151var (152 file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescOnce sync.Once153 file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescData = file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDesc154)155func file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescGZIP() []byte {156 file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescOnce.Do(func() {157 file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescData)158 })159 return file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDescData160}161var file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)162var file_opentelemetry_proto_collector_logs_v1_logs_service_proto_goTypes = []interface{}{163 (*ExportLogsServiceRequest)(nil), // 0: opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest164 (*ExportLogsServiceResponse)(nil), // 1: opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse165 (*v1.ResourceLogs)(nil), // 2: opentelemetry.proto.logs.v1.ResourceLogs166}167var file_opentelemetry_proto_collector_logs_v1_logs_service_proto_depIdxs = []int32{168 2, // 0: opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resource_logs:type_name -> opentelemetry.proto.logs.v1.ResourceLogs169 0, // 1: opentelemetry.proto.collector.logs.v1.LogsService.Export:input_type -> opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest170 1, // 2: opentelemetry.proto.collector.logs.v1.LogsService.Export:output_type -> opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse171 2, // [2:3] is the sub-list for method output_type172 1, // [1:2] is the sub-list for method input_type173 1, // [1:1] is the sub-list for extension type_name174 1, // [1:1] is the sub-list for extension extendee175 0, // [0:1] is the sub-list for field type_name176}177func init() { file_opentelemetry_proto_collector_logs_v1_logs_service_proto_init() }178func file_opentelemetry_proto_collector_logs_v1_logs_service_proto_init() {179 if File_opentelemetry_proto_collector_logs_v1_logs_service_proto != nil {180 return181 }182 if !protoimpl.UnsafeEnabled {183 file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {184 switch v := v.(*ExportLogsServiceRequest); i {185 case 0:186 return &v.state187 case 1:188 return &v.sizeCache189 case 2:190 return &v.unknownFields191 default:192 return nil193 }194 }195 file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {196 switch v := v.(*ExportLogsServiceResponse); i {197 case 0:198 return &v.state199 case 1:200 return &v.sizeCache201 case 2:202 return &v.unknownFields203 default:204 return nil205 }206 }207 }208 type x struct{}209 out := protoimpl.TypeBuilder{210 File: protoimpl.DescBuilder{211 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),212 RawDescriptor: file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDesc,213 NumEnums: 0,214 NumMessages: 2,215 NumExtensions: 0,216 NumServices: 1,217 },218 GoTypes: file_opentelemetry_proto_collector_logs_v1_logs_service_proto_goTypes,219 DependencyIndexes: file_opentelemetry_proto_collector_logs_v1_logs_service_proto_depIdxs,220 MessageInfos: file_opentelemetry_proto_collector_logs_v1_logs_service_proto_msgTypes,221 }.Build()222 File_opentelemetry_proto_collector_logs_v1_logs_service_proto = out.File223 file_opentelemetry_proto_collector_logs_v1_logs_service_proto_rawDesc = nil224 file_opentelemetry_proto_collector_logs_v1_logs_service_proto_goTypes = nil225 file_opentelemetry_proto_collector_logs_v1_logs_service_proto_depIdxs = nil226}227// Reference imports to suppress errors if they are not otherwise used.228var _ context.Context229var _ grpc.ClientConnInterface230// This is a compile-time assertion to ensure that this generated file231// is compatible with the grpc package it is being compiled against.232const _ = grpc.SupportPackageIsVersion6233// LogsServiceClient is the client API for LogsService service.234//235// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.236type LogsServiceClient interface {237 // For performance reasons, it is recommended to keep this RPC238 // alive for the entire life of the application.239 Export(ctx context.Context, in *ExportLogsServiceRequest, opts ...grpc.CallOption) (*ExportLogsServiceResponse, error)240}241type logsServiceClient struct {242 cc grpc.ClientConnInterface243}244func NewLogsServiceClient(cc grpc.ClientConnInterface) LogsServiceClient {245 return &logsServiceClient{cc}246}247func (c *logsServiceClient) Export(ctx context.Context, in *ExportLogsServiceRequest, opts ...grpc.CallOption) (*ExportLogsServiceResponse, error) {248 out := new(ExportLogsServiceResponse)249 err := c.cc.Invoke(ctx, "/opentelemetry.proto.collector.logs.v1.LogsService/Export", in, out, opts...)250 if err != nil {251 return nil, err252 }253 return out, nil254}255// LogsServiceServer is the server API for LogsService service.256type LogsServiceServer interface {257 // For performance reasons, it is recommended to keep this RPC258 // alive for the entire life of the application.259 Export(context.Context, *ExportLogsServiceRequest) (*ExportLogsServiceResponse, error)260}261// UnimplementedLogsServiceServer can be embedded to have forward compatible implementations.262type UnimplementedLogsServiceServer struct {263}264func (*UnimplementedLogsServiceServer) Export(context.Context, *ExportLogsServiceRequest) (*ExportLogsServiceResponse, error) {265 return nil, status.Errorf(codes.Unimplemented, "method Export not implemented")266}267func RegisterLogsServiceServer(s *grpc.Server, srv LogsServiceServer) {268 s.RegisterService(&_LogsService_serviceDesc, srv)269}270func _LogsService_Export_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {271 in := new(ExportLogsServiceRequest)272 if err := dec(in); err != nil {273 return nil, err274 }275 if interceptor == nil {276 return srv.(LogsServiceServer).Export(ctx, in)277 }278 info := &grpc.UnaryServerInfo{279 Server: srv,280 FullMethod: "/opentelemetry.proto.collector.logs.v1.LogsService/Export",281 }282 handler := func(ctx context.Context, req interface{}) (interface{}, error) {283 return srv.(LogsServiceServer).Export(ctx, req.(*ExportLogsServiceRequest))284 }285 return interceptor(ctx, in, info, handler)286}287var _LogsService_serviceDesc = grpc.ServiceDesc{288 ServiceName: "opentelemetry.proto.collector.logs.v1.LogsService",289 HandlerType: (*LogsServiceServer)(nil),290 Methods: []grpc.MethodDesc{291 {292 MethodName: "Export",293 Handler: _LogsService_Export_Handler,294 },295 },296 Streams: []grpc.StreamDesc{},297 Metadata: "opentelemetry/proto/collector/logs/v1/logs_service.proto",298}...

Full Screen

Full Screen

logs_panel.pb.go

Source:logs_panel.pb.go Github

copy

Full Screen

...29 // Verify that runtime/protoimpl is sufficiently up-to-date.30 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)31)32// A widget that displays a stream of log.33type LogsPanel struct {34 state protoimpl.MessageState35 sizeCache protoimpl.SizeCache36 unknownFields protoimpl.UnknownFields37 // A filter that chooses which log entries to return. See [Advanced Logs38 // Queries](https://cloud.google.com/logging/docs/view/advanced-queries).39 // Only log entries that match the filter are returned. An empty filter40 // matches all log entries.41 Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`42 // The names of logging resources to collect logs for. Currently only projects43 // are supported. If empty, the widget will default to the host project.44 ResourceNames []string `protobuf:"bytes,2,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"`45}46func (x *LogsPanel) Reset() {47 *x = LogsPanel{}48 if protoimpl.UnsafeEnabled {49 mi := &file_google_monitoring_dashboard_v1_logs_panel_proto_msgTypes[0]50 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))51 ms.StoreMessageInfo(mi)52 }53}54func (x *LogsPanel) String() string {55 return protoimpl.X.MessageStringOf(x)56}57func (*LogsPanel) ProtoMessage() {}58func (x *LogsPanel) ProtoReflect() protoreflect.Message {59 mi := &file_google_monitoring_dashboard_v1_logs_panel_proto_msgTypes[0]60 if protoimpl.UnsafeEnabled && x != nil {61 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))62 if ms.LoadMessageInfo() == nil {63 ms.StoreMessageInfo(mi)64 }65 return ms66 }67 return mi.MessageOf(x)68}69// Deprecated: Use LogsPanel.ProtoReflect.Descriptor instead.70func (*LogsPanel) Descriptor() ([]byte, []int) {71 return file_google_monitoring_dashboard_v1_logs_panel_proto_rawDescGZIP(), []int{0}72}73func (x *LogsPanel) GetFilter() string {74 if x != nil {75 return x.Filter76 }77 return ""78}79func (x *LogsPanel) GetResourceNames() []string {80 if x != nil {81 return x.ResourceNames82 }83 return nil84}85var File_google_monitoring_dashboard_v1_logs_panel_proto protoreflect.FileDescriptor86var file_google_monitoring_dashboard_v1_logs_panel_proto_rawDesc = []byte{87 0x0a, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72,88 0x69, 0x6e, 0x67, 0x2f, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x2f, 0x76, 0x31,89 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74,90 0x6f, 0x12, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f,91 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x2e, 0x76,92 0x31, 0x22, 0x4a, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x73, 0x50, 0x61, 0x6e, 0x65, 0x6c, 0x12, 0x16,93 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,94 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,95 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d,96 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x42, 0xf8, 0x01,97 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x6d, 0x6f, 0x6e,98 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72,99 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x4c, 0x6f, 0x67, 0x73, 0x50, 0x61, 0x6e, 0x65, 0x6c, 0x50,100 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x47, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67,101 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f,102 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x6d, 0x6f,103 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61,104 0x72, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0xaa,105 0x02, 0x24, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x4d,106 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f,107 0x61, 0x72, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x24, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c,108 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67,109 0x5c, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x5c, 0x56, 0x31, 0xea, 0x02, 0x28,110 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x3a, 0x3a, 0x4d,111 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x44, 0x61, 0x73, 0x68, 0x62,112 0x6f, 0x61, 0x72, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,113}114var (115 file_google_monitoring_dashboard_v1_logs_panel_proto_rawDescOnce sync.Once116 file_google_monitoring_dashboard_v1_logs_panel_proto_rawDescData = file_google_monitoring_dashboard_v1_logs_panel_proto_rawDesc117)118func file_google_monitoring_dashboard_v1_logs_panel_proto_rawDescGZIP() []byte {119 file_google_monitoring_dashboard_v1_logs_panel_proto_rawDescOnce.Do(func() {120 file_google_monitoring_dashboard_v1_logs_panel_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_monitoring_dashboard_v1_logs_panel_proto_rawDescData)121 })122 return file_google_monitoring_dashboard_v1_logs_panel_proto_rawDescData123}124var file_google_monitoring_dashboard_v1_logs_panel_proto_msgTypes = make([]protoimpl.MessageInfo, 1)125var file_google_monitoring_dashboard_v1_logs_panel_proto_goTypes = []interface{}{126 (*LogsPanel)(nil), // 0: google.monitoring.dashboard.v1.LogsPanel127}128var file_google_monitoring_dashboard_v1_logs_panel_proto_depIdxs = []int32{129 0, // [0:0] is the sub-list for method output_type130 0, // [0:0] is the sub-list for method input_type131 0, // [0:0] is the sub-list for extension type_name132 0, // [0:0] is the sub-list for extension extendee133 0, // [0:0] is the sub-list for field type_name134}135func init() { file_google_monitoring_dashboard_v1_logs_panel_proto_init() }136func file_google_monitoring_dashboard_v1_logs_panel_proto_init() {137 if File_google_monitoring_dashboard_v1_logs_panel_proto != nil {138 return139 }140 if !protoimpl.UnsafeEnabled {141 file_google_monitoring_dashboard_v1_logs_panel_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {142 switch v := v.(*LogsPanel); i {143 case 0:144 return &v.state145 case 1:146 return &v.sizeCache147 case 2:148 return &v.unknownFields149 default:150 return nil151 }152 }153 }154 type x struct{}155 out := protoimpl.TypeBuilder{156 File: protoimpl.DescBuilder{...

Full Screen

Full Screen

Logs

Using AI Code Generation

copy

Full Screen

1v1.Logs()2v1.Logs()3v1.Logs()4v1.Logs()5v1.Logs()6v1.Logs()7v1.Logs()8v1.Logs()9v1.Logs()10v1.Logs()11v1.Logs()12v1.Logs()13v1.Logs()14v1.Logs()15v1.Logs()16v1.Logs()17v1.Logs()18v1.Logs()19v1.Logs()20v1.Logs()21v1.Logs()22v1.Logs()

Full Screen

Full Screen

Logs

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 v1.Logs()4 v2.Logs()5}6func Logs() {7}8func Logs() {9}

Full Screen

Full Screen

Logs

Using AI Code Generation

copy

Full Screen

1v1.Logs("hello world")2v2.Logs("hello world")3v1.Logs("hello world")4v2.Logs("hello world")5v1.Logs("hello world")6v2.Logs("hello world")7v1.Logs("hello world")8v2.Logs("hello world")9v1.Logs("hello world")10v2.Logs("hello world")11v1.Logs("hello world")12v2.Logs("hello world")13v1.Logs("hello world")14v2.Logs("hello world")15v1.Logs("hello world")16v2.Logs("hello world")17v1.Logs("hello world")18v2.Logs("hello world")19v1.Logs("hello world")

Full Screen

Full Screen

Logs

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 logs.SetLogger(logs.AdapterFile, `{"filename":"test.log"}`)4 logs.SetLevel(logs.LevelDebug)5 logs.SetPrefix("prefix")6 logs.SetLogFuncCall(true)7 logs.Debug("use beego logs")8 logs.Trace("trace")9 logs.Info("info")10 logs.Warn("warning")11 logs.Error("error")12 logs.Critical("critical")13}14import (15func main() {16 logs.SetLogger(logs.AdapterConsole)17 logs.SetLevel(logs.LevelDebug)18 logs.SetPrefix("prefix")19 logs.SetLogFuncCall(true)20 logs.Debug("use

Full Screen

Full Screen

Logs

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 v1.Logs()4 fmt.Println("Hello world")5}6import (7func main() {8 v2.Logs()9 fmt.Println("Hello world")10}11import (12func main() {13 v3.Logs()14 fmt.Println("Hello world")15}16import (17func main() {18 v4.Logs()19 fmt.Println("Hello world")20}21import (22func main() {23 v5.Logs()24 fmt.Println("Hello world")25}26import (27func main() {28 v6.Logs()29 fmt.Println("Hello world")30}31import (32func main() {33 v7.Logs()34 fmt.Println("Hello world")35}36import (37func main() {38 v8.Logs()39 fmt.Println("Hello world")40}41import (42func main() {43 v9.Logs()44 fmt.Println("Hello world")45}46import (

Full Screen

Full Screen

Logs

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 fmt.Println("Hello, playground")4 log := golog.New("v1")5 log.Log("message", "Hello, playground")6 log.Logs("message", "Hello, playground")7}8The Logs() method is a shortcut

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Testkube automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful