Skip to content

Commit

Permalink
Merge branch 'main' into ver/kube-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
olix0r committed Jan 25, 2025
2 parents 69f3406 + d6d80bb commit 9982985
Show file tree
Hide file tree
Showing 49 changed files with 1,314 additions and 909 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- run: go install gotest.tools/gotestsum@v0.4.2
- run: gotestsum -- -cover -coverprofile=coverage.out -v -mod=readonly ./...
- uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303
- uses: codecov/codecov-action@5a605bd92782ce0810fa3b8acc235c921b497052
with:
files: ./coverage.out
flags: unittests,golang
Expand All @@ -41,7 +41,7 @@ jobs:
export NODE_ENV=test
bin/web --frozen-lockfile
bin/web test --reporters="jest-progress-bar-reporter" --reporters="./gh_ann_reporter.js" --coverage
- uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303
- uses: codecov/codecov-action@5a605bd92782ce0810fa3b8acc235c921b497052
with:
directory: ./web/app/coverage
flags: unittests,javascript
Expand All @@ -58,6 +58,6 @@ jobs:
- shell: bash
run: mkdir -p target && cd target && bin/scurl -v https://github.com/xd009642/tarpaulin/releases/download/0.27.3/cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz | tar zxvf - && chmod 755 cargo-tarpaulin
- run: target/cargo-tarpaulin tarpaulin --workspace --out Xml
- uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303
- uses: codecov/codecov-action@5a605bd92782ce0810fa3b8acc235c921b497052
with:
flags: unittests,rust
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- javascript

