Skip to content

docker-agent is primary binary in taskfile#1961

Merged
dgageot merged 1 commit intodocker:mainfrom
gtardif:fix_task
Mar 6, 2026
Merged

docker-agent is primary binary in taskfile#1961
dgageot merged 1 commit intodocker:mainfrom
gtardif:fix_task

Conversation

@gtardif
Copy link
Contributor

@gtardif gtardif commented Mar 6, 2026

No description provided.

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
@gtardif gtardif requested a review from a team as a code owner March 6, 2026 10:25
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Review Summary

Assessment: 🟡 NEEDS ATTENTION

This refactoring correctly renames the primary binary from cagent to docker-agent and introduces a copy mechanism for the deprecated cagent name. However, there is a backward compatibility issue that affects users who rely on the ~/bin/cagent symlink.

Issue Found

1 MEDIUM severity issue confirmed

  • The ~/bin symlink is only created for docker-agent, not for the deprecated cagent binary
  • Users who previously had ~/bin/cagent in their PATH will lose access to the command after rebuilding
  • While the deprecated binary exists in BUILD_DIR, it lacks the convenience symlink for backward compatibility

Recommendation

Consider adding a second symlink for the deprecated binary name to maintain full backward compatibility:

- '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.DEPRECATED_BINARY_NAME}} {{.HOME}}/bin/{{.DEPRECATED_BINARY_NAME}}{{end}}'

- '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.BINARY_NAME}} {{.HOME}}/bin/{{.BINARY_NAME}}{{end}}'
- go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}} {{.MAIN_PKG}}
- cp "{{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}}" {{.BUILD_DIR}}/{{.DEPRECATED_BINARY_NAME}}
- '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.CLI_PLUGIN_BINARY_NAME}} {{.HOME}}/bin/{{.CLI_PLUGIN_BINARY_NAME}}{{end}}'
Copy link

Choose a reason for hiding this comment

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

MEDIUM: Missing symlink for DEPRECATED_BINARY_NAME breaks backward compatibility

The build task creates a symlink in ~/bin only for docker-agent (CLI_PLUGIN_BINARY_NAME), but not for cagent (DEPRECATED_BINARY_NAME). Users who previously relied on having ~/bin/cagent in their PATH will lose that functionality after this change.

While the deprecated binary copy exists in BUILD_DIR, the missing symlink means users won't have the convenient cagent command available from their PATH.

Suggestion: Add a second symlink for backward compatibility:

- '{{if ne .CI "true"}}ln -sf {{.USER_WORKING_DIR}}/{{.BUILD_DIR}}/{{.DEPRECATED_BINARY_NAME}} {{.HOME}}/bin/{{.DEPRECATED_BINARY_NAME}}{{end}}'

Copy link
Contributor Author

@gtardif gtardif Mar 6, 2026

Choose a reason for hiding this comment

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

I removed that symlink on purpose, we want users to start using docker-agent instead of cagent (happy to change if anyone else disagree)

@dgageot dgageot merged commit 68ffb1d into docker:main Mar 6, 2026
11 checks passed
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