Skip to content

Surface inaccessible GDrive items in SourceCrawler status - #294

Open
gshikhar2021 wants to merge 3 commits into
redhat-data-and-ai:mainfrom
gshikhar2021:failed-status
Open

Surface inaccessible GDrive items in SourceCrawler status#294
gshikhar2021 wants to merge 3 commits into
redhat-data-and-ai:mainfrom
gshikhar2021:failed-status

Conversation

@gshikhar2021

@gshikhar2021 gshikhar2021 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

When crawling Google Drive folders, files and folders the service account cannot access are now reported in the SourceCrawler CR status with full detail (folder IDs, file IDs, shortcut targets) instead of being silently discarded.

Example status

status:
  conditions:
    - lastTransitionTime: "2026-07-20T10:15:07Z"
      message: 'successfully reconciled source crawler: gdrive-pipeline-26-crawl, 2
        inaccessible items (service account may lack access)'
      reason: SuccessfullyReconciled
      status: "True"
      type: SourceCrawlerReady
  filesProcessed: 3
  inaccessibleItems:
    shortcutTargetFiles:
      - rootFolderID: 1wzLBEGf5xGOAPJzG1hPX39ekMNKgPO2L
        shortcutFileID: 1mavs...sKt3uA
        targetFileID: 10e...Q0r
    shortcutTargetFolders:
      - rootFolderID: 1wzLBEGf5xGOAPJzG1hPX39ekMNKgPO2L
        shortcutFileID: 1Wd4...xhj0Uylyh5e
        targetFolderID: 1pE0s...ze8Ko0G1UAmuFq
  lastAppliedGeneration: 1

New structure

status:
    conditions:
    - lastTransitionTime: "2026-07-27T10:39:46Z"
      message: 'successfully reconciled source crawler: gdrive-pipeline-27-crawl,
        2 inaccessible items (service account may lack access)'
      reason: SuccessfullyReconciled
      status: "True"
      type: SourceCrawlerReady
    filesProcessed: 3
    inaccessibleItems:
      count: 2
      items:
      - itemID: 1Wd4UvHBzIuxHWKLeWehRLxhj0Uylyh5e
        kind: shortcutFolder
        rootFolderID: 1wzLBEGf5xGOAPJzG1hPX39ekMNKgPO2L
        targetID: 1pE0slCF4-c4sNxCuyPze8KoOG1UAmuFq
      - itemID: 1mawcbS1ImFzxES_QdwPegDls1dsKt3uA
        kind: shortcutFile
        rootFolderID: 1wzLBEGf5xGOAPJzG1hPX39ekMNKgPO2L
        targetID: 10B8i0QDB1dGkmR6YkP2wMK-xXQtTyQOr
    lastAppliedGeneration: 1

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the observability of the SourceCrawler service by ensuring that files and folders inaccessible to the service account during a Google Drive crawl are explicitly tracked and reported. By updating the API schema and the reconciliation logic, users can now identify specific inaccessible items directly within the SourceCrawler custom resource status, facilitating easier troubleshooting of permission-related issues.

Highlights

  • Enhanced Error Reporting: Introduced a new mechanism to capture and report inaccessible Google Drive items (folders, files, and shortcuts) in the SourceCrawler status instead of silently discarding them.
  • API and CRD Updates: Updated the SourceCrawler API and CRD definitions to include the new InaccessibleItems structure in the status field.
  • Controller Logic Refactoring: Refactored the SyncFilesToFilestore interface to return a SyncResult object, allowing for the propagation of inaccessible item metadata back to the controller.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

