Skip to content

Commit b68f62f

Browse files
authored
Merge pull request #3764 from telepresenceio/thallgren/replace-command
New telepresence replace command.
2 parents df1acfc + 1bea6dc commit b68f62f

File tree

208 files changed

+6532
-6322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+6532
-6322
lines changed

.github/workflows/release.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
echo "prerelease=false" >> $GITHUB_OUTPUT
113113
fi
114114
- name: Create draft release
115-
if: steps.semver_check.outputs.draft == true
115+
if: ${{ steps.semver_check.outputs.draft == 'true' }}
116116
uses: ncipollo/release-action@v1
117117
with:
118118
artifacts: "binaries-*/*"
@@ -123,7 +123,7 @@ jobs:
123123
## Draft Release
124124
For more information, visit our [installation docs](https://www.telepresence.io/docs/latest/quick-start/).
125125
- name: Create release
126-
if: steps.semver_check.outputs.draft != true
126+
if: ${{ steps.semver_check.outputs.draft == 'false' }}
127127
uses: ncipollo/release-action@v1
128128
with:
129129
artifacts: "binaries-*/*"
@@ -148,9 +148,9 @@ jobs:
148148
149149
![Assets](https://static.scarf.sh/a.png?x-pxid=d842651a-2e4d-465a-98e1-4808722c01ab)
150150
- uses: actions/checkout@v4
151-
if: steps.semver_check.outputs.make_latest == true
151+
if: ${{ steps.semver_check.outputs.make_latest == 'true' }}
152152
- name: Update Homebrew
153-
if: steps.semver_check.outputs.make_latest == true
153+
if: ${{ steps.semver_check.outputs.make_latest == 'true' }}
154154
run: |
155155
v=${{ github.ref_name }}
156156
packaging/homebrew-package.sh "${v#v}" tel2oss "${{ vars.GH_BOT_USER }}" "${{ vars.GH_BOT_EMAIL }}" "${{ secrets.HOMEBREW_TAP_TOKEN }}"
@@ -159,7 +159,7 @@ jobs:
159159
needs:
160160
- push-images
161161
- publish-release
162-
if: needs.publish-release.semver_check.outputs.draft != true
162+
if: ${{ needs.publish-release.semver_check.outputs.draft == 'false' }}
163163
strategy:
164164
fail-fast: false
165165
matrix:

CHANGELOG.yml

+86-12
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,42 @@ items:
2727
- version: 2.22.0
2828
date: (TBD)
2929
notes:
30+
- type: feature
31+
title: New telepresence replace command.
32+
body: |-
33+
The new `telepresence replace` command simplifies and clarifies container replacement.
34+
35+
Previously, the `--replace` flag within the `telepresence intercept` command was used to replace containers.
36+
However, this approach introduced inconsistencies and limitations:
37+
38+
* **Confusion:** Using a flag to modify the core function of a command designed for traffic interception led
39+
to ambiguity.
40+
* **Inaccurate Behavior:** Replacement was not possible when no incoming traffic was intercepted, as the
41+
command's design focused on traffic routing.
42+
43+
To address these issues, the `--replace` flag within `telepresence intercept` has been deprecated. The new
44+
`telepresence replace` command provides a dedicated and consistent method for replacing containers, enhancing
45+
clarity and reliability.
46+
47+
Key differences between `replace` and `intercept`:
48+
49+
1. **Scope:** The `replace` command targets and affects an entire container, impacting all its traffic, while
50+
an `intercept` targets specific services and/or service/container ports.
51+
2. **Port Declarations:** Remote ports specified using the `--port` flag are container ports.
52+
3. **No Default Port:** A `replace` can occur without intercepting any ports.
53+
4. **Container State:** During a `replace`, the original container is no longer active within the cluster.
54+
55+
The deprecated `--replace` flag still works, but is hidden from the `telepresence intercept` command help, and
56+
will print a deprecation warning when used.
57+
- type: feature
58+
title: No dormant container present during replace.
59+
body: |-
60+
Telepresence will no longer inject a dormant container during a `telepresence replace` operation. Instead, the
61+
Traffic Agent now directly serves as the replacement container, eliminating the need to forward traffic to the
62+
original application container. This simplification offers several advantages when using the `--replace` flag:
63+
64+
- **Removal of the init-container:** The need for a separate init-container is no longer necessary.
65+
- **Elimination of port renames:** Port renames within the intercepted pod are no longer required.
3066
- type: feature
3167
title: One single invocation of the Telepresence intercept command can now intercept multiple ports.
3268
body: >-
@@ -50,15 +86,22 @@ items:
5086
```
5187
docs: install/manager#static-versus-dynamic-namespace-selection
5288
- type: feature
53-
title: Removal of the dormant container during intercept with --replace.
54-
body: |-
55-
During a `telepresence intercept --replace operation`, the previously injected dormant container has been
56-
removed. The Traffic Agent now directly serves as the replacement container, eliminating the need to forward
57-
traffic to the original application container. This simplification offers several advantages when using the
58-
`--replace` flag:
59-
60-
- **Removal of the init-container:** The need for a separate init-container is no longer necessary.
61-
- **Elimination of port renames:** Port renames within the intercepted pod are no longer required.
89+
title: List output includes workload kind.
90+
body: >-
91+
The output of the `telepresence list` command will now include the workload kind (deployment, replicaset,
92+
statefulset, or rollout) in all entries.
93+
- type: change
94+
title: Trigger the mutating webhook with Kubernetes eviction objects instead of patching workloads.
95+
body: >-
96+
Instead of patching workloads, or scaling the workloads down to zero and up again, Telepresence will now
97+
create policy/v1 Eviction objects to trigger the mutating webhook. This causes a slight change in the
98+
traffic-manager RBAC. The `patch` permissions are no longer needed. Instead, the traffic-manager must be
99+
able to create "pod/eviction" objects.
100+
- type: change
101+
title: The telepresence-agents configmap is no longer used.
102+
body: >-
103+
The traffic-agent configuration was moved into a pod-annotation. This avoids sync problems between the
104+
telepresence-agents (which is no no longer present) and the pods.
62105
- type: change
63106
title: Drop deprecated current-cluster-id command.
64107
body: >-
@@ -75,6 +118,37 @@ items:
75118
body: >-
76119
macOS based systems will often PTR queries using nameslike `b._dns-sd._udp`, lb._dns-sd._udp, or
77120
`db-dns-sd._udp`. Those queries are no longer dispatched to the cluster.
121+
- type: bugfix
122+
title: Using the --namespace option with telepresence causes a deadlock.
123+
body: >-
124+
Using `telepresence list --namespace <ns> with a namespace different from the one that telepresence was
125+
connected to, would cause a deadlock, and then produce an empty list.
126+
- type: bugfix
127+
title: Fix problem with exclude-suffix being hidden by DNS search path.
128+
body: >-
129+
In some situations, a name ending with an exclude-suffix like "xyz.com" would be expanded by a search path
130+
into "xyz.com.<connected namespace>" and therefore not be excluded. Instead, the name was sent to the cluster
131+
to be resolved, causing an unnecessary load on its DNS server.
132+
- version: 2.21.3
133+
date: 2025-02-06
134+
notes:
135+
- type: bugfix
136+
title: Using the --proxy-via flag would sometimes cause connection timeouts.
137+
body: >-
138+
Typically, a `telepresence connect --proxy-via <subnet>=<workflow>` would fail with a "deadline exceeded"
139+
message when several workloads were present in the namespace, the one targeted by the proxy-via didn't yet
140+
have an agent installed, and other workloads had an agent. This was due to a race condition in the logic
141+
for the agent-based port-forwards in the root daemon. The conditions causing this race are now eliminated.
142+
- type: bugfix
143+
title: Fix panic in root daemon when using the "allow conflicting subnets" feature on macOS.
144+
body: >-
145+
A regression was introduced in version 2.21.0, causing a panic due to an unimplemented method in the
146+
TUN-device on macOS based clients.
147+
- type: bugfix
148+
title: Ensure that annotation enabled traffic-agents are uninstall when uninstalling the traffic-manager.
149+
body: >-
150+
A traffic-agent injected because the workload had the inject annotation enabled would sometimes not get
151+
uninstalled when the traffic-manager was uninstalled.
78152
- version: 2.21.2
79153
date: 2025-01-26
80154
notes:
@@ -135,7 +209,7 @@ items:
135209
guarantees that the environment variables and mounts propagated to the
136210
client originate from the specified container. Additionally, if the
137211
`--replace` option is used, it ensures that this container is replaced.
138-
docs: reference/intercepts/container
212+
docs: reference/engagements/container
139213
- type: feature
140214
title: New telepresence ingest command
141215
body: >-
@@ -200,7 +274,7 @@ items:
200274
The Helm chart value `workloads` now supports the kinds `deployments.enabled`, `statefulSets.enabled`, `replicaSets.enabled`.
201275
and `rollouts.enabled`. All except `rollouts` are enabled by default. The traffic-manager will ignore workloads, and
202276
Telepresence will not be able to intercept them, if the `enabled` of the corresponding kind is set to `false`.
203-
docs: reference/intercepts/sidecar#disable-workloads
277+
docs: reference/engagements/sidecar#disable-workloads
204278
- type: feature
205279
title: Improved command auto-completion
206280
body: >-
@@ -374,7 +448,7 @@ items:
374448
instead of a service port. The new behavior is enabled by adding a <code>telepresence.getambassador.io/inject-container-ports</code>
375449
annotation where the value is a comma separated list of port identifiers consisting of either the name or the port number of a container
376450
port, optionally suffixed with `/TCP` or `/UDP`.
377-
docs: https://telepresence.io/docs/reference/intercepts/cli#intercepting-without-a-service
451+
docs: https://telepresence.io/docs/reference/engagements/cli#intercepting-without-a-service
378452
- type: feature
379453
title: Publish the OSS version of the telepresence Helm chart
380454
body: >-

DEPENDENCIES.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ following Free and Open Source software:
2525
github.com/containerd/log v0.1.0 Apache License 2.0
2626
github.com/containerd/platforms v0.2.1 Apache License 2.0
2727
github.com/coreos/go-iptables v0.8.0 Apache License 2.0
28-
github.com/cyphar/filepath-securejoin v0.4.0 3-clause BSD license
28+
github.com/cyphar/filepath-securejoin v0.4.1 3-clause BSD license
2929
github.com/datawire/argo-rollouts-go-client v0.0.0-20241216133646-cb1073556c99 Apache License 2.0
3030
github.com/datawire/dlib v1.3.1 Apache License 2.0
3131
github.com/datawire/dtest v0.0.0-20210928162311-722b199c4c2f Apache License 2.0
@@ -41,7 +41,7 @@ following Free and Open Source software:
4141
github.com/docker/go-metrics v0.0.1 Apache License 2.0
4242
github.com/docker/go-units v0.5.0 Apache License 2.0
4343
github.com/emicklei/go-restful/v3 v3.12.1 MIT license
44-
github.com/evanphx/json-patch v5.9.0+incompatible 3-clause BSD license
44+
github.com/evanphx/json-patch v5.9.11+incompatible 3-clause BSD license
4545
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f MIT license
4646
github.com/fatih/camelcase v1.0.0 MIT license
4747
github.com/fatih/color v1.18.0 MIT license
@@ -52,7 +52,7 @@ following Free and Open Source software:
5252
github.com/fxamacker/cbor/v2 v2.7.0 MIT license
5353
github.com/go-errors/errors v1.5.1 MIT license
5454
github.com/go-gorp/gorp/v3 v3.1.0 MIT license
55-
github.com/go-json-experiment/json v0.0.0-20250124004741-3d76ae074650 3-clause BSD license
55+
github.com/go-json-experiment/json v0.0.0-20250129011340-4e0381018ad6 3-clause BSD license
5656
github.com/go-logr/logr v1.4.2 Apache License 2.0
5757
github.com/go-logr/stdr v1.2.2 Apache License 2.0
5858
github.com/go-openapi/jsonpointer v0.21.0 Apache License 2.0
@@ -73,11 +73,13 @@ following Free and Open Source software:
7373
github.com/gorilla/websocket v1.5.3 2-clause BSD license
7474
github.com/gosuri/uitable v0.0.4 MIT license
7575
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 MIT license
76+
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0 Apache License 2.0
7677
github.com/hashicorp/errwrap v1.1.0 Mozilla Public License 2.0
7778
github.com/hashicorp/go-multierror v1.1.1 Mozilla Public License 2.0
7879
github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb MIT license
7980
github.com/huandu/xstrings v1.5.0 MIT license
8081
github.com/inconshreveable/mousetrap v1.1.0 Apache License 2.0
82+
github.com/jlaffaye/ftp v0.2.0 ISC license
8183
github.com/jmoiron/sqlx v1.4.0 MIT license
8284
github.com/josharian/intern v1.0.1-0.20211109044230-42b52b674af5 MIT license
8385
github.com/json-iterator/go v1.1.12 MIT license
@@ -125,12 +127,14 @@ following Free and Open Source software:
125127
github.com/spf13/afero v1.12.0 Apache License 2.0
126128
github.com/spf13/cast v1.7.1 MIT license
127129
github.com/spf13/cobra v1.8.1 Apache License 2.0
128-
github.com/spf13/pflag v1.0.5 3-clause BSD license
130+
github.com/spf13/pflag v1.0.6 3-clause BSD license
129131
github.com/stretchr/testify v1.10.0 MIT license
130-
github.com/telepresenceio/go-fuseftp/rpc v0.5.0 Apache License 2.0
132+
github.com/telepresenceio/go-fuseftp v0.6.1 Apache License 2.0
133+
github.com/telepresenceio/go-fuseftp/rpc v0.6.1 Apache License 2.0
131134
github.com/telepresenceio/telepresence/rpc/v2 (modified) Apache License 2.0
132135
github.com/vishvananda/netlink v1.3.0 Apache License 2.0
133136
github.com/vishvananda/netns v0.0.5 Apache License 2.0
137+
github.com/winfsp/cgofuse v1.6.0 MIT license
134138
github.com/x448/float16 v0.8.4 MIT license
135139
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb Apache License 2.0
136140
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 Apache License 2.0
@@ -154,13 +158,13 @@ following Free and Open Source software:
154158
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 MIT license
155159
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 MIT license
156160
golang.zx2c4.com/wireguard/windows v0.5.3 MIT license
157-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250124145028-65684f501c47 Apache License 2.0
161+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 Apache License 2.0
158162
google.golang.org/grpc v1.70.0 Apache License 2.0
159163
google.golang.org/protobuf v1.36.4 3-clause BSD license
160164
gopkg.in/evanphx/json-patch.v4 v4.12.0 3-clause BSD license
161165
gopkg.in/inf.v0 v0.9.1 3-clause BSD license
162166
gopkg.in/yaml.v3 v3.0.1 Apache License 2.0, MIT license
163-
gvisor.dev/gvisor v0.0.0-20250115195935-26653e7d8816 Apache License 2.0, MIT license
167+
gvisor.dev/gvisor v0.0.0-20250131185017-b744a1bd640b Apache License 2.0, MIT license
164168
helm.sh/helm/v3 v3.17.0 Apache License 2.0
165169
k8s.io/api v0.32.1 Apache License 2.0
166170
k8s.io/apiextensions-apiserver v0.32.1 Apache License 2.0

0 commit comments

Comments
 (0)