func updateDiscoveryNoteAndOcc()

in pkg/vul/discovery.go [19:42]


func updateDiscoveryNoteAndOcc(ctx context.Context, projectID string, resourceURL string) error {
	if projectID == "" {
		return types.ErrMissingProject
	}

	// don't submit end-to-end test
	if projectID == types.TestProjectID {
		return nil
	}

	c, err := ca.NewClient(ctx)
	if err != nil {
		return errors.Wrap(err, "error creating client")
	}
	defer c.Close()

	p := fmt.Sprintf("projects/%s", projectID)
	discoveryNoteID := "aactl-PACKAGE_VULNERABILITY"
	if err := updateDiscoveryNote(ctx, p, discoveryNoteID, c); err != nil {
		return err
	}

	return updateDiscoveryOcc(ctx, p, discoveryNoteID, resourceURL, c)
}