Skip to content

Commit 7711f8d

Browse files
authored
Merge pull request #3802 from telepresenceio/thallgren/rename-chart-folder
Rename charts/telepresence to charts/telepresence-oss.
2 parents 3c4e514 + e9bd0e4 commit 7711f8d

35 files changed

+37
-98
lines changed

.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
docker buildx build --platform=linux/amd64,linux/arm64 --build-arg TELEPRESENCE_VERSION=${{env.TELEPRESENCE_SEMVER}} \
7878
--push --tag ${{env.TELEPRESENCE_REGISTRY}}/tel2:${{env.TELEPRESENCE_SEMVER}} -f build-aux/docker/images/Dockerfile.traffic .
7979
- name: Push Helm Chart
80-
run: helm push build-output/telepresence-chart.tgz oci://${{env.TELEPRESENCE_REGISTRY}}
80+
run: helm push build-output/telepresence-oss-chart.tgz oci://${{env.TELEPRESENCE_REGISTRY}}
8181
- name: Log out from registry
8282
if: always()
8383
run: docker logout

CHANGELOG.yml

+6
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ items:
113113
body: >-
114114
The clusterID was deprecated some time ago, and replaced by the ID of the namespace where the traffic-manager
115115
is installed.
116+
- type: bugfix
117+
title: Rename charts/telepresence to charts/telepresence-oss.
118+
body: >-
119+
The Helm chart name "telepresence-oss" was inconsistent with its contained folder "telepresence". As a result,
120+
attempts to install the chart using an argo ApplicationSet failed. The contained folder was renamed to match
121+
the chart name.
116122
- type: bugfix
117123
title: Conflict detection between namespaced and cluster-wide install.
118124
body: >-

build-aux/main.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ push-client-image: client-image ## (Build) Push the client container image to $(
291291
push-images: push-tel2-image push-client-image
292292

293293
.PHONY: helm-chart
294-
helm-chart: $(BUILDDIR)/telepresence-chart.tgz
294+
helm-chart: $(BUILDDIR)/telepresence-oss-chart.tgz
295295

296-
$(BUILDDIR)/telepresence-chart.tgz: $(wildcard charts/telepresence/**/*)
296+
$(BUILDDIR)/telepresence-oss-chart.tgz: $(wildcard charts/telepresence-oss/**/*)
297297
mkdir -p $(BUILDDIR)
298298
go run packaging/helmpackage.go -o $@ -v $(TELEPRESENCE_SEMVER)
299299

charts/chart.go