When crawling Google Drive folders, files and folders the service
account cannot access are now reported in the SourceCrawler CR status
with full detail (folder IDs, file IDs, shortcut targets) instead of
being silently discarded

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces tracking of inaccessible items (folders, files, and shortcuts) during the source crawling process, updating the API types, CRD manifests, and controller logic to propagate this information to the SourceCrawler status. The feedback recommends improving error resilience by updating the status with partial results and adding nil checks when syncing fails, ensuring consistency in S3BucketSource by returning partial results on error, adding kubebuilder list markers to the new API fields for correct CRD merging, and pre-allocating slices in the conversion helper to optimize performance.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 141 to 144
syncResult, err := source.SyncFilesToFilestore(ctx, r.fileStore)
if err != nil {
return ctrl.Result{}, r.handleError(ctx, sourceCrawlerCR, fmt.Errorf("failed to store files to filestore: %w", err))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

If SyncFilesToFilestore returns an error (e.g., due to a transient download failure of a single file), any partial results (such as successfully stored files and newly discovered inaccessible items) are currently discarded because the controller returns early.

To make the status updates more resilient and ensure inaccessible items are surfaced even when some errors occur, we should update the status with the partial results before returning the error. Additionally, we should add a defensive nil check on syncResult to prevent potential nil pointer dereferences.

Suggested change
syncResult, err := source.SyncFilesToFilestore(ctx, r.fileStore)
if err != nil {
return ctrl.Result{}, r.handleError(ctx, sourceCrawlerCR, fmt.Errorf("failed to store files to filestore: %w", err))
}
syncResult, err := source.SyncFilesToFilestore(ctx, r.fileStore)
if err != nil {
if syncResult != nil {
inaccessible := toAPIInaccessibleItems(syncResult.InaccessibleItems)
_ = controllerutils.StatusPatch(ctx, r.Client, sourceCrawlerCR, func() {
sourceCrawlerCR.Status.FilesProcessed += int64(len(syncResult.StoredFiles))
sourceCrawlerCR.Status.InaccessibleItems = inaccessible
})
}
return ctrl.Result{}, r.handleError(ctx, sourceCrawlerCR, fmt.Errorf("failed to store files to filestore: %w", err))
}
if syncResult == nil {
return ctrl.Result{}, r.handleError(ctx, sourceCrawlerCR, fmt.Errorf("sync result is nil"))
}

}

return storedFiles, nil
return &SyncResult{StoredFiles: storedFiles}, nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In S3BucketSource.SyncFilesToFilestore, when len(errorMessage) > 0 (at line 120), the method currently returns nil, errors.New(errorMessage).

To ensure consistency with GDriveSource and to allow the controller to safely update the status with successfully processed files even when some errors occur, please update line 120 to return the partial SyncResult instead of nil:

return &SyncResult{StoredFiles: storedFiles}, errors.New(errorMessage)

