Skip to content

fix(ctl): set default waypoint image to v1.0.0-alpha#1767

Open
Kritagya123611 wants to merge 4 commits into
kmesh-net:mainfrom
Kritagya123611:fix/waypoint-image-1213
Open

fix(ctl): set default waypoint image to v1.0.0-alpha#1767
Kritagya123611 wants to merge 4 commits into
kmesh-net:mainfrom
Kritagya123611:fix/waypoint-image-1213

Conversation

@Kritagya123611

Copy link
Copy Markdown

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 --image flag in kmeshctl waypoint apply defaulted to an empty string "". This caused getKmeshWaypointImage() to fallback to the Kmesh build version (which produces unreleased dev tags like waypoint:v1.1-dev during 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 --image flag 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?:

NONE

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>
Copilot AI review requested due to automatic review settings June 23, 2026 05:28
@kmesh-bot kmesh-bot added the kind/bug Something isn't working label Jun 23, 2026
@kmesh-bot kmesh-bot requested review from bitcoffeeiux and nlgwcy June 23, 2026 05:28
@kmesh-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yaozengzeng for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@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 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

  • Default Image Update: Updated the --image flag default value in kmeshctl waypoint apply to use the stable v1.0.0-alpha image instead of an empty string.
  • Runtime Error Prevention: Prevents runtime failures caused by the system attempting to pull non-existent development tags during waypoint deployment.
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.


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

  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.

@kmesh-bot

Copy link
Copy Markdown
Collaborator

Welcome @Kritagya123611! It looks like this is your first PR to kmesh-net/kmesh 🎉

@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 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.

Comment thread ctl/waypoint/waypoint.go Outdated
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")

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

Hardcoding the default image to "ghcr.io/kmesh-net/waypoint:v1.0.0-alpha" in the flag definition introduces two major issues:

  1. Dead Code: It completely bypasses the fallback logic in getKmeshWaypointImage() (lines 627-637) because the image variable will never be empty.
  2. Maintenance & Release Issues: For future stable releases (e.g., v1.0.0 or v1.1.0), the default waypoint image will remain stuck at v1.0.0-alpha unless 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)
}
Suggested change
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")

Copilot AI left a comment

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.

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 --image persistent flag for kmeshctl waypoint to ghcr.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>
Copilot AI review requested due to automatic review settings June 23, 2026 06:12
@kmesh-bot kmesh-bot added size/M and removed size/XS labels Jun 23, 2026

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread test/e2e/run_test.sh
Comment on lines +202 to +206
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
Comment thread test/e2e/run_test.sh
Comment on lines +228 to +232
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
Comment thread test/e2e/run_test.sh
Comment on lines +262 to +266
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
Comment thread test/e2e/run_test.sh
Comment on lines +288 to +292
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
Comment thread ctl/waypoint/waypoint.go
Comment on lines +635 to +638
// 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kmeshctl waypoint apply uses wrong waypoint image

3 participants