Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support ephemeral containers #106

Merged
merged 1 commit into from
Apr 5, 2024
Merged

support ephemeral containers #106

merged 1 commit into from
Apr 5, 2024

Conversation

amirmalka
Copy link
Contributor

@amirmalka amirmalka commented Apr 4, 2024

Type

enhancement


Description

  • Added support for ephemeral containers in ApplicationProfileSpec, including JSON tags, deep copy, conversion, and OpenAPI schema definitions.
  • Updated discovery logic to include ephemeral containers in workload identification and image ID collection.
  • Extended ApplicationProfileProcessor to process ephemeral containers, ensuring they are included in pre-save operations.
  • Added unit tests to validate the processing of ephemeral containers.

Changes walkthrough

Relevant files
Enhancement
8 files
types.go
Support for Ephemeral Containers in ApplicationProfileSpec

pkg/apis/softwarecomposition/types.go

  • Added EphemeralContainers field to ApplicationProfileSpec struct.
  • +3/-2     
    types.go
    Add EphemeralContainers Field to ApplicationProfileSpec with JSON Tags

    pkg/apis/softwarecomposition/v1beta1/types.go

  • Added EphemeralContainers field with JSON tags and patch strategies to
    ApplicationProfileSpec struct.
  • +3/-0     
    zz_generated.conversion.go
    Autogenerated Conversion for EphemeralContainers                 

    pkg/apis/softwarecomposition/v1beta1/zz_generated.conversion.go

  • Added conversion logic for EphemeralContainers between internal and
    v1beta1 versions.
  • +2/-0     
    zz_generated.deepcopy.go
    Autogenerated DeepCopy for EphemeralContainers                     

    pkg/apis/softwarecomposition/v1beta1/zz_generated.deepcopy.go

    • Implemented deep copy logic for EphemeralContainers.
    +7/-0     
    zz_generated.deepcopy.go
    Support DeepCopy for EphemeralContainers                                 

    pkg/apis/softwarecomposition/zz_generated.deepcopy.go

  • Added deep copy logic for EphemeralContainers in
    ApplicationProfileSpec.
  • +7/-0     
    discovery.go
    Discover Ephemeral Containers in Workloads                             

    pkg/cleanup/discovery.go

  • Added logic to fetch workload identifiers from running ephemeral
    containers.
  • Included ephemeral container image IDs in the discovery process.
  • +29/-0   
    zz_generated.openapi.go
    OpenAPI Schema for EphemeralContainers                                     

    pkg/generated/openapi/zz_generated.openapi.go

    • Added OpenAPI schema properties for EphemeralContainers.
    +19/-0   
    processor.go
    Process EphemeralContainers in ApplicationProfile PreSave

    pkg/registry/file/processor.go

    • Extended PreSave logic to process EphemeralContainers.
    +4/-2     
    Tests
    1 files
    processor_test.go
    Test Processing of EphemeralContainers                                     

    pkg/registry/file/processor_test.go

    • Added test cases for processing EphemeralContainers.
    +22/-3   

    PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @codiumai-pr-agent-free codiumai-pr-agent-free bot added the enhancement New feature or request label Apr 4, 2024
    Copy link

    PR Description updated to latest commit (c3e80ea)

    Copy link

    PR Review

    ⏱️ Estimated effort to review [1-5]

    3, because the PR involves multiple files and touches on various aspects of the system including API changes, deep copy logic, conversion functions, discovery logic, and unit tests. The complexity is moderate, requiring a good understanding of the system's architecture and the implications of adding ephemeral containers support.

    🧪 Relevant tests

    Yes

    🔍 Possible issues

    Missing Validation: There's no explicit mention or addition of validation logic for the new EphemeralContainers field. It's important to ensure that the input for ephemeral containers meets the system's expectations and security policies.

    Update Documentation: The PR does not mention updating the documentation to reflect the changes and guide users on how to use ephemeral containers with the system. This is crucial for adoption and correct usage.

    🔒 Security concerns

    No


    ✨ Review tool usage guide:

    Overview:
    The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

    The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

    • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
    /review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
    
    [pr_reviewer]
    some_config1=...
    some_config2=...
    

    See the review usage page for a comprehensive guide on using this tool.

    Copy link

    github-actions bot commented Apr 4, 2024

    Summary:

    • License scan: failure
    • Credentials scan: failure
    • Vulnerabilities scan: failure
    • Unit test: success
    • Go linting: success

    @amirmalka amirmalka merged commit d0ee88d into main Apr 5, 2024
    6 checks passed
    @matthyx matthyx deleted the ephemeral-containers branch October 1, 2024 10:02
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants