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

Add name to ContainerPort #6127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add name to ContainerPort #6127

wants to merge 1 commit into from

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Dec 28, 2024

Tracking issue

NA

Why are the changes needed?

Allow people to change the name of the port in the PodSpec

What changes were proposed in this pull request?

Add name to ContainerPort proto

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Summary by Bito

This PR introduces a new 'name' field to ContainerPort configuration, enabling custom port naming in PodSpec. The implementation spans multiple language bindings (Go, JavaScript, Python, Rust) with complete type definitions and serialization support. The changes enhance container port configuration flexibility in Kubernetes pod specifications.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 3

@flyte-bot
Copy link
Collaborator

flyte-bot commented Dec 28, 2024

Code Review Agent Run #bd6268

Actionable Suggestions - 1
  • flyteidl/gen/pb-es/flyteidl/core/tasks_pb.ts - 1
Review Details
  • Files reviewed - 8 · Commit Range: ae1670b..ae1670b
    • flyteidl/gen/pb-es/flyteidl/core/tasks_pb.ts
    • flyteidl/gen/pb-go/flyteidl/core/tasks.pb.go
    • flyteidl/gen/pb-js/flyteidl.d.ts
    • flyteidl/gen/pb-js/flyteidl.js
    • flyteidl/gen/pb_python/flyteidl/core/tasks_pb2.py
    • flyteidl/gen/pb_python/flyteidl/core/tasks_pb2.pyi
    • flyteidl/gen/pb_rust/flyteidl.core.rs
    • flyteidl/protos/flyteidl/core/tasks.proto
  • Files skipped - 4
    • flyteidl/clients/go/assets/admin.swagger.json - Reason: Filter setting
    • flyteidl/gen/pb-go/gateway/flyteidl/service/admin.swagger.json - Reason: Filter setting
    • flyteidl/gen/pb-go/gateway/flyteidl/service/agent.swagger.json - Reason: Filter setting
    • flyteidl/gen/pb-go/gateway/flyteidl/service/external_plugin_service.swagger.json - Reason: Filter setting
  • Tools
    • Golangci-lint (Linter) - ✖︎ Failed
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • GOVULNCHECK (Security Vulnerability) - ✖︎ Failed
    • OWASP (Security Vulnerability) - ✔︎ Successful
    • SNYK (Security Vulnerability) - ✔︎ Successful

AI Code Review powered by Bito Logo

Copy link

codecov bot commented Dec 28, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 37.01%. Comparing base (61838b4) to head (ae1670b).

Files with missing lines Patch % Lines
flyteidl/gen/pb-go/flyteidl/core/tasks.pb.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6127   +/-   ##
=======================================
  Coverage   37.01%   37.01%           
=======================================
  Files        1318     1318           
  Lines      132525   132530    +5     
=======================================
+ Hits        49052    49054    +2     
- Misses      79228    79231    +3     
  Partials     4245     4245           
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 54.25% <ø> (+0.02%) ⬆️
unittests-flytecopilot 30.99% <ø> (ø)
unittests-flytectl 62.29% <ø> (-0.05%) ⬇️
unittests-flyteidl 7.23% <0.00%> (-0.01%) ⬇️
unittests-flyteplugins 53.86% <ø> (ø)
unittests-flytepropeller 42.59% <ø> (ø)
unittests-flytestdlib 55.18% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@flyte-bot
Copy link
Collaborator

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Enhanced Container Port Configuration

tasks_pb.ts - Added name field to ContainerPort class with documentation

tasks.pb.go - Implemented name field in ContainerPort struct with getter method

Feature Improvement - Enhanced Container Port Configuration

tasks.pb.go - Updated protobuf definitions to include name field in ContainerPort

flyteidl.d.ts - Added name field type definitions to ContainerPort interface

flyteidl.js - Implemented name field in ContainerPort class with documentation

tasks_pb2.py - Updated serialization endpoints for ContainerPort with name field

tasks_pb2.pyi - Added name field to ContainerPort class type hints

flyteidl.core.rs - Added name field to ContainerPort struct with documentation

tasks.proto - Added name field to ContainerPort message definition

*
* @generated from field: string name = 2;
*/
name = "";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider adding name field validation

Consider adding validation for the name field since it's used to expose ports on pod's IP address. Empty string validation may be needed.

Code suggestion
Check the AI-generated fix before applying
Suggested change
name = "";
private _name = "";
set name(value: string) {
if (!value) {
throw new Error("ContainerPort name cannot be empty");
}
this._name = value;
}

Code Review Run #bd6268


Is this a valid issue, or was it incorrectly flagged by the Agent?

  • it was incorrectly flagged

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.

2 participants