steps:
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version: "1.23"
- name: Checkout
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version: "1.23"
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version: "1.23"
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
Expand All @@ -288,7 +288,7 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version: "1.23"
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version: "1.23"
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: DavidAnson/markdownlint-cli2-action@a23dae216ce3fee4db69da41fed90d2a4af801cf
- uses: DavidAnson/markdownlint-cli2-action@05f32210e84442804257b2a6f20b273450ec8265
with:
globs: |
**/*.md
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version: "1.23"
- name: Download image archives
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
with:
go-version: "1.23"
- name: Set environment variables from scripts
Expand Down
2 changes: 1 addition & 1 deletion .proxy-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.271.0
v2.276.0
52 changes: 26 additions & 26 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b"

[[package]]
name = "cc"
version = "1.2.9"
version = "1.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
dependencies = [
"shlex",
]
Expand All @@ -280,19 +280,19 @@ dependencies = [

[[package]]
name = "clap"
version = "4.5.26"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783"
checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796"
dependencies = [
"clap_builder",
"clap_derive",
]

[[package]]
name = "clap_builder"
version = "4.5.26"
version = "4.5.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121"
checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7"
dependencies = [
"anstyle",
"clap_lex",
Expand Down Expand Up @@ -413,9 +413,9 @@ dependencies = [

[[package]]
name = "data-encoding"
version = "2.6.0"
version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2"
checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f"

[[package]]
name = "digest"
Expand Down Expand Up @@ -978,9 +978,9 @@ dependencies = [

[[package]]
name = "ipnet"
version = "2.10.1"
version = "2.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708"
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
dependencies = [
"schemars",
"serde",
Expand Down Expand Up @@ -1484,9 +1484,9 @@ dependencies = [

[[package]]
name = "linux-raw-sys"
version = "0.4.14"
version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"

[[package]]
name = "lock_api"
Expand All @@ -1500,9 +1500,9 @@ dependencies = [

[[package]]
name = "log"
version = "0.4.22"
version = "0.4.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"

[[package]]
name = "maplit"
Expand Down Expand Up @@ -1539,9 +1539,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"

[[package]]
name = "miniz_oxide"
version = "0.8.2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394"
checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924"
dependencies = [
"adler2",
]
Expand Down Expand Up @@ -1799,9 +1799,9 @@ dependencies = [

[[package]]
name = "proc-macro2"
version = "1.0.92"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
Expand Down Expand Up @@ -2214,9 +2214,9 @@ dependencies = [

[[package]]
name = "serde_json"
version = "1.0.135"
version = "1.0.137"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9"
checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b"
dependencies = [
"itoa",
"memchr",
Expand Down Expand Up @@ -2395,9 +2395,9 @@ dependencies = [

[[package]]
name = "tokio"
version = "1.42.0"
version = "1.43.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551"
checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e"
dependencies = [
"backtrace",
"bytes",
Expand All @@ -2413,9 +2413,9 @@ dependencies = [

[[package]]
name = "tokio-macros"
version = "2.4.0"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
dependencies = [
"proc-macro2",
"quote",
Expand Down Expand Up @@ -2729,9 +2729,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"

[[package]]
name = "valuable"
version = "0.1.0"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"

[[package]]
name = "vcpkg"
Expand Down
5 changes: 1 addition & 4 deletions charts/linkerd2-cni/templates/cni-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,7 @@ spec:
selector:
matchLabels:
k8s-app: linkerd-cni
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
updateStrategy: {{ .Values.updateStrategy | toYaml | nindent 4 }}
template:
metadata:
labels:
Expand Down
5 changes: 5 additions & 0 deletions charts/linkerd2-cni/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ disableIPv6: true
priorityClassName: ""
# -- Specifies the number of old ReplicaSets to retain to allow rollback.
revisionHistoryLimit: 10
# -- Specifies the update strategy for how the new pods are rolled out
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1

# -- Add a PSP resource and bind it to the linkerd-cni ServiceAccounts.
# Note PSP has been deprecated since k8s v1.21
Expand Down
40 changes: 21 additions & 19 deletions controller/api/destination/watcher/workload_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,26 +656,37 @@ func (wp *workloadPublisher) unsubscribe(listener WorkloadUpdateListener) {
}

// updatePod creates an Address instance for the given pod, that is passed to
// the listener's Update() method, only if the pod's readiness state has
// the listener's Update() method, only if the pod's running state has
// changed. If the passed pod is nil, it means the pod (still referred to in
// wp.pod) has been deleted.
// Note that we care only about the running state instead of a stronger
// requirement on readiness state because this is used in the context of
// _endpoint_ profile subscriptions, as opposed to _service_ profile
// subscriptions. The former is used when calling GetProfile for a specific
// pod, usually when hitting instances of a StatefulSet, with IPs possibly
// derived from a headless service. An example of this is a Cassandra cluster,
// where a new node won't become ready until it's connected from other members
// of the cluster. For such connections to work inside the mesh, we need
// GetProfile to return the endpoint profile for the pod, even if it's not
// ready.
// See https://github.com/linkerd/linkerd2/issues/13247
func (wp *workloadPublisher) updatePod(pod *corev1.Pod) {
wp.mu.Lock()
defer wp.mu.Unlock()

// pod wasn't ready or there was no backing pod - check if passed pod is ready
// pod wasn't running or there was no backing pod - check if passed pod is running
if wp.addr.Pod == nil {
if pod == nil {
wp.log.Trace("Pod deletion event already consumed - ignore")
return
}

if !isRunningAndReady(pod) {
wp.log.Tracef("Pod %s.%s not ready - ignore", pod.Name, pod.Namespace)
if !isRunning(pod) {
wp.log.Tracef("Pod %s.%s not running - ignore", pod.Name, pod.Namespace)
return
}

wp.log.Debugf("Pod %s.%s became ready", pod.Name, pod.Namespace)
wp.log.Debugf("Pod %s.%s started running", pod.Name, pod.Namespace)
wp.addr.Pod = pod

// Fill in ownership.
Expand Down Expand Up @@ -705,9 +716,9 @@ func (wp *workloadPublisher) updatePod(pod *corev1.Pod) {
return
}

// backing pod becoming unready or getting deleted
if pod == nil || !isRunningAndReady(pod) {
wp.log.Debugf("Pod %s.%s deleted or it became unready - remove", wp.addr.Pod.Name, wp.addr.Pod.Namespace)
// backing pod stopped running or getting deleted
if pod == nil || !isRunning(pod) {
wp.log.Debugf("Pod %s.%s deleted or it stopped running - remove", wp.addr.Pod.Name, wp.addr.Pod.Namespace)
wp.addr.Pod = nil
wp.addr.OwnerKind = ""
wp.addr.OwnerName = ""
Expand Down Expand Up @@ -828,15 +839,6 @@ func isNamedInExternalWorkload(pr string, ew *ext.ExternalWorkload) (int32, bool
return 0, false
}

func isRunningAndReady(pod *corev1.Pod) bool {
if pod == nil || pod.Status.Phase != corev1.PodRunning {
return false
}
for _, condition := range pod.Status.Conditions {
if condition.Type == corev1.PodReady && condition.Status == corev1.ConditionTrue {
return true
}
}

return false
func isRunning(pod *corev1.Pod) bool {
return pod != nil && pod.Status.Phase == corev1.PodRunning
}
9 changes: 9 additions & 0 deletions controller/k8s/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
l5dcrdclient "github.com/linkerd/linkerd2/controller/gen/client/clientset/versioned"
l5dcrdinformer "github.com/linkerd/linkerd2/controller/gen/client/informers/externalversions"
ewinformers "github.com/linkerd/linkerd2/controller/gen/client/informers/externalversions/externalworkload/v1beta1"
linkinformers "github.com/linkerd/linkerd2/controller/gen/client/informers/externalversions/link/v1alpha2"
srvinformers "github.com/linkerd/linkerd2/controller/gen/client/informers/externalversions/server/v1beta3"
spinformers "github.com/linkerd/linkerd2/controller/gen/client/informers/externalversions/serviceprofile/v1alpha2"
"github.com/linkerd/linkerd2/pkg/k8s"
Expand Down Expand Up @@ -52,6 +53,7 @@ type API struct {
es discoveryinformers.EndpointSliceInformer
ew ewinformers.ExternalWorkloadInformer
job batchv1informers.JobInformer
link linkinformers.LinkInformer
mwc arinformers.MutatingWebhookConfigurationInformer
ns coreinformers.NamespaceInformer
pod coreinformers.PodInformer
Expand Down Expand Up @@ -248,6 +250,13 @@ func newAPI(
api.job = sharedInformers.Batch().V1().Jobs()
api.syncChecks = append(api.syncChecks, api.job.Informer().HasSynced)
api.promGauges.addInformerSize(k8s.Job, informerLabels, api.job.Informer())
case Link:
if l5dCrdSharedInformers == nil {
panic("Linkerd CRD shared informer not configured")
}
api.link = l5dCrdSharedInformers.Link().V1alpha2().Links()
api.syncChecks = append(api.syncChecks, api.link.Informer().HasSynced)
api.promGauges.addInformerSize(k8s.Link, informerLabels, api.link.Informer())
case MWC:
api.mwc = sharedInformers.Admissionregistration().V1().MutatingWebhookConfigurations()
api.syncChecks = append(api.syncChecks, api.mwc.Informer().HasSynced)
Expand Down
1 change: 1 addition & 0 deletions controller/k8s/api_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
ES // EndpointSlice resource
ExtWorkload
Job
Link
MWC
NS
Pod
Expand Down
Loading

0 comments on commit 9982985

Please sign in to comment.