Comment thread api/v1alpha1/sourcecrawler_types.go Outdated
Comment on lines +87 to +92
type InaccessibleItems struct {
Folders []InaccessibleFolder `json:"folders,omitempty"`
Files []InaccessibleFile `json:"files,omitempty"`
ShortcutTargetFolders []InaccessibleShortcutFolder `json:"shortcutTargetFolders,omitempty"`
ShortcutTargetFiles []InaccessibleShortcutFile `json:"shortcutTargetFiles,omitempty"`
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For list fields in Kubernetes CRDs, it is highly recommended to explicitly define +listType and +listMapKey markers. This ensures correct merging behavior during Server-Side Apply (SSA) and prevents duplicate keys.

Please update the struct as follows:

type InaccessibleItems struct {
	// +listType=map
	// +listMapKey=folderID
	Folders               []InaccessibleFolder         `json:"folders,omitempty"`
	// +listType=map
	// +listMapKey=fileID
	Files                 []InaccessibleFile           `json:"files,omitempty"`
	// +listType=map
	// +listMapKey=shortcutFileID
	ShortcutTargetFolders []InaccessibleShortcutFolder `json:"shortcutTargetFolders,omitempty"`
	// +listType=map
	// +listMapKey=shortcutFileID
	ShortcutTargetFiles   []InaccessibleShortcutFile   `json:"shortcutTargetFiles,omitempty"`
}
References
  1. Avoid implementing redundant manual validation for duplicate keys in list fields within controller logic if duplicate prevention is already enforced at the CRD level using kubebuilder markers like +listType=map and +listMapKey.

Comment on lines +324 to +345
result := &operatorv1alpha1.InaccessibleItems{}
for _, f := range items.Folders {
result.Folders = append(result.Folders, operatorv1alpha1.InaccessibleFolder{
FolderID: f.FolderID, FolderName: f.FolderName, RootFolderID: f.RootFolderID,
})
}
for _, f := range items.Files {
result.Files = append(result.Files, operatorv1alpha1.InaccessibleFile{
FileID: f.FileID, ParentFolderID: f.ParentFolderID, RootFolderID: f.RootFolderID,
})
}
for _, f := range items.ShortcutTargetFolders {
result.ShortcutTargetFolders = append(result.ShortcutTargetFolders, operatorv1alpha1.InaccessibleShortcutFolder{
ShortcutFileID: f.ShortcutFileID, TargetFolderID: f.TargetFolderID, RootFolderID: f.RootFolderID,
})
}
for _, f := range items.ShortcutTargetFiles {
result.ShortcutTargetFiles = append(result.ShortcutTargetFiles, operatorv1alpha1.InaccessibleShortcutFile{
ShortcutFileID: f.ShortcutFileID, TargetFileID: f.TargetFileID, RootFolderID: f.RootFolderID,
})
}
return result

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Pre-allocating the slices in operatorv1alpha1.InaccessibleItems using make with the appropriate capacity avoids multiple allocations and slice copies during the append loops.

	result := &operatorv1alpha1.InaccessibleItems{
		Folders:               make([]operatorv1alpha1.InaccessibleFolder, 0, len(items.Folders)),
		Files:                 make([]operatorv1alpha1.InaccessibleFile, 0, len(items.Files)),
		ShortcutTargetFolders: make([]operatorv1alpha1.InaccessibleShortcutFolder, 0, len(items.ShortcutTargetFolders)),
		ShortcutTargetFiles:   make([]operatorv1alpha1.InaccessibleShortcutFile, 0, len(items.ShortcutTargetFiles)),
	}
	for _, f := range items.Folders {
		result.Folders = append(result.Folders, operatorv1alpha1.InaccessibleFolder{
			FolderID: f.FolderID, FolderName: f.FolderName, RootFolderID: f.RootFolderID,
		})
	}
	for _, f := range items.Files {
		result.Files = append(result.Files, operatorv1alpha1.InaccessibleFile{
			FileID: f.FileID, ParentFolderID: f.ParentFolderID, RootFolderID: f.RootFolderID,
		})
	}
	for _, f := range items.ShortcutTargetFolders {
		result.ShortcutTargetFolders = append(result.ShortcutTargetFolders, operatorv1alpha1.InaccessibleShortcutFolder{
			ShortcutFileID: f.ShortcutFileID, TargetFolderID: f.TargetFolderID, RootFolderID: f.RootFolderID,
		})
	}
	for _, f := range items.ShortcutTargetFiles {
		result.ShortcutTargetFiles = append(result.ShortcutTargetFiles, operatorv1alpha1.InaccessibleShortcutFile{
			ShortcutFileID: f.ShortcutFileID, TargetFileID: f.TargetFileID, RootFolderID: f.RootFolderID,
		})
	}

@vinamra28

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces tracking and reporting of inaccessible items (folders, files, and shortcuts) during source crawling. It updates the DataSource interface and its implementations to return a SyncResult containing both stored files and inaccessible items, and updates the SourceCrawler CRD and controller to store this information in the resource status. The review feedback suggests two improvements: first, updating the status with partial results (successfully processed files and inaccessible items) even if SyncFilesToFilestore returns an error, and second, refactoring toAPIInaccessibleItems to return the total count of inaccessible items to avoid redundant calculations in the controller.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 141 to 144
syncResult, err := source.SyncFilesToFilestore(ctx, r.fileStore)
if err != nil {
return ctrl.Result{}, r.handleError(ctx, sourceCrawlerCR, fmt.Errorf("failed to store files to filestore: %w", err))
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

If SyncFilesToFilestore returns an error (e.g., due to transient download failures of some files in Phase 2), the controller immediately returns and calls r.handleError. This completely discards any successfully processed files and, more importantly, the list of inaccessible items discovered during the crawl phase (Phase 1). We should update the status with the partial results even if there's an error, as long as syncResult is not nil.

Suggested change
syncResult, err := source.SyncFilesToFilestore(ctx, r.fileStore)
if err != nil {
return ctrl.Result{}, r.handleError(ctx, sourceCrawlerCR, fmt.Errorf("failed to store files to filestore: %w", err))
}
syncResult, err := source.SyncFilesToFilestore(ctx, r.fileStore)
if err != nil {
if syncResult != nil {
inaccessible, _ := toAPIInaccessibleItems(syncResult.InaccessibleItems)
_ = controllerutils.StatusPatch(ctx, r.Client, sourceCrawlerCR, func() {
sourceCrawlerCR.Status.FilesProcessed += int64(len(syncResult.StoredFiles))
sourceCrawlerCR.Status.InaccessibleItems = inaccessible
sourceCrawlerCR.UpdateStatus("", err)
})
} else {
_ = r.handleError(ctx, sourceCrawlerCR, err)
}
return ctrl.Result{}, fmt.Errorf("failed to store files to filestore: %w", err)
}

Comment on lines +148 to +153
inaccessible := toAPIInaccessibleItems(syncResult.InaccessibleItems)
if inaccessible != nil {
total := len(syncResult.InaccessibleItems.Folders) + len(syncResult.InaccessibleItems.Files) +
len(syncResult.InaccessibleItems.ShortcutTargetFolders) + len(syncResult.InaccessibleItems.ShortcutTargetFiles)
successMessage += fmt.Sprintf(", %d inaccessible items (service account may lack access)", total)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The total number of inaccessible items is calculated redundantly here. Since toAPIInaccessibleItems already calculates total to check if it's 0, we can return this count from toAPIInaccessibleItems to avoid recalculating it in Reconcile.

	inaccessible, total := toAPIInaccessibleItems(syncResult.InaccessibleItems)
	if inaccessible != nil {
		successMessage += fmt.Sprintf(", %d inaccessible items (service account may lack access)", total)
	}

Comment on lines +319 to +346
func toAPIInaccessibleItems(items gdrive.InaccessibleItems) *operatorv1alpha1.InaccessibleItems {
total := len(items.Folders) + len(items.Files) + len(items.ShortcutTargetFolders) + len(items.ShortcutTargetFiles)
if total == 0 {
return nil
}
result := &operatorv1alpha1.InaccessibleItems{}
for _, f := range items.Folders {
result.Folders = append(result.Folders, operatorv1alpha1.InaccessibleFolder{
FolderID: f.FolderID, FolderName: f.FolderName, RootFolderID: f.RootFolderID,
})
}
for _, f := range items.Files {
result.Files = append(result.Files, operatorv1alpha1.InaccessibleFile{
FileID: f.FileID, ParentFolderID: f.ParentFolderID, RootFolderID: f.RootFolderID,
})
}
for _, f := range items.ShortcutTargetFolders {
result.ShortcutTargetFolders = append(result.ShortcutTargetFolders, operatorv1alpha1.InaccessibleShortcutFolder{
ShortcutFileID: f.ShortcutFileID, TargetFolderID: f.TargetFolderID, RootFolderID: f.RootFolderID,
})
}
for _, f := range items.ShortcutTargetFiles {
result.ShortcutTargetFiles = append(result.ShortcutTargetFiles, operatorv1alpha1.InaccessibleShortcutFile{
ShortcutFileID: f.ShortcutFileID, TargetFileID: f.TargetFileID, RootFolderID: f.RootFolderID,
})
}
return result
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Modify toAPIInaccessibleItems to return both the mapped inaccessible items and the total count. This avoids redundant calculations in the reconciler.

func toAPIInaccessibleItems(items gdrive.InaccessibleItems) (*operatorv1alpha1.InaccessibleItems, int) {
	total := len(items.Folders) + len(items.Files) + len(items.ShortcutTargetFolders) + len(items.ShortcutTargetFiles)
	if total == 0 {
		return nil, 0
	}
	result := &operatorv1alpha1.InaccessibleItems{}
	for _, f := range items.Folders {
		result.Folders = append(result.Folders, operatorv1alpha1.InaccessibleFolder{
			FolderID: f.FolderID, FolderName: f.FolderName, RootFolderID: f.RootFolderID,
		})
	}
	for _, f := range items.Files {
		result.Files = append(result.Files, operatorv1alpha1.InaccessibleFile{
			FileID: f.FileID, ParentFolderID: f.ParentFolderID, RootFolderID: f.RootFolderID,
		})
	}
	for _, f := range items.ShortcutTargetFolders {
		result.ShortcutTargetFolders = append(result.ShortcutTargetFolders, operatorv1alpha1.InaccessibleShortcutFolder{
			ShortcutFileID: f.ShortcutFileID, TargetFolderID: f.TargetFolderID, RootFolderID: f.RootFolderID,
		})
	}
	for _, f := range items.ShortcutTargetFiles {
		result.ShortcutTargetFiles = append(result.ShortcutTargetFiles, operatorv1alpha1.InaccessibleShortcutFile{
			ShortcutFileID: f.ShortcutFileID, TargetFileID: f.TargetFileID, RootFolderID: f.RootFolderID,
		})
	}
	return result, total
}

Comment thread internal/controller/sourcecrawler_controller.go Outdated
Comment thread internal/controller/sourcecrawler_controller.go Outdated
@vinamra28

Copy link
Copy Markdown
Member

how does the final YAML look like?

return reconcileErr
}

func toAPIInaccessibleItems(items gdrive.InaccessibleItems) (*operatorv1alpha1.InaccessibleItems, int) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a better function name ?

Comment thread pkg/unstructured/source.go Outdated

// Merge and filter crawl records to only successful non-folder files
var fileRecords []gdrive.CrawlRecord
var mergedInaccessible gdrive.InaccessibleItems

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work if the source is s3 ?

if err := controllerutils.StatusPatch(ctx, r.Client, sourceCrawlerCR, func() {
sourceCrawlerCR.Status.FilesProcessed += int64(len(syncResult.StoredFiles))
sourceCrawlerCR.Status.InaccessibleItems = inaccessible
sourceCrawlerCR.UpdateStatus("", syncErr)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we updating the status twice here ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, we are writing error twice, @gshikhar2021, can you please fix this?

Comment thread api/v1alpha1/sourcecrawler_types.go Outdated
LastAppliedGeneration int64 `json:"lastAppliedGeneration,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
FilesProcessed int64 `json:"filesProcessed,omitempty"`
InaccessibleItems *InaccessibleItems `json:"inaccessibleItems,omitempty"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to have some limit here, because if there are let's say for example 1000 folders then the CR size would be huge and it would be restricted by k8s

Comment thread api/v1alpha1/sourcecrawler_types.go Outdated
Comment on lines +63 to +85
type InaccessibleFolder struct {
FolderID string `json:"folderID"`
FolderName string `json:"folderName"`
RootFolderID string `json:"rootFolderID"`
}

type InaccessibleFile struct {
FileID string `json:"fileID"`
ParentFolderID string `json:"parentFolderID"`
RootFolderID string `json:"rootFolderID"`
}

type InaccessibleShortcutFolder struct {
ShortcutFileID string `json:"shortcutFileID"`
TargetFolderID string `json:"targetFolderID"`
RootFolderID string `json:"rootFolderID"`
}

type InaccessibleShortcutFile struct {
ShortcutFileID string `json:"shortcutFileID"`
TargetFileID string `json:"targetFileID"`
RootFolderID string `json:"rootFolderID"`
}

@vinamra28 vinamra28 Jul 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of defining 4 different types, can we do in one?

type InaccessibleItem struct {
    Kind         string `json:"kind"`                   // folder, file, shortcutFolder, shortcutFile
    ID       string `json:"itemID"`
    Name         string `json:"name,omitempty"`
    TargetID     string `json:"targetID,omitempty"`      // for shortcuts
    RootFolderID string `json:"rootFolderID"`
    Reason string `json:"reason"`
}

also included a reason field which I think will be helpful. In case of gdrive, we can get the information from GetFileMetadata/ListFolderContents

Comment thread api/v1alpha1/sourcecrawler_types.go Outdated
Comment on lines +88 to +91
Folders []InaccessibleFolder `json:"folders,omitempty"`
Files []InaccessibleFile `json:"files,omitempty"`
ShortcutTargetFolders []InaccessibleShortcutFolder `json:"shortcutTargetFolders,omitempty"`
ShortcutTargetFiles []InaccessibleShortcutFile `json:"shortcutTargetFiles,omitempty"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can then be:

Suggested change
Folders []InaccessibleFolder `json:"folders,omitempty"`
Files []InaccessibleFile `json:"files,omitempty"`
ShortcutTargetFolders []InaccessibleShortcutFolder `json:"shortcutTargetFolders,omitempty"`
ShortcutTargetFiles []InaccessibleShortcutFile `json:"shortcutTargetFiles,omitempty"`
Items []InaccessibleItem `json:"items,omitempty"`
Count int `json:"count"`

inaccessible, _ := toAPIInaccessibleItems(syncResult.InaccessibleItems)
if err := controllerutils.StatusPatch(ctx, r.Client, sourceCrawlerCR, func() {
sourceCrawlerCR.Status.FilesProcessed += int64(len(syncResult.StoredFiles))
sourceCrawlerCR.Status.InaccessibleItems = inaccessible

@vinamra28 vinamra28 Jul 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might have to see what's the upper cap that CR can hold else we might end up blowing 1.5MB limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants