Skip to content

Commit

Permalink
Merge branch 'release/v2.20.1' into release/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
thallgren committed Oct 9, 2024
2 parents de7100a + 9acd323 commit 115da37
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ jobs:
And for more information, visit our [installation docs](https://www.telepresence.io/docs/quick-start/).
![Assets](https://static.scarf.sh/a.png?x-pxid=d842651a-2e4d-465a-98e1-4808722c01ab)
- uses: actions/checkout@v4
if: needs.publish-release.semver_check.outputs.draft != true
- name: Update Homebrew
if: needs.publish-release.semver_check.outputs.draft != true
run: |
v=${{ github.ref_name }}
packaging/homebrew-package.sh "${v#v}" tel2oss "${{ vars.GH_BOT_USER }}" "${{ vars.GH_BOT_EMAIL }}" "${{ secrets.HOMEBREW_TAP_TOKEN }}"
test-release:
needs:
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ items:
client originate from the specified container. Additionally, if the
`--replace` option is used, it ensures that this container is replaced.
docs: https://telepresence.io/docs/reference/intercepts/container
- version: 2.20.1
date: TBD
notes:
- type: bugfix
title: Some workloads missing in the telepresence list output (typically replicasets owned by rollouts).
body: ->
Version 2.20.0 introduced a regression in the `telepresence list` command, resulting in the omission of
all workloads that were owned by another workload. The correct behavior is to just omit those workloads
that are owned by the supported workload kinds `Deployment`, `ReplicaSet`, `StatefulSet`, and `Rollout`.
Furthermore, the `Rollout` kind must only be considered supported when the Argo Rollouts feature is
enabled in the traffic-manager.
- type: bugfix
title: Allow comma separated list of daemons for the gather-logs command.
body: ->
Expand Down Expand Up @@ -135,7 +146,7 @@ items:
title: Add brew support for the OSS version of Telepresence.
body: >-
The Open-Source Software version of Telepresence can now be installed using the brew formula
via <code>brew install datawire/blackbird/telepresence-oss</code>.
via <code>brew install telepresenceio/telepresence/telepresence-oss</code>.
docs: https://github.com/telepresenceio/telepresence/issues/3609
- type: feature
title: Add --create-namespace flag to the telepresence helm install command.
Expand Down
9 changes: 8 additions & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
This commit introduces a `--container <name>` option to the intercept command. While this option doesn't influence the port selection, it guarantees that the environment variables and mounts propagated to the client originate from the specified container. Additionally, if the `--replace` option is used, it ensures that this container is replaced.
</div>

## Version 2.20.1
## <div style="display:flex;"><img src="images/bugfix.png" alt="bugfix" style="width:30px;height:fit-content;"/><div style="display:flex;margin-left:7px;">Some workloads missing in the telepresence list output (typically replicasets owned by rollouts).</div></div>
<div style="margin-left: 15px">

-> Version 2.20.0 introduced a regression in the `telepresence list` command, resulting in the omission of all workloads that were owned by another workload. The correct behavior is to just omit those workloads that are owned by the supported workload kinds `Deployment`, `ReplicaSet`, `StatefulSet`, and `Rollout`. Furthermore, the `Rollout` kind must only be considered supported when the Argo Rollouts feature is enabled in the traffic-manager.
</div>

## <div style="display:flex;"><img src="images/bugfix.png" alt="bugfix" style="width:30px;height:fit-content;"/><div style="display:flex;margin-left:7px;">Allow comma separated list of daemons for the gather-logs command.</div></div>
<div style="margin-left: 15px">

Expand Down Expand Up @@ -80,7 +87,7 @@ A <code>telepresence connect --docker</code> failed when attempting to connect t
## <div style="display:flex;"><img src="images/feature.png" alt="feature" style="width:30px;height:fit-content;"/><div style="display:flex;margin-left:7px;">[Add brew support for the OSS version of Telepresence.](https://github.com/telepresenceio/telepresence/issues/3609)</div></div>
<div style="margin-left: 15px">

The Open-Source Software version of Telepresence can now be installed using the brew formula via <code>brew install datawire/blackbird/telepresence-oss</code>.
The Open-Source Software version of Telepresence can now be installed using the brew formula via <code>brew install telepresenceio/telepresence/telepresence-oss</code>.
</div>

## <div style="display:flex;"><img src="images/feature.png" alt="feature" style="width:30px;height:fit-content;"/><div style="display:flex;margin-left:7px;">Add --create-namespace flag to the telepresence helm install command.</div></div>
Expand Down
7 changes: 6 additions & 1 deletion docs/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import { Note, Title, Body } from '@site/src/components/ReleaseNotes'
<Body>-> In certain scenarios, the container owning the intercepted port differs from the container the intercept targets. This port owner's sole purpose is to route traffic from the service to the intended container, often using a direct localhost connection.
This commit introduces a `--container <name>` option to the intercept command. While this option doesn't influence the port selection, it guarantees that the environment variables and mounts propagated to the client originate from the specified container. Additionally, if the `--replace` option is used, it ensures that this container is replaced.</Body>
</Note>
## Version 2.20.1
<Note>
<Title type="bugfix">Some workloads missing in the telepresence list output (typically replicasets owned by rollouts).</Title>
<Body>-> Version 2.20.0 introduced a regression in the `telepresence list` command, resulting in the omission of all workloads that were owned by another workload. The correct behavior is to just omit those workloads that are owned by the supported workload kinds `Deployment`, `ReplicaSet`, `StatefulSet`, and `Rollout`. Furthermore, the `Rollout` kind must only be considered supported when the Argo Rollouts feature is enabled in the traffic-manager.</Body>
</Note>
<Note>
<Title type="bugfix">Allow comma separated list of daemons for the gather-logs command.</Title>
<Body>-> The name of the `telepresence gather-logs` flag `--daemons` suggests that the argument can contain more than one daemon, but prior to this fix, it couldn't. It is now possible to use a comma separated list, e.g. `telepresence gather-logs --daemons root,user`.</Body>
Expand Down Expand Up @@ -61,7 +66,7 @@ This commit introduces a `--container <name>` option to the intercept command. W
## Version 2.19.1 <span style={{fontSize:'16px'}}>(July 12)</span>
<Note>
<Title type="feature" docs="https://github.com/telepresenceio/telepresence/issues/3609">Add brew support for the OSS version of Telepresence.</Title>
<Body>The Open-Source Software version of Telepresence can now be installed using the brew formula via <code>brew install datawire/blackbird/telepresence-oss</code>.</Body>
<Body>The Open-Source Software version of Telepresence can now be installed using the brew formula via <code>brew install telepresenceio/telepresence/telepresence-oss</code>.</Body>
</Note>
<Note>
<Title type="feature">Add --create-namespace flag to the telepresence helm install command.</Title>
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
github.com/telepresenceio/telepresence/rpc/v2 v2.20.0
github.com/telepresenceio/telepresence/rpc/v2 v2.20.1-rc.0
github.com/vishvananda/netlink v1.3.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0
Expand Down
25 changes: 23 additions & 2 deletions integration_test/argo_rollouts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func (s *argoRolloutsSuite) SetupSuite() {
rq.NoError(err)
dlog.Info(ctx, out)
rq.NoError(itest.Kubectl(ctx, "argo-rollouts", "apply", "-f", "https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml"))
s.TelepresenceHelmInstallOK(ctx, true, "--set", "workloads.argoRollouts.enabled=true")
s.TelepresenceConnect(ctx)
}

Expand Down Expand Up @@ -79,9 +78,12 @@ func (s *argoRolloutsSuite) Test_SuccessfullyInterceptsArgoRollout() {
ctx := s.Context()
require := s.Require()

s.TelepresenceHelmInstallOK(ctx, true, "--set", "workloads.argoRollouts.enabled=true")
defer s.RollbackTM(ctx)

tp, svc, port := "Rollout", "echo-argo-rollout", "9094"
s.ApplyApp(ctx, svc, strings.ToLower(tp)+"/"+svc)
defer s.DeleteSvcAndWorkload(ctx, "deploy", "echo-auto-inject")
defer s.DeleteSvcAndWorkload(ctx, "rollout", svc)

require.Eventually(
func() bool {
Expand Down Expand Up @@ -119,3 +121,22 @@ func (s *argoRolloutsSuite) Test_SuccessfullyInterceptsArgoRollout() {
6*time.Second, // polling interval
)
}

func (s *argoRolloutsSuite) Test_ListsReplicaSetWhenRolloutDisabled() {
ctx := s.Context()
require := s.Require()

tp, svc := "Rollout", "echo-argo-rollout"
s.ApplyApp(ctx, svc, strings.ToLower(tp)+"/"+svc)
defer s.DeleteSvcAndWorkload(ctx, "rollout", svc)

require.Eventually(
func() bool {
stdout, _, err := itest.Telepresence(ctx, "list")
dlog.Info(ctx, stdout)
return err == nil && strings.Contains(stdout, svc+"-")
},
6*time.Second, // waitFor
2*time.Second, // polling interval
)
}
32 changes: 25 additions & 7 deletions packaging/homebrew-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,29 @@ fi

VERSION="${1}"
PACKAGE_NAME="${2:?Can be 'tel2' or 'tel2oss'}"
GITHUB_USER="${3:-$(git config get user.name)}"
GITHUB_EMAIL="${4:-$(git config get user.email)}"
GITHUB_TOKEN="${5}"

ARCH=(amd64 arm64)
OS=(darwin linux)

MY_PATH=`dirname "$0"`
MY_PATH=`( cd "$MY_PATH" && pwd )`

WORK_DIR="$(mktemp -d)"
cd "${WORK_DIR}"
echo "Working in ${WORK_DIR}"

BUILD_HOMEBREW_DIR=${WORK_DIR}/homebrew
BUILD_HOMEBREW_DIR=homebrew
if [ "${PACKAGE_NAME}" == 'tel2' ]; then
FORMULA_NAME="Telepresence"
FORMULA_FILE="packaging/homebrew-formula.rb"
FORMULA="${BUILD_HOMEBREW_DIR}/Formula/telepresence.rb"
FORMULA_FILE="${MY_PATH}/homebrew-formula.rb"
FORMULA="Formula/telepresence.rb"
elif [ "${PACKAGE_NAME}" == 'tel2oss' ]; then
FORMULA_NAME="TelepresenceOss"
FORMULA_FILE="packaging/homebrew-oss-formula.rb"
FORMULA="${BUILD_HOMEBREW_DIR}/Formula/telepresence-oss.rb"
FORMULA_FILE="${MY_PATH}/homebrew-oss-formula.rb"
FORMULA="Formula/telepresence-oss.rb"
fi

for this_os in "${OS[@]}"; do
Expand Down Expand Up @@ -79,9 +86,17 @@ if [ "${HASH_ERRORS}" -gt 0 ]; then
exit 1
fi

export GIT_CONFIG_GLOBAL=/dev/null
export GIT_CONFIG_SYSTEM=/dev/null

# Clone telepresenceio-homebrew:
echo "Cloning into ${BUILD_HOMEBREW_DIR}..."
git clone https://github.com/telepresenceio/homebrew-telepresence.git "${BUILD_HOMEBREW_DIR}"
if [ "${GITHUB_TOKEN}" == "" ]; then
git clone "https://github.com/telepresenceio/homebrew-telepresence.git" "${BUILD_HOMEBREW_DIR}"
else
git clone "https://${GITHUB_TOKEN}@github.com/telepresenceio/homebrew-telepresence.git" "${BUILD_HOMEBREW_DIR}"
fi
cd "${BUILD_HOMEBREW_DIR}"

# Update recipe
mkdir -p "$(dirname "${FORMULA}")"
Expand All @@ -103,7 +118,10 @@ for this_os in "${OS[@]}"; do
done

chmod 644 "${FORMULA}"
cd "${BUILD_HOMEBREW_DIR}"

# Use the correct machine user for committing
git config --local user.email "${GITHUB_EMAIL}"
git config --local user.name "${GITHUB_USER}"

git add "${FORMULA}"
git commit -m "Release ${VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/cli/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (s *listCommand) printList(ctx context.Context, workloads []*connector.Work
if formattedOut {
output.Object(ctx, []struct{}{}, false)
} else {
fmt.Fprintln(stdout, "No Workloads (Deployments, StatefulSets, ReplicaSets or Rollouts)")
fmt.Fprintln(stdout, "No Workloads (Deployments, StatefulSets, ReplicaSets, or Rollouts)")
}
return
}
Expand Down
11 changes: 9 additions & 2 deletions pkg/client/userd/trafficmgr/workloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,17 @@ func (w *workloadsAndServicesWatcher) eachWorkload(c context.Context, tmns strin
return
}

// Only include top level workloads
// Exclude workloads that are owned by a supported workload.
for _, or := range wl.GetOwnerReferences() {
if or.Controller != nil && *or.Controller {
continue nextWorkload
switch or.Kind {
case "Deployment", "ReplicaSet", "StatefulSet":
continue nextWorkload
case "ArgoRollout":
if slices.Contains(w.wlKinds, manager.WorkloadInfo_ROLLOUT) {
continue nextWorkload
}
}
}
}
// If this is our traffic-manager namespace, then exclude the traffic-manager service.
Expand Down
2 changes: 1 addition & 1 deletion pkg/vif/testdata/router/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ require (
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/telepresenceio/telepresence/rpc/v2 v2.20.0 // indirect
github.com/telepresenceio/telepresence/rpc/v2 v2.20.1-rc.0 // indirect
github.com/vishvananda/netlink v1.3.0 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/x448/float16 v0.8.4 // indirect
Expand Down

0 comments on commit 115da37

Please sign in to comment.