+7-12
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,21 @@ import (
1818
type DirType int8
1919

2020
const (
21-
DirTypeTelepresence DirType = iota
22-
DirTypeTelepresenceCRDs DirType = iota
21+
DirTypeTelepresence DirType = iota
22+
TelepresenceChartName = "telepresence-oss"
2323
)
2424

25-
var (
26-
//go:embed all:telepresence
27-
TelepresenceFS embed.FS
28-
//go:embed all:telepresence-crds
29-
TelepresenceCRDsFS embed.FS
30-
)
25+
//go:embed all:telepresence-oss
26+
var TelepresenceFS embed.FS
3127

3228
// filePriority returns the sort-priority of a filename; higher priority files sorts earlier.
3329
func filePriority(chartName, filename string) int {
3430
prio := map[string]int{
3531
fmt.Sprintf("%s/Chart.yaml)", chartName): 4,
3632
fmt.Sprintf("%s/values.yaml)", chartName): 3,
3733
fmt.Sprintf("%s/values.schema.json", chartName): 2,
38-
// "telepresence/templates/**": 1,
39-
// "otherwise": 0,
34+
// "telepresence/templates-oss/**": 1,
35+
// "otherwise": 0,
4036
}[filename]
4137
if prio == 0 && strings.HasPrefix(filename, fmt.Sprintf("%s/templates/", chartName)) {
4238
prio = 1
@@ -80,8 +76,7 @@ var ChartOverlayFunc map[DirType]ChartOverlayFuncDef //nolint:gochecknoglobals /
8076
// WriteChart is a minimal `helm package`.
8177
func WriteChart(helmChartDir DirType, out io.Writer, chartName, version string, overlays ...fs.FS) error {
8278
embedChart := map[DirType]embed.FS{
83-
DirTypeTelepresence: TelepresenceFS,
84-
DirTypeTelepresenceCRDs: TelepresenceCRDsFS,
79+
DirTypeTelepresence: TelepresenceFS,
8580
}[helmChartDir]
8681

8782
var baseDir fs.FS = embedChart

charts/telepresence-crds/Chart.yaml

-7
This file was deleted.

charts/telepresence-crds/values.yaml

Whitespace-only changes.

charts/telepresence/Chart.yaml renamed to charts/telepresence-oss/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ apiVersion: v2
22
name: telepresence-oss
33
description: A chart for deploying the server-side components of Telepresence
44
type: application
5-
version: "1.1.1-bogus.overwritten.by.charts.go"
5+
version: "1.1.1-bogus.overwritten.by.chart.go"
66
icon: https://raw.githubusercontent.com/telepresenceio/telepresence.io/master/src/assets/images/telepresence-edgy.svg
77

88
# Note: This is the version of the Traffic Manager that will be installed by
99
# this chart. The telepresence CLI will always attempt to update the Traffic
1010
# Manager if it is not the same version as the CLI so ensure you are keeping
1111
# these in sync.
12-
appVersion: "1.1.1-bogus.overwritten.by.charts.go"
12+
appVersion: "1.1.1-bogus.overwritten.by.chart.go"
1313

1414
annotations:
1515
artifacthub.io/license: Apache-2.0
File renamed without changes.
File renamed without changes.

charts/telepresence/.helmignore

-23
This file was deleted.

docs/release-notes.md

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ The traffic-agent configuration was moved into a pod-annotation. This avoids syn
9696
The clusterID was deprecated some time ago, and replaced by the ID of the namespace where the traffic-manager is installed.
9797
</div>
9898

99+
## <div style="display:flex;"><img src="images/bugfix.png" alt="bugfix" style="width:30px;height:fit-content;"/><div style="display:flex;margin-left:7px;">Rename charts/telepresence to charts/telepresence-oss.</div></div>
100+
<div style="margin-left: 15px">
101+
102+
The Helm chart name "telepresence-oss" was inconsistent with its contained folder "telepresence". As a result, attempts to install the chart using an argo ApplicationSet failed. The contained folder was renamed to match the chart name.
103+
</div>
104+
99105
## <div style="display:flex;"><img src="images/bugfix.png" alt="bugfix" style="width:30px;height:fit-content;"/><div style="display:flex;margin-left:7px;">[Conflict detection between namespaced and cluster-wide install.](install/manager#namespace-collision-detection)</div></div>
100106
<div style="margin-left: 15px">
101107

docs/release-notes.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ namespaceSelector:
8484
<Title type="change">Drop deprecated current-cluster-id command.</Title>
8585
<Body>The clusterID was deprecated some time ago, and replaced by the ID of the namespace where the traffic-manager is installed.</Body>
8686
</Note>
87+
<Note>
88+
<Title type="bugfix">Rename charts/telepresence to charts/telepresence-oss.</Title>
89+
<Body>The Helm chart name "telepresence-oss" was inconsistent with its contained folder "telepresence". As a result, attempts to install the chart using an argo ApplicationSet failed. The contained folder was renamed to match the chart name.</Body>
90+
</Note>
8791
<Note>
8892
<Title type="bugfix" docs="install/manager#namespace-collision-detection">Conflict detection between namespaced and cluster-wide install.</Title>
8993
<Body>The namespace conflict detection mechanism would only discover conflicts between two _namespaced_ Traffic Managers trying to manage the same namespace. This is now fixed so that all types conflicts are discovered.</Body>

integration_test/itest/helm.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ import (
2626
)
2727

2828
func (s *cluster) PackageHelmChart(ctx context.Context) (string, error) {
29-
filename := filepath.Join(getT(ctx).TempDir(), "telepresence-chart.tgz")
29+
filename := filepath.Join(getT(ctx).TempDir(), telcharts.TelepresenceChartName+"-chart.tgz")
3030
fh, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY, 0o666)
3131
if err != nil {
3232
return "", err
3333
}
34-
if err := telcharts.WriteChart(telcharts.DirTypeTelepresence, fh, "telepresence", s.self.ManagerVersion().String()); err != nil {
34+
if err := telcharts.WriteChart(telcharts.DirTypeTelepresence, fh, telcharts.TelepresenceChartName, s.self.ManagerVersion().String()); err != nil {
3535
_ = fh.Close()
3636
return "", err
3737
}

packaging/helmpackage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ func packageHelmChart(filename string, version semver.Version) error {
4242
return err
4343
}
4444
defer fh.Close()
45-
return telcharts.WriteChart(telcharts.DirTypeTelepresence, fh, "telepresence", version.String())
45+
return telcharts.WriteChart(telcharts.DirTypeTelepresence, fh, telcharts.TelepresenceChartName, version.String())
4646
}

pkg/client/cli/cmd/helm.go

-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ type HelmCommand struct {
2727

2828
var (
2929
HelmInstallExtendFlagsFunc func(*pflag.FlagSet) //nolint:gochecknoglobals // extension point
30-
HelmExtendFlagsFunc func(*pflag.FlagSet) //nolint:gochecknoglobals // extension point
3130
HelmInstallPrologFunc func(context.Context, *pflag.FlagSet, *HelmCommand) error //nolint:gochecknoglobals // extension point
3231
)
3332

@@ -58,7 +57,6 @@ func helmInstall() *cobra.Command {
5857
flags.BoolVar(&ha.CreateNamespace, "create-namespace", true, "create a namespace for the traffic-manager if not present")
5958
flags.StringVar(&ha.Version, "version", "", "the telepresence version if different from the client's version. May be a range (e.g. ^2.21.0)")
6059
ha.addValueSettingFlags(flags)
61-
ha.addCRDsFlags(flags)
6260
uf := flags.Lookup("upgrade")
6361
uf.Hidden = true
6462
uf.Deprecated = `Use "telepresence helm upgrade" instead of "telepresence helm install --upgrade"`
@@ -81,7 +79,6 @@ func helmUpgrade() *cobra.Command {
8179

8280
flags := cmd.Flags()
8381
ha.addValueSettingFlags(flags)
84-
ha.addCRDsFlags(flags)
8582
flags.BoolVarP(&ha.NoHooks, "no-hooks", "", false, "disable pre/post upgrade hooks")
8683
flags.BoolVarP(&ha.ResetValues, "reset-values", "", false, "when upgrading, reset the values to the ones built into the chart")
8784
flags.BoolVarP(&ha.ReuseValues, "reuse-values", "", false,
@@ -108,12 +105,6 @@ func (ha *HelmCommand) addValueSettingFlags(flags *pflag.FlagSet) {
108105
}
109106
}
110107

111-
func (ha *HelmCommand) addCRDsFlags(flags *pflag.FlagSet) {
112-
if HelmExtendFlagsFunc != nil {
113-
HelmExtendFlagsFunc(flags)
114-
}
115-
}
116-
117108
func helmUninstall() *cobra.Command {
118109
ha := &HelmCommand{
119110
Request: helm.Request{
@@ -128,7 +119,6 @@ func helmUninstall() *cobra.Command {
128119
}
129120
flags := cmd.Flags()
130121
flags.BoolVarP(&ha.NoHooks, "no-hooks", "", false, "prevent hooks from running during uninstallation")
131-
ha.addCRDsFlags(flags)
132122
ha.rq = daemon.InitRequest(cmd)
133123
return cmd
134124
}

pkg/client/cli/helm/chart.go

+1-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
func loadCoreChart(version string) (*chart.Chart, error) {
2121
var buf bytes.Buffer
22-
if err := telcharts.WriteChart(telcharts.DirTypeTelepresence, &buf, "telepresence", version); err != nil {
22+
if err := telcharts.WriteChart(telcharts.DirTypeTelepresence, &buf, telcharts.TelepresenceChartName, version); err != nil {
2323
return nil, err
2424
}
2525
return loader.LoadArchive(&buf)
@@ -65,11 +65,3 @@ func pullCoreChart(ctx context.Context, helmConfig *action.Configuration, ref, v
6565
defer f.Close()
6666
return loader.LoadArchive(f)
6767
}
68-
69-
func loadCRDChart(version string) (*chart.Chart, error) {
70-
var buf bytes.Buffer
71-
if err := telcharts.WriteChart(telcharts.DirTypeTelepresenceCRDs, &buf, "telepresence-crds", version); err != nil {
72-
return nil, err
73-
}
74-
return loader.LoadArchive(&buf)
75-
}

pkg/client/cli/helm/install.go

+5-29
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
const (
3333
helmDriver = "secrets"
3434
trafficManagerReleaseName = agentmap.ManagerAppName
35-
crdReleaseName = "telepresence-crds"
3635
)
3736

3837
var GetValuesFunc = GetValues //nolint:gochecknoglobals // extension point
@@ -52,7 +51,6 @@ type Request struct {
5251
ReuseValues bool
5352
ResetValues bool
5453
CreateNamespace bool
55-
Crds bool
5654
NoHooks bool
5755
Version string
5856
}
@@ -115,10 +113,6 @@ func (hr *Request) Run(ctx context.Context, cr *connector.ConnectRequest) error
115113
}
116114

117115
updatedResource := "Traffic Manager"
118-
if hr.Crds {
119-
updatedResource = "Telepresence CRDs"
120-
}
121-
122116
ioutil.Printf(dos.Stdout(ctx), "\n%s %s successfully\n", updatedResource, msg)
123117
return nil
124118
}
@@ -323,18 +317,12 @@ func isInstalled(
323317
}
324318

325319
func EnsureTrafficManager(ctx context.Context, clientGetter genericclioptions.RESTClientGetter, namespace string, req *Request) (err error) {
326-
if req.Crds {
327-
dlog.Debug(ctx, "loading build-in helm chart")
328-
err = ensureIsInstalled(ctx, clientGetter, true, crdReleaseName, namespace, req)
329-
} else {
330-
err = ensureIsInstalled(ctx, clientGetter, false, trafficManagerReleaseName, namespace, req)
331-
}
332-
return err
320+
return ensureIsInstalled(ctx, clientGetter, trafficManagerReleaseName, namespace, req)
333321
}
334322

335323
// EnsureTrafficManager ensures the traffic manager is installed.
336324
func ensureIsInstalled(
337-
ctx context.Context, clientGetter genericclioptions.RESTClientGetter, crd bool,
325+
ctx context.Context, clientGetter genericclioptions.RESTClientGetter,
338326
releaseName, namespace string, req *Request,
339327
) error {
340328
cleanFailedState := func(helmConfig *action.Configuration) error {
@@ -399,13 +387,10 @@ func ensureIsInstalled(
399387
version := getTrafficManagerVersion(vals)
400388

401389
var chrt *chart.Chart
402-
switch {
403-
case crd:
404-
chrt, err = loadCRDChart(version)
405-
case req.Version != "":
390+
if req.Version != "" {
406391
version = req.Version
407392
chrt, err = pullCoreChart(ctx, helmConfig, "oci://ghcr.io/telepresenceio/telepresence-oss", version)
408-
default:
393+
} else {
409394
chrt, err = loadCoreChart(version)
410395
}
411396
if err != nil {
@@ -434,19 +419,10 @@ func ensureIsInstalled(
434419
func DeleteTrafficManager(
435420
ctx context.Context, clientGetter genericclioptions.RESTClientGetter, namespace string, errOnFail bool, req *Request,
436421
) error {
437-
if !req.Crds {
438-
err := ensureIsDeleted(ctx, clientGetter, trafficManagerReleaseName, namespace, errOnFail, req)
439-
if err != nil {
440-
return err
441-
}
442-
return nil
443-
}
444-
445-
err := ensureIsDeleted(ctx, clientGetter, crdReleaseName, namespace, errOnFail, req)
422+
err := ensureIsDeleted(ctx, clientGetter, trafficManagerReleaseName, namespace, errOnFail, req)
446423
if err != nil {
447424
return err
448425
}
449-
450426
return nil
451427
}
452428

0 commit comments

Comments
 (0)