Skip to content

Commit 0e8c623

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 8b1a919 + 6c97d09 commit 0e8c623

File tree

229 files changed

+4379
-3260
lines changed

Some content is hidden

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

229 files changed

+4379
-3260
lines changed

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "istio build-tools",
3-
"image": "gcr.io/istio-testing/build-tools:master-f765f42b0bbcfbfffc112630404904784118a25b",
3+
"image": "gcr.io/istio-testing/build-tools:master-dbd3c673faecfbd1910fdb09012099fa184dde92",
44
"privileged": true,
55
"remoteEnv": {
66
"USE_GKE_GCLOUD_AUTH_PLUGIN": "True",

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,5 @@ var/
6363
.DS_Store
6464
/manifests/charts/**/charts/
6565
/manifests/charts/**/Chart.lock
66-
/cni/pkg/plugin/istio-cni.log
66+
coverage.out
67+
/cni/pkg/plugin/istio-cni.log

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-2025-02-25T19-01-37
52+
BASE_VERSION ?= master-2025-03-04T19-02-02
5353
ISTIO_BASE_REGISTRY ?= gcr.io/istio-release
5454

5555
export GO111MODULE ?= on

Makefile.overrides.mk

+4
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ endif
3636
.PHONY: istioctl-install
3737
istioctl-install: istioctl-install-container
3838
cp out/$(TARGET_OS)_$(TARGET_ARCH)/istioctl ${GOPATH}/bin
39+
40+
.PHONY: coverage
41+
coverage:
42+
prow/coverage.sh

cni/pkg/install/install.go

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ func (in *Installer) installAll(ctx context.Context) (sets.String, error) {
5959
// and we harm no one by doing so.
6060
copiedFiles, err := copyBinaries(in.cfg.CNIBinSourceDir, in.cfg.CNIBinTargetDirs)
6161
if err != nil {
62+
if strings.Contains(err.Error(), "read-only file system") {
63+
log.Warnf("hint: some Kubernetes environments require customization of the CNI directory." +
64+
" Ensure you properly set global.platform=<name> during installation")
65+
}
6266
cniInstalls.With(resultLabel.Value(resultCopyBinariesFailure)).Increment()
6367
return copiedFiles, fmt.Errorf("copy binaries: %v", err)
6468
}

cni/pkg/nodeagent/meshdataplane_linux.go

+60-44
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ func (s *meshDataplane) Stop(skipCleanup bool) {
6363

6464
log.Debug("removing host iptables rules")
6565
s.hostIptables.DeleteHostRules()
66-
67-
log.Debug("destroying host ipset")
68-
s.hostsideProbeIPSet.Flush()
69-
if err := s.hostsideProbeIPSet.DestroySet(); err != nil {
70-
log.Warnf("could not destroy host ipset on shutdown")
71-
}
66+
_ = util.RunAsHost(func() error {
67+
log.Debug("destroying host ipset")
68+
s.hostsideProbeIPSet.Flush()
69+
if err := s.hostsideProbeIPSet.DestroySet(); err != nil {
70+
log.Warnf("could not destroy host ipset on shutdown")
71+
}
72+
return nil
73+
})
7274
}
7375

7476
s.netServer.Stop(skipCleanup)
@@ -247,16 +249,22 @@ func (s *meshDataplane) addPodToHostNSIpset(pod *corev1.Pod, podIPs []netip.Addr
247249
var ipsetAddrErrs []error
248250
var addedIps []netip.Addr
249251

250-
// For each pod IP
251-
for _, pip := range podIPs {
252-
// Add to host ipset
253-
log.Debugf("adding probe ip %s to set", pip)
254-
if err := s.hostsideProbeIPSet.AddIP(pip, ipProto, podUID, true); err != nil {
255-
ipsetAddrErrs = append(ipsetAddrErrs, err)
256-
log.Errorf("failed adding ip %s to set, error was %s", pip, err)
257-
} else {
258-
addedIps = append(addedIps, pip)
252+
err := util.RunAsHost(func() error {
253+
// For each pod IP
254+
for _, pip := range podIPs {
255+
// Add to host ipset
256+
log.Debugf("adding probe ip %s to set", pip)
257+
if err := s.hostsideProbeIPSet.AddIP(pip, ipProto, podUID, true); err != nil {
258+
ipsetAddrErrs = append(ipsetAddrErrs, err)
259+
log.Errorf("failed adding ip %s to set, error was %s", pip, err)
260+
} else {
261+
addedIps = append(addedIps, pip)
262+
}
259263
}
264+
return nil
265+
})
266+
if err != nil {
267+
ipsetAddrErrs = append(ipsetAddrErrs, err)
260268
}
261269

262270
return addedIps, errors.Join(ipsetAddrErrs...)
@@ -267,13 +275,18 @@ func (s *meshDataplane) addPodToHostNSIpset(pod *corev1.Pod, podIPs []netip.Addr
267275
//
268276
// We will unconditionally flush our set before use here, so it shouldn't matter.
269277
func createHostsideProbeIpset(isV6 bool) (ipset.IPSet, error) {
270-
linDeps := ipset.RealNlDeps()
271-
probeSet, err := ipset.NewIPSet(iptables.ProbeIPSet, isV6, linDeps)
272-
if err != nil {
273-
return probeSet, err
274-
}
275-
probeSet.Flush()
276-
return probeSet, nil
278+
var probeSet ipset.IPSet
279+
runErr := util.RunAsHost(func() error {
280+
var err error
281+
linDeps := ipset.RealNlDeps()
282+
probeSet, err = ipset.NewIPSet(iptables.ProbeIPSet, isV6, linDeps)
283+
if err != nil {
284+
return err
285+
}
286+
probeSet.Flush()
287+
return nil
288+
})
289+
return probeSet, runErr
277290
}
278291

279292
// removePodFromHostNSIpset will remove (v4, v6) pod IPs from the host IP set(s).
@@ -284,32 +297,35 @@ func removePodFromHostNSIpset(pod *corev1.Pod, hostsideProbeSet *ipset.IPSet) er
284297
log := log.WithLabels("ns", pod.Namespace, "name", pod.Name, "podUID", podUID, "ipset", hostsideProbeSet.Prefix)
285298

286299
podIPs := util.GetPodIPsIfPresent(pod)
287-
for _, pip := range podIPs {
288-
if uidMismatch, err := hostsideProbeSet.ClearEntriesWithIPAndComment(pip, podUID); err != nil {
289-
return err
290-
} else if uidMismatch != "" {
291-
log.Warnf("pod ip %s could not be removed from ipset, found entry with pod UID %s instead", pip, uidMismatch)
300+
return util.RunAsHost(func() error {
301+
for _, pip := range podIPs {
302+
if uidMismatch, err := hostsideProbeSet.ClearEntriesWithIPAndComment(pip, podUID); err != nil {
303+
return err
304+
} else if uidMismatch != "" {
305+
log.Warnf("pod ip %s could not be removed from ipset, found entry with pod UID %s instead", pip, uidMismatch)
306+
}
307+
log.Debugf("removed pod from host ipset by ip %s", pip)
292308
}
293-
log.Debugf("removed pod from host ipset by ip %s", pip)
294-
}
295-
296-
return nil
309+
return nil
310+
})
297311
}
298312

299313
func pruneHostIPset(expected sets.Set[netip.Addr], hostsideProbeSet *ipset.IPSet) error {
300-
actualIPSetContents, err := hostsideProbeSet.ListEntriesByIP()
301-
if err != nil {
302-
log.Warnf("unable to list IPSet: %v", err)
303-
return err
304-
}
305-
actual := sets.New(actualIPSetContents...)
306-
stales := actual.DifferenceInPlace(expected)
307-
308-
for staleIP := range stales {
309-
if err := hostsideProbeSet.ClearEntriesWithIP(staleIP); err != nil {
314+
return util.RunAsHost(func() error {
315+
actualIPSetContents, err := hostsideProbeSet.ListEntriesByIP()
316+
if err != nil {
317+
log.Warnf("unable to list IPSet: %v", err)
310318
return err
311319
}
312-
log.Debugf("removed stale ip %s from host ipset %s", staleIP, hostsideProbeSet.Prefix)
313-
}
314-
return nil
320+
actual := sets.New(actualIPSetContents...)
321+
stales := actual.DifferenceInPlace(expected)
322+
323+
for staleIP := range stales {
324+
if err := hostsideProbeSet.ClearEntriesWithIP(staleIP); err != nil {
325+
return err
326+
}
327+
log.Debugf("removed stale ip %s from host ipset %s", staleIP, hostsideProbeSet.Prefix)
328+
}
329+
return nil
330+
})
315331
}

cni/pkg/nodeagent/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func NewServer(ctx context.Context, ready *atomic.Value, pluginSocket string, ar
7070

7171
s.dataplane, err = initMeshDataplane(client, args)
7272
if err != nil {
73-
return nil, fmt.Errorf("error initializing mesh dataplane")
73+
return nil, fmt.Errorf("error initializing mesh dataplane: %w", err)
7474
}
7575

7676
s.NotReady()

common/.commonfiles.sha

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f48640e24b3bbca425d82d33f582bffb048b6b2e
1+
be2062872f1e6f4e619cd416402d405d83d81a70

common/config/.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ linters-settings:
9494
- name: constant-logical-expr
9595
- name: bool-literal-in-expr
9696
- name: redefines-builtin-id
97-
- name: imports-blacklist
97+
- name: imports-blocklist
9898
- name: range-val-in-closure
9999
- name: range-val-address
100100
- name: waitgroup-by-value

common/scripts/run.sh

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ read -ra DOCKER_RUN_OPTIONS <<< "${DOCKER_RUN_OPTIONS:-}"
4949
--sig-proxy=true \
5050
--cap-add=SYS_ADMIN \
5151
${DOCKER_SOCKET_MOUNT:--v /var/run/docker.sock:/var/run/docker.sock} \
52+
-e DOCKER_HOST=${DOCKER_SOCKET_HOST:-unix:///var/run/docker.sock} \
5253
$CONTAINER_OPTIONS \
5354
--env-file <(env | grep -v ${ENV_BLOCKLIST}) \
5455
-e IN_BUILD_CONTAINER=1 \

common/scripts/setup_env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fi
7575
TOOLS_REGISTRY_PROVIDER=${TOOLS_REGISTRY_PROVIDER:-gcr.io}
7676
PROJECT_ID=${PROJECT_ID:-istio-testing}
7777
if [[ "${IMAGE_VERSION:-}" == "" ]]; then
78-
IMAGE_VERSION=master-f765f42b0bbcfbfffc112630404904784118a25b
78+
IMAGE_VERSION=master-dbd3c673faecfbd1910fdb09012099fa184dde92
7979
fi
8080
if [[ "${IMAGE_NAME:-}" == "" ]]; then
8181
IMAGE_NAME=build-tools

0 commit comments

Comments
 (0)