fix(ctl): set default waypoint image to v1.0.0-alpha#1767
fix(ctl): set default waypoint image to v1.0.0-alpha#1767Kritagya123611 wants to merge 4 commits into
Conversation
Addresses issue kmesh-net#1213 by defaulting the kmeshctl waypoint apply image flag to the stable v1.0.0-alpha release, preventing runtime errors caused by non-existent fallback dev tags. Signed-off-by: Kritagya <jhakritagya45@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello, 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 resolves an issue where the kmeshctl waypoint apply command would default to an invalid image tag during development cycles. By explicitly setting a stable default image, the command now ensures successful deployments for end users while maintaining the ability to override the image via CLI flags. Highlights
Using Gemini Code AssistThe 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
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 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. The flag was blank and caused a fright, / The image tag was out of sight. / Now v1.0.0-alpha stands, / To guide the waypoint in our hands. Footnotes
|
|
Welcome @Kritagya123611! It looks like this is your first PR to kmesh-net/kmesh 🎉 |
There was a problem hiding this comment.
Code Review
This pull request updates the default value of the waypoint image flag to a hardcoded alpha version. The reviewer noted that this change bypasses dynamic fallback logic and creates maintenance issues for future releases, recommending instead to keep the default empty and handle the fallback dynamically.
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.
| waypointCmd.PersistentFlags().StringVarP(&namespace, "namespace", "n", "", "Kubernetes namespace") | ||
| waypointCmd.PersistentFlags().StringVarP(&waypointName, "name", "", constants.DefaultNamespaceWaypoint, "name of the waypoint") | ||
| waypointCmd.PersistentFlags().StringVarP(&image, "image", "", "", "image of the waypoint") | ||
| waypointCmd.PersistentFlags().StringVarP(&image, "image", "", "ghcr.io/kmesh-net/waypoint:v1.0.0-alpha", "image of the waypoint") |
There was a problem hiding this comment.
Hardcoding the default image to "ghcr.io/kmesh-net/waypoint:v1.0.0-alpha" in the flag definition introduces two major issues:
- Dead Code: It completely bypasses the fallback logic in
getKmeshWaypointImage()(lines 627-637) because theimagevariable will never be empty. - Maintenance & Release Issues: For future stable releases (e.g.,
v1.0.0orv1.1.0), the default waypoint image will remain stuck atv1.0.0-alphaunless this flag default is manually updated in the code.
Recommendation
Keep the flag's default value as "" and handle the fallback logic dynamically inside getKmeshWaypointImage(). If the current build version is a development version (e.g., 0.0.0-master or contains -dev), fall back to the stable v1.0.0-alpha image. Otherwise, use the matching release version.
For example, update getKmeshWaypointImage() as follows:
func getKmeshWaypointImage() string {
if image != "" {
return image
}
ver := version.Get().GitVersion
ver = strings.TrimPrefix(ver, "v")
// Fallback to stable release for dev/master builds to prevent runtime errors
if ver == "0.0.0-master" || strings.Contains(ver, "-dev") {
return "ghcr.io/kmesh-net/waypoint:v1.0.0-alpha"
}
return fmt.Sprintf("ghcr.io/kmesh-net/waypoint:v%s", ver)
}| waypointCmd.PersistentFlags().StringVarP(&image, "image", "", "ghcr.io/kmesh-net/waypoint:v1.0.0-alpha", "image of the waypoint") | |
| waypointCmd.PersistentFlags().StringVarP(&image, "image", "", "", "image of the waypoint") |
There was a problem hiding this comment.
Pull request overview
This PR fixes kmeshctl waypoint apply runtime failures caused by defaulting the waypoint image to an unreleased dev tag by explicitly setting the default --image flag value to a known-published GHCR image (ghcr.io/kmesh-net/waypoint:v1.0.0-alpha). This aligns the CLI’s default behavior with the documented/expected image from issue #1213.
Changes:
- Set the default value of the
--imagepersistent flag forkmeshctl waypointtoghcr.io/kmesh-net/waypoint:v1.0.0-alpha.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Moves fallback logic inside getKmeshWaypointImage instead of hardcoding the flag default, preventing dead code and allowing proper version tracking. Signed-off-by: Kritagya <jhakritagya45@gmail.com>
…flakes Signed-off-by: Kritagya <jhakritagya45@gmail.com>
| if [ "$bpf_ok" = false ]; then | ||
| output=$(kubectl -n kmesh-system exec "$POD" -- curl -s --max-time 5 -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"name":"bpf","level":"debug"}' http://127.0.0.1:15200/debug/loggers 2>&1) | ||
| if echo "$output" | grep -q "set BPF Log Level: 3"; then |
| if [ "$default_ok" = false ]; then | ||
| output=$(kubectl -n kmesh-system exec "$POD" -- curl -s --max-time 5 -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"name":"default","level":"debug"}' http://127.0.0.1:15200/debug/loggers 2>&1) | ||
| if echo "$output" | grep -q "OK"; then |
| if [ "$bpf_ok" = false ]; then | ||
| output=$(kubectl -n kmesh-system exec "$POD" -- curl -s --max-time 5 -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"name":"bpf","level":"debug"}' http://127.0.0.1:15200/debug/loggers 2>&1) | ||
| if echo "$output" | grep -q "set BPF Log Level: 3"; then |
| if [ "$default_ok" = false ]; then | ||
| output=$(kubectl -n kmesh-system exec "$POD" -- curl -s --max-time 5 -X POST \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"name":"default","level":"debug"}' http://127.0.0.1:15200/debug/loggers 2>&1) | ||
| if echo "$output" | grep -q "OK"; then |
| // Fallback to a stable published image for dev or unversioned builds | ||
| if ver == "0.0.0-master" || strings.Contains(ver, "-dev") { | ||
| return "ghcr.io/kmesh-net/waypoint:v1.0.0-alpha" | ||
| } |
…flakes Signed-off-by: Kritagya <jhakritagya45@gmail.com>
Addresses issue #1213 by defaulting the kmeshctl waypoint apply image flag to the stable v1.0.0-alpha release, preventing runtime errors caused by non-existent fallback dev tags.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Previously, the
--imageflag inkmeshctl waypoint applydefaulted to an empty string"". This causedgetKmeshWaypointImage()to fallback to the Kmesh build version (which produces unreleased dev tags likewaypoint:v1.1-devduring active development). Since these images do not exist on GHCR, the command fails at runtime for end users.This PR sets the default flag string explicitly to the published stable image (
ghcr.io/kmesh-net/waypoint:v1.0.0-alpha), while still allowing users to override it via the--imageflag manually.Which issue(s) this PR fixes:
Fixes #1213
Special notes for your reviewer:
The change is localized strictly to the default flag assignment in
ctl/waypoint/waypoint.go. Tested locally to verify that running the waypoint command without specifying an image now correctly defaults to the v1.0.0-alpha image.Does this PR introduce a user-facing change?: