Skip to content

Commit d8b8997

Browse files
author
github-actions
committed
Merge tag '1.24.1' into tetratefips-release-1.24
Istio release 1.24.1
2 parents 2471598 + 5c17835 commit d8b8997

File tree

29 files changed

+567
-71
lines changed

29 files changed

+567
-71
lines changed

Makefile.core.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ endif
4949
export VERSION
5050

5151
# Base version of Istio image to use
52-
BASE_VERSION ?= master-2024-09-19T19-01-03
52+
BASE_VERSION ?= 1.24-2024-11-19T19-01-56
5353
ISTIO_BASE_REGISTRY ?= gcr.io/istio-release
5454

5555
export GO111MODULE ?= on

cni/pkg/iptables/iptables.go

+5-8
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ func (cfg *IptablesConfigurator) executeDeleteCommands() error {
144144
deleteCmds := [][]string{
145145
{"-t", iptablesconstants.MANGLE, "-D", iptablesconstants.PREROUTING, "-j", ChainInpodPrerouting},
146146
{"-t", iptablesconstants.MANGLE, "-D", iptablesconstants.OUTPUT, "-j", ChainInpodOutput},
147-
{"-t", iptablesconstants.NAT, "-D", iptablesconstants.PREROUTING, "-j", ChainInpodPrerouting},
148147
{"-t", iptablesconstants.NAT, "-D", iptablesconstants.OUTPUT, "-j", ChainInpodOutput},
149-
{"-t", iptablesconstants.RAW, "-D", iptablesconstants.PREROUTING, "-j", ChainInpodPrerouting},
150-
{"-t", iptablesconstants.RAW, "-D", iptablesconstants.OUTPUT, "-j", ChainInpodOutput},
151148
}
152149

153-
// these sometimes fail due to "Device or resource busy"
150+
// these sometimes fail due to "Device or resource busy" or because they are optional given the iptables cfg
154151
optionalDeleteCmds := [][]string{
152+
{"-t", iptablesconstants.RAW, "-D", iptablesconstants.PREROUTING, "-j", ChainInpodPrerouting},
153+
{"-t", iptablesconstants.RAW, "-D", iptablesconstants.OUTPUT, "-j", ChainInpodOutput},
154+
{"-t", iptablesconstants.NAT, "-D", iptablesconstants.PREROUTING, "-j", ChainInpodPrerouting},
155155
// flush-then-delete our created chains
156156
{"-t", iptablesconstants.MANGLE, "-F", ChainInpodPrerouting},
157157
{"-t", iptablesconstants.MANGLE, "-F", ChainInpodOutput},
@@ -182,10 +182,7 @@ func (cfg *IptablesConfigurator) executeDeleteCommands() error {
182182
}
183183

184184
for _, cmd := range optionalDeleteCmds {
185-
err := cfg.ext.Run(iptablesconstants.IPTables, &iptVer, nil, cmd...)
186-
if err != nil {
187-
log.Debugf("ignoring error deleting optional iptables rule: %v", err)
188-
}
185+
cfg.ext.RunQuietlyAndIgnore(iptablesconstants.IPTables, &iptVer, nil, cmd...)
189186
}
190187
}
191188
return errors.Join(delErrs...)

istio.deps

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"name": "PROXY_REPO_SHA",
55
"repoName": "proxy",
66
"file": "",
7-
"lastStableSHA": "739644f84930a8c0d416319aea97f58c2222f7ef"
7+
"lastStableSHA": "147cca4e7da4e8b3f8006e9fe3d8b3d6abd89462"
88
},
99
{
1010
"_comment": "",
1111
"name": "ZTUNNEL_REPO_SHA",
1212
"repoName": "ztunnel",
1313
"file": "",
14-
"lastStableSHA": "1226c1b35f50938f428c71f7dcad3602ea991675"
14+
"lastStableSHA": "4c7cdf1b62ddcc786402499c03eff0d5172c95ef"
1515
}
1616
]

manifests/charts/istio-cni/templates/daemonset.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,21 @@ spec:
4141
prometheus.io/scrape: 'true'
4242
prometheus.io/port: "15014"
4343
prometheus.io/path: '/metrics'
44+
# Add AppArmor annotation
45+
# This is required to avoid conflicts with AppArmor profiles which block certain
46+
# privileged pod capabilities.
47+
# Required for Kubernetes 1.29 which does not support setting appArmorProfile in the
48+
# securityContext which is otherwise preferred.
49+
container.apparmor.security.beta.kubernetes.io/install-cni: unconfined
4450
# Custom annotations
4551
{{- if .Values.podAnnotations }}
4652
{{ toYaml .Values.podAnnotations | indent 8 }}
4753
{{- end }}
4854
spec:
49-
{{if .Values.ambient.enabled }}hostNetwork: true{{ end }}
55+
{{if .Values.ambient.enabled }}
56+
hostNetwork: true
57+
dnsPolicy: ClusterFirstWithHostNet
58+
{{ end }}
5059
nodeSelector:
5160
kubernetes.io/os: linux
5261
# Can be configured to allow for excluding istio-cni from being scheduled on specified nodes

operator/cmd/mesh/manifest-generate_test.go

+12
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,18 @@ func TestLDFlags(t *testing.T) {
817817
assert.Equal(t, vals.GetPathString("spec.tag"), version.DockerInfo.Tag)
818818
}
819819

820+
// TestManifestGenerateStructure makes some basic assertions about the structure of GeneratedManifests output.
821+
// This is to ensure that we only generate a single ManifestSet per component-type (in this case ingress gateways).
822+
// prevent an `istioctl install` regression of https://github.com/istio/istio/issues/53875
823+
func TestManifestGenerateStructure(t *testing.T) {
824+
multiGatewayFile := filepath.Join(testDataDir, "input/gateways.yaml")
825+
sets, _, err := render.GenerateManifest([]string{multiGatewayFile}, []string{}, false, nil, nil)
826+
assert.NoError(t, err)
827+
assert.Equal(t, len(sets), 1) // if this produces more than 1 ManifestSet it will cause a deadlock during install
828+
gateways := sets[0].Manifests
829+
assert.Equal(t, len(gateways), 21) // 7 kube resources * 3 gateways
830+
}
831+
820832
func runTestGroup(t *testing.T, tests testGroup) {
821833
for _, tt := range tests {
822834
tt := tt

operator/pkg/helm/helm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func Render(namespace string, directory string, iop values.Map, kubernetesVersio
4646
vals, _ := iop.GetPathMap("spec.values")
4747
installPackagePath := iop.GetPathString("spec.installPackagePath")
4848
f := manifests.BuiltinOrDir(installPackagePath)
49-
path := filepath.Join("charts", directory)
49+
path := pathJoin("charts", directory)
5050
chrt, err := loadChart(f, path)
5151
if err != nil {
5252
return nil, nil, fmt.Errorf("load chart: %v", err)

operator/pkg/helm/path.go

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//go:build !windows
2+
3+
// Copyright Istio Authors
4+
//
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
package helm
18+
19+
import (
20+
"path/filepath"
21+
)
22+
23+
func pathJoin(elem ...string) string {
24+
return filepath.Join(elem...)
25+
}

operator/pkg/helm/path_windows.go

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//go:build windows
2+
3+
// Copyright Istio Authors
4+
//
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
package helm
18+
19+
import "strings"
20+
21+
func pathJoin(elem ...string) string {
22+
elems := make([]string, len(elem))
23+
elems = append(elems, elem...)
24+
return strings.Join(elems, "/")
25+
}

operator/pkg/render/manifest.go

+19-6
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func GenerateManifest(files []string, setFlags []string, force bool, client kube
6565
}
6666

6767
// Render each component
68-
var allManifests []manifest.ManifestSet
68+
allManifests := map[component.Name]manifest.ManifestSet{}
6969
var chartWarnings util.Errors
7070
for _, comp := range component.AllComponents {
7171
specs, err := comp.Get(merged)
@@ -86,10 +86,16 @@ func GenerateManifest(files []string, setFlags []string, force bool, client kube
8686
if err != nil {
8787
return nil, nil, fmt.Errorf("post processing: %v", err)
8888
}
89-
allManifests = append(allManifests, manifest.ManifestSet{
90-
Component: comp.UserFacingName,
91-
Manifests: finalized,
92-
})
89+
manifests, found := allManifests[comp.UserFacingName]
90+
if found {
91+
manifests.Manifests = append(manifests.Manifests, finalized...)
92+
allManifests[comp.UserFacingName] = manifests
93+
} else {
94+
allManifests[comp.UserFacingName] = manifest.ManifestSet{
95+
Component: comp.UserFacingName,
96+
Manifests: finalized,
97+
}
98+
}
9399
}
94100
}
95101

@@ -99,7 +105,14 @@ func GenerateManifest(files []string, setFlags []string, force bool, client kube
99105
logger.LogAndErrorf("%s %v", "❗", w)
100106
}
101107
}
102-
return allManifests, merged, nil
108+
109+
values := make([]manifest.ManifestSet, 0, len(allManifests))
110+
111+
for _, v := range allManifests {
112+
values = append(values, v)
113+
}
114+
115+
return values, merged, nil
103116
}
104117

105118
type MigrationResult struct {

pilot/pkg/model/service.go

+19
Original file line numberDiff line numberDiff line change
@@ -887,15 +887,34 @@ type AmbientIndexes interface {
887887
type WaypointKey struct {
888888
Namespace string
889889
Hostnames []string
890+
891+
Network string
892+
Addresses []string
890893
}
891894

892895
// WaypointKeyForProxy builds a key from a proxy to lookup
893896
func WaypointKeyForProxy(node *Proxy) WaypointKey {
894897
key := WaypointKey{
895898
Namespace: node.ConfigNamespace,
899+
Network: node.Metadata.Network.String(),
896900
}
897901
for _, svct := range node.ServiceTargets {
898902
key.Hostnames = append(key.Hostnames, svct.Service.Hostname.String())
903+
904+
ips := svct.Service.ClusterVIPs.GetAddressesFor(node.GetClusterID())
905+
// if we find autoAllocated addresses then ips should contain constants.UnspecifiedIP which should not be used
906+
foundAutoAllocated := false
907+
if svct.Service.AutoAllocatedIPv4Address != "" {
908+
key.Addresses = append(key.Addresses, svct.Service.AutoAllocatedIPv4Address)
909+
foundAutoAllocated = true
910+
}
911+
if svct.Service.AutoAllocatedIPv6Address != "" {
912+
key.Addresses = append(key.Addresses, svct.Service.AutoAllocatedIPv6Address)
913+
foundAutoAllocated = true
914+
}
915+
if !foundAutoAllocated {
916+
key.Addresses = append(key.Addresses, ips...)
917+
}
899918
}
900919
return key
901920
}

pilot/pkg/networking/core/cluster_builder.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343
"istio.io/istio/pkg/config/host"
4444
"istio.io/istio/pkg/log"
4545
"istio.io/istio/pkg/security"
46-
"istio.io/istio/pkg/util/protomarshal"
4746
"istio.io/istio/pkg/util/sets"
4847
)
4948

@@ -323,7 +322,7 @@ func (cb *ClusterBuilder) buildCluster(name string, discoveryType cluster.Cluste
323322
c.DnsLookupFamily = cluster.Cluster_V4_ONLY
324323
}
325324
}
326-
c.DnsRefreshRate = protomarshal.ShallowClone(cb.req.Push.Mesh.DnsRefreshRate)
325+
c.DnsRefreshRate = cb.req.Push.Mesh.DnsRefreshRate
327326
c.RespectDnsTtl = true
328327
// we want to run all the STATIC parts as well to build the load assignment
329328
fallthrough
@@ -514,7 +513,7 @@ func (cb *ClusterBuilder) buildBlackHoleCluster() *cluster.Cluster {
514513
c := &cluster.Cluster{
515514
Name: util.BlackHoleCluster,
516515
ClusterDiscoveryType: &cluster.Cluster_Type{Type: cluster.Cluster_STATIC},
517-
ConnectTimeout: protomarshal.ShallowClone(cb.req.Push.Mesh.ConnectTimeout),
516+
ConnectTimeout: cb.req.Push.Mesh.ConnectTimeout,
518517
LbPolicy: cluster.Cluster_ROUND_ROBIN,
519518
}
520519
c.AltStatName = util.DelimitedStatsPrefix(util.BlackHoleCluster)
@@ -527,7 +526,7 @@ func (cb *ClusterBuilder) buildDefaultPassthroughCluster() *cluster.Cluster {
527526
cluster := &cluster.Cluster{
528527
Name: util.PassthroughCluster,
529528
ClusterDiscoveryType: &cluster.Cluster_Type{Type: cluster.Cluster_ORIGINAL_DST},
530-
ConnectTimeout: protomarshal.ShallowClone(cb.req.Push.Mesh.ConnectTimeout),
529+
ConnectTimeout: cb.req.Push.Mesh.ConnectTimeout,
531530
LbPolicy: cluster.Cluster_CLUSTER_PROVIDED,
532531
TypedExtensionProtocolOptions: map[string]*anypb.Any{
533532
v3.HttpProtocolOptionsType: passthroughHttpProtocolOptions,
@@ -734,7 +733,7 @@ func (cb *ClusterBuilder) buildExternalSDSCluster(addr string) *cluster.Cluster
734733
c := &cluster.Cluster{
735734
Name: security.SDSExternalClusterName,
736735
ClusterDiscoveryType: &cluster.Cluster_Type{Type: cluster.Cluster_STATIC},
737-
ConnectTimeout: protomarshal.ShallowClone(cb.req.Push.Mesh.ConnectTimeout),
736+
ConnectTimeout: cb.req.Push.Mesh.ConnectTimeout,
738737
LoadAssignment: &endpoint.ClusterLoadAssignment{
739738
ClusterName: security.SDSExternalClusterName,
740739
Endpoints: []*endpoint.LocalityLbEndpoints{

pilot/pkg/networking/core/listener_waypoint.go

+19-5
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ func (lb *ListenerBuilder) translateWaypointRoute(
628628
) *route.Route {
629629
gatewaySemantics := model.UseGatewaySemantics(virtualService)
630630
// When building routes, it's okay if the target cluster cannot be
631-
// resolved Traffic to such clusters will blackhole.
631+
// resolved. Traffic to such clusters will blackhole.
632632

633633
// Match by the destination port specified in the match condition
634634
if match != nil && match.Port != 0 && match.Port != uint32(listenPort) {
@@ -701,9 +701,15 @@ func (lb *ListenerBuilder) waypointRouteDestination(
701701
action.Timeout = in.Timeout
702702
}
703703
// Use deprecated value for now as the replacement MaxStreamDuration has some regressions.
704+
// TODO: check and see if the replacement has been fixed.
704705
// nolint: staticcheck
705706
action.MaxGrpcTimeout = action.Timeout
706707

708+
if gatewaySemantics {
709+
// return 500 for invalid backends
710+
// https://github.com/kubernetes-sigs/gateway-api/blob/cea484e38e078a2c1997d8c7a62f410a1540f519/apis/v1beta1/httproute_types.go#L204
711+
action.ClusterNotFoundResponseCode = route.RouteAction_INTERNAL_SERVER_ERROR
712+
}
707713
out.Action = &route.Route_Route{Route: action}
708714

709715
if in.Rewrite != nil {
@@ -814,9 +820,13 @@ func (lb *ListenerBuilder) waypointRouteDestination(
814820
}
815821
}
816822

817-
// getWaypointDestinationCluster generates a cluster name for the route, or error if no cluster
818-
// can be found. Called by translateRule to determine if
823+
// getWaypointDestinationCluster generates a cluster name for the route. If the destination is invalid
824+
// or cannot be found, "UnknownService" is returned.
819825
func (lb *ListenerBuilder) getWaypointDestinationCluster(destination *networking.Destination, service *model.Service, listenerPort int) string {
826+
if len(destination.GetHost()) == 0 {
827+
// only happens when the gateway-api BackendRef is invalid
828+
return "UnknownService"
829+
}
820830
dir, port := model.TrafficDirectionInboundVIP, listenerPort
821831

822832
if destination.GetPort() != nil {
@@ -851,10 +861,14 @@ func (lb *ListenerBuilder) getWaypointDestinationCluster(destination *networking
851861

852862
// portToSubset helps translate a port to the waypoint subset to use
853863
func portToSubset(service *model.Service, port int, destination *networking.Destination) string {
854-
p, ok := service.Ports.GetByPort(port)
864+
var p *model.Port
865+
var ok bool
866+
if service != nil {
867+
p, ok = service.Ports.GetByPort(port)
868+
}
855869
if !ok {
856870
// Port is unknown.
857-
if destination.Subset != "" {
871+
if destination != nil && destination.Subset != "" {
858872
return "http/" + destination.Subset
859873
}
860874
return "http"

pilot/pkg/networking/core/route/route.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ func buildSidecarVirtualHostForService(svc *model.Service,
329329
}
330330
}
331331

332-
// GetDestinationCluster generates a cluster name for the route, or error if no cluster
333-
// can be found. Called by translateRule to determine if
332+
// GetDestinationCluster generates a cluster name for the route. If the destination is invalid
333+
// or cannot be found, "UnknownService" is returned.
334334
func GetDestinationCluster(destination *networking.Destination, service *model.Service, listenerPort int) string {
335335
if len(destination.GetHost()) == 0 {
336336
// only happens when the gateway-api BackendRef is invalid
@@ -790,7 +790,12 @@ func ApplyRedirect(out *route.Route, redirect *networking.HTTPRedirect, port int
790790
action.Redirect.ResponseCode = route.RedirectAction_PERMANENT_REDIRECT
791791
default:
792792
log.Warnf("Redirect Code %d is not yet supported", redirect.RedirectCode)
793-
action = nil
793+
// Can't just set action to nil here because the proto marshaller will still see
794+
// the Route_Redirect type of the variable and assume that the value is set
795+
// (and panic because it's not). What we need to do is set out.Action directly to
796+
// (a typeless) nil so that type assertions to Route_Redirect will fail.
797+
out.Action = nil
798+
return
794799
}
795800

796801
out.Action = action

0 commit comments

Comments
 (0)