Skip to content

Commit b437870

Browse files
Merge pull request #489 from openshift-bot/synchronize-upstream
NO-ISSUE: Synchronize From Upstream Repositories
2 parents 77ab3fd + fa290aa commit b437870

File tree

12 files changed

+147
-23
lines changed

12 files changed

+147
-23
lines changed

commitchecker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
expectedMergeBase: 55d9dfbecea64f81bb088c4f1109a1d9df4cbbbb
1+
expectedMergeBase: c6dd08b391c92802ab40e38aba6672bae694a27d
22
upstreamBranch: main
33
upstreamOrg: operator-framework
44
upstreamRepo: operator-controller

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ require (
3030
golang.org/x/mod v0.28.0
3131
golang.org/x/sync v0.17.0
3232
golang.org/x/tools v0.37.0
33-
helm.sh/helm/v3 v3.18.6
33+
helm.sh/helm/v3 v3.19.0
3434
k8s.io/api v0.34.0
3535
k8s.io/apiextensions-apiserver v0.34.0
3636
k8s.io/apimachinery v0.34.0
@@ -243,7 +243,7 @@ require (
243243
gopkg.in/yaml.v2 v2.4.0 // indirect
244244
gopkg.in/yaml.v3 v3.0.1 // indirect
245245
k8s.io/controller-manager v0.33.2 // indirect
246-
k8s.io/kubectl v0.33.3 // indirect
246+
k8s.io/kubectl v0.34.0 // indirect
247247
oras.land/oras-go/v2 v2.6.0 // indirect
248248
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0 // indirect
249249
sigs.k8s.io/gateway-api v1.1.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
747747
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
748748
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
749749
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
750-
helm.sh/helm/v3 v3.18.6 h1:S/2CqcYnNfLckkHLI0VgQbxgcDaU3N4A/46E3n9wSNY=
751-
helm.sh/helm/v3 v3.18.6/go.mod h1:L/dXDR2r539oPlFP1PJqKAC1CUgqHJDLkxKpDGrWnyg=
750+
helm.sh/helm/v3 v3.19.0 h1:krVyCGa8fa/wzTZgqw0DUiXuRT5BPdeqE/sQXujQ22k=
751+
helm.sh/helm/v3 v3.19.0/go.mod h1:Lk/SfzN0w3a3C3o+TdAKrLwJ0wcZ//t1/SDXAvfgDdc=
752752
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
753753
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
754754
k8s.io/api v0.34.0 h1:L+JtP2wDbEYPUeNGbeSa/5GwFtIA662EmT2YSLOkAVE=

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Pygments==2.19.2
2424
pymdown-extensions==10.16.1
2525
pyquery==2.0.1
2626
python-dateutil==2.9.0.post0
27-
PyYAML==6.0.2
27+
PyYAML==6.0.3
2828
pyyaml_env_tag==1.1
2929
readtime==3.0.0
3030
regex==2025.9.18

vendor/helm.sh/helm/v3/internal/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var (
2929
//
3030
// Increment major number for new feature additions and behavioral changes.
3131
// Increment minor number for bug fixes and performance enhancements.
32-
version = "v3.18"
32+
version = "v3.19"
3333

3434
// metadata is extra build time data
3535
metadata = ""

vendor/helm.sh/helm/v3/pkg/action/hooks.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (cfg *Configuration) execHook(rl *release.Release, hook release.HookEvent,
4848
// hooke are pre-ordered by kind, so keep order stable
4949
sort.Stable(hookByWeight(executingHooks))
5050

51-
for _, h := range executingHooks {
51+
for i, h := range executingHooks {
5252
// Set default delete policy to before-hook-creation
5353
if len(h.DeletePolicies) == 0 {
5454
// TODO(jlegrone): Only apply before-hook-creation delete policy to run to completion
@@ -104,6 +104,13 @@ func (cfg *Configuration) execHook(rl *release.Release, hook release.HookEvent,
104104
// We log the error here as we want to propagate the hook failure upwards to the release object.
105105
log.Printf("error deleting the hook resource on hook failure: %v", errDeleting)
106106
}
107+
108+
// If a hook is failed, check the annotation of the previous successful hooks to determine whether the hooks
109+
// should be deleted under succeeded condition.
110+
if err := cfg.deleteHooksByPolicy(executingHooks[0:i], release.HookSucceeded, timeout); err != nil {
111+
return err
112+
}
113+
107114
return err
108115
}
109116
h.LastRun.Phase = release.HookPhaseSucceeded
@@ -164,6 +171,17 @@ func (cfg *Configuration) deleteHookByPolicy(h *release.Hook, policy release.Hoo
164171
return nil
165172
}
166173

174+
// deleteHooksByPolicy deletes all hooks if the hook policy instructs it to
175+
func (cfg *Configuration) deleteHooksByPolicy(hooks []*release.Hook, policy release.HookDeletePolicy, timeout time.Duration) error {
176+
for _, h := range hooks {
177+
if err := cfg.deleteHookByPolicy(h, policy, timeout); err != nil {
178+
return err
179+
}
180+
}
181+
182+
return nil
183+
}
184+
167185
// hookHasDeletePolicy determines whether the defined hook deletion policy matches the hook deletion polices
168186
// supported by helm. If so, mark the hook as one should be deleted.
169187
func hookHasDeletePolicy(h *release.Hook, policy release.HookDeletePolicy) bool {

vendor/helm.sh/helm/v3/pkg/action/install.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"context"
2222
"fmt"
2323
"io"
24+
"log/slog"
2425
"net/url"
2526
"os"
2627
"path"
@@ -750,6 +751,12 @@ func (c *ChartPathOptions) LocateChart(name string, settings *cli.EnvSettings) (
750751
version := strings.TrimSpace(c.Version)
751752

752753
if _, err := os.Stat(name); err == nil {
754+
// Issue #7862: Helm prioritizes local charts over repository URL.
755+
// This behavior is maintained for backwards compatibility but with a warning.
756+
if c.RepoURL != "" {
757+
slog.Warn("local chart found in current working directory. repository url ignored", "chart", name, "repository", c.RepoURL)
758+
}
759+
753760
abs, err := filepath.Abs(name)
754761
if err != nil {
755762
return abs, err

vendor/helm.sh/helm/v3/pkg/chartutil/capabilities.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import (
1919
"fmt"
2020
"strconv"
2121

22-
"github.com/Masterminds/semver/v3"
2322
"k8s.io/client-go/kubernetes/scheme"
2423

2524
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2625
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
26+
k8sversion "k8s.io/apimachinery/pkg/util/version"
2727

2828
helmversion "helm.sh/helm/v3/internal/version"
2929
)
@@ -84,14 +84,16 @@ func (kv *KubeVersion) GitVersion() string { return kv.Version }
8484

8585
// ParseKubeVersion parses kubernetes version from string
8686
func ParseKubeVersion(version string) (*KubeVersion, error) {
87-
sv, err := semver.NewVersion(version)
87+
// Based on the original k8s version parser.
88+
// https://github.com/kubernetes/kubernetes/blob/b266ac2c3e42c2c4843f81e20213d2b2f43e450a/staging/src/k8s.io/apimachinery/pkg/util/version/version.go#L137
89+
sv, err := k8sversion.ParseGeneric(version)
8890
if err != nil {
8991
return nil, err
9092
}
9193
return &KubeVersion{
9294
Version: "v" + sv.String(),
93-
Major: strconv.FormatUint(sv.Major(), 10),
94-
Minor: strconv.FormatUint(sv.Minor(), 10),
95+
Major: strconv.FormatUint(uint64(sv.Major()), 10),
96+
Minor: strconv.FormatUint(uint64(sv.Minor()), 10),
9597
}, nil
9698
}
9799

vendor/helm.sh/helm/v3/pkg/chartutil/create.go

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ const (
5454
IgnorefileName = ".helmignore"
5555
// IngressFileName is the name of the example ingress file.
5656
IngressFileName = TemplatesDir + sep + "ingress.yaml"
57+
// HTTPRouteFileName is the name of the example HTTPRoute file.
58+
HTTPRouteFileName = TemplatesDir + sep + "httproute.yaml"
5759
// DeploymentName is the name of the example deployment file.
5860
DeploymentName = TemplatesDir + sep + "deployment.yaml"
5961
// ServiceName is the name of the example service file.
@@ -177,6 +179,44 @@ ingress:
177179
# hosts:
178180
# - chart-example.local
179181
182+
# -- Expose the service via gateway-api HTTPRoute
183+
# Requires Gateway API resources and suitable controller installed within the cluster
184+
# (see: https://gateway-api.sigs.k8s.io/guides/)
185+
httpRoute:
186+
# HTTPRoute enabled.
187+
enabled: false
188+
# HTTPRoute annotations.
189+
annotations: {}
190+
# Which Gateways this Route is attached to.
191+
parentRefs:
192+
- name: gateway
193+
sectionName: http
194+
# namespace: default
195+
# Hostnames matching HTTP header.
196+
hostnames:
197+
- chart-example.local
198+
# List of rules and filters applied.
199+
rules:
200+
- matches:
201+
- path:
202+
type: PathPrefix
203+
value: /headers
204+
# filters:
205+
# - type: RequestHeaderModifier
206+
# requestHeaderModifier:
207+
# set:
208+
# - name: My-Overwrite-Header
209+
# value: this-is-the-only-value
210+
# remove:
211+
# - User-Agent
212+
# - matches:
213+
# - path:
214+
# type: PathPrefix
215+
# value: /echo
216+
# headers:
217+
# - name: version
218+
# value: v2
219+
180220
resources: {}
181221
# We usually recommend not to specify default resources and to leave this as a conscious
182222
# choice for the user. This also increases chances charts run on environments with little
@@ -297,6 +337,46 @@ spec:
297337
{{- end }}
298338
`
299339

340+
const defaultHTTPRoute = `{{- if .Values.httpRoute.enabled -}}
341+
{{- $fullName := include "<CHARTNAME>.fullname" . -}}
342+
{{- $svcPort := .Values.service.port -}}
343+
apiVersion: gateway.networking.k8s.io/v1
344+
kind: HTTPRoute
345+
metadata:
346+
name: {{ $fullName }}
347+
labels:
348+
{{- include "<CHARTNAME>.labels" . | nindent 4 }}
349+
{{- with .Values.httpRoute.annotations }}
350+
annotations:
351+
{{- toYaml . | nindent 4 }}
352+
{{- end }}
353+
spec:
354+
parentRefs:
355+
{{- with .Values.httpRoute.parentRefs }}
356+
{{- toYaml . | nindent 4 }}
357+
{{- end }}
358+
{{- with .Values.httpRoute.hostnames }}
359+
hostnames:
360+
{{- toYaml . | nindent 4 }}
361+
{{- end }}
362+
rules:
363+
{{- range .Values.httpRoute.rules }}
364+
{{- with .matches }}
365+
- matches:
366+
{{- toYaml . | nindent 8 }}
367+
{{- end }}
368+
{{- with .filters }}
369+
filters:
370+
{{- toYaml . | nindent 8 }}
371+
{{- end }}
372+
backendRefs:
373+
- name: {{ $fullName }}
374+
port: {{ $svcPort }}
375+
weight: 1
376+
{{- end }}
377+
{{- end }}
378+
`
379+
300380
const defaultDeployment = `apiVersion: apps/v1
301381
kind: Deployment
302382
metadata:
@@ -444,7 +524,20 @@ spec:
444524
`
445525

446526
const defaultNotes = `1. Get the application URL by running these commands:
447-
{{- if .Values.ingress.enabled }}
527+
{{- if .Values.httpRoute.enabled }}
528+
{{- if .Values.httpRoute.hostnames }}
529+
export APP_HOSTNAME={{ .Values.httpRoute.hostnames | first }}
530+
{{- else }}
531+
export APP_HOSTNAME=$(kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o jsonpath="{.spec.listeners[0].hostname}")
532+
{{- end }}
533+
{{- if and .Values.httpRoute.rules (first .Values.httpRoute.rules).matches (first (first .Values.httpRoute.rules).matches).path.value }}
534+
echo "Visit http://$APP_HOSTNAME{{ (first (first .Values.httpRoute.rules).matches).path.value }} to use your application"
535+
536+
NOTE: Your HTTPRoute depends on the listener configuration of your gateway and your HTTPRoute rules.
537+
The rules can be set for path, method, header and query parameters.
538+
You can check the gateway configuration with 'kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o yaml'
539+
{{- end }}
540+
{{- else if .Values.ingress.enabled }}
448541
{{- range $host := .Values.ingress.hosts }}
449542
{{- range .paths }}
450543
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
@@ -658,6 +751,11 @@ func Create(name, dir string) (string, error) {
658751
path: filepath.Join(cdir, IngressFileName),
659752
content: transform(defaultIngress, name),
660753
},
754+
{
755+
// httproute.yaml
756+
path: filepath.Join(cdir, HTTPRouteFileName),
757+
content: transform(defaultHTTPRoute, name),
758+
},
661759
{
662760
// deployment.yaml
663761
path: filepath.Join(cdir, DeploymentName),

vendor/helm.sh/helm/v3/pkg/getter/httpgetter.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"github.com/pkg/errors"
2727

2828
"helm.sh/helm/v3/internal/tlsutil"
29-
"helm.sh/helm/v3/internal/urlutil"
3029
"helm.sh/helm/v3/internal/version"
3130
)
3231

@@ -133,12 +132,6 @@ func (g *HTTPGetter) httpClient() (*http.Client, error) {
133132
return nil, errors.Wrap(err, "can't create TLS config for client")
134133
}
135134

136-
sni, err := urlutil.ExtractHostname(g.opts.url)
137-
if err != nil {
138-
return nil, err
139-
}
140-
tlsConf.ServerName = sni
141-
142135
g.transport.TLSClientConfig = tlsConf
143136
}
144137

0 commit comments

Comments
 (0)