Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

refactor: ScanResult states #379

Merged
merged 1 commit into from
Jun 8, 2023
Merged

Conversation

chrisgacsal
Copy link
Contributor

@chrisgacsal chrisgacsal commented Jun 7, 2023

Description

  • use CamelCase for naming

  • make ScanResult states more generic and granular to be applicable for different type of assets (VM, Dir, Pod, etc)

    Old Name New Name Description
    INIT Pending Initial state for ScanResult waiting for being scheduled
    - Scheduled ScanResult which has been scheduled on Provider
    ATTACHED ReadyToScan Provider acknowledged that scan for ScanResult is ready to run
    ABORTED Aborted ScanResult has been aborted and the vmclarity-scanner needs to cancel all running scanners and shutdown gracefully
    IN_PROGRESS InProgress vmclarity-scanner is running scanners on Asset
    DONE Done vmclarity-scanner has finished with running all scanners on Asset
    NOT_SCANNED NotScanned Scanners are skipped for ScanResult
  • modify ScanResultWatcher by splitting the reconcile logic to handle Pending and Scheduled states separately

  • rename WaitForAttachment in vmclarity-scanner to WaitForReadyState as the corresponding ATTACHED state has been changed to ReadyToScan.

Type of Change

[ ] Bug Fix
[ ] New Feature
[ ] Breaking Change
[x] Refactor
[ ] Documentation
[ ] Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@chrisgacsal chrisgacsal self-assigned this Jun 7, 2023
@chrisgacsal chrisgacsal added enhancement New feature or request go Pull requests that update Go code labels Jun 7, 2023
@chrisgacsal chrisgacsal marked this pull request as ready for review June 7, 2023 22:15
@chrisgacsal chrisgacsal requested a review from a team as a code owner June 7, 2023 22:15
cli/cmd/root.go Outdated Show resolved Hide resolved
@chrisgacsal chrisgacsal force-pushed the refactor-scanresult-states branch 2 times, most recently from 6263f30 to 1cec226 Compare June 8, 2023 11:46
@chrisgacsal chrisgacsal requested review from FrimIdan and a user June 8, 2023 11:46
cli/cmd/root.go Outdated Show resolved Hide resolved
@chrisgacsal chrisgacsal added this pull request to the merge queue Jun 8, 2023
Merged via the queue into main with commit 04d3ef9 Jun 8, 2023
@chrisgacsal chrisgacsal deleted the refactor-scanresult-states branch June 8, 2023 14:58
@FrimIdan FrimIdan mentioned this pull request Jun 11, 2023
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants