Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Aransh authored Oct 16, 2024
2 parents 84131ee + 958cfca commit 7f4b387
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 305 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ jobs:
echo "PATH=$PATH" >> "$GITHUB_ENV"
bin/scurl -v "https://raw.githubusercontent.com/k3d-io/k3d/${K3D_VERSION}/install.sh" | bash
bin/scurl -vo /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" && chmod +x /usr/local/bin/yq
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab
- run: cargo install cargo-nextest
- run: just policy-test-build
- run: just k3d-k8s='${{ matrix.k8s }}' k3d-create
Expand Down
24 changes: 12 additions & 12 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3"

[[package]]
name = "cc"
version = "1.1.28"
version = "1.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1"
checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945"
dependencies = [
"shlex",
]
Expand Down Expand Up @@ -1556,9 +1556,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"

[[package]]
name = "pest"
version = "2.7.13"
version = "2.7.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9"
checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442"
dependencies = [
"memchr",
"thiserror",
Expand All @@ -1567,19 +1567,19 @@ dependencies = [

[[package]]
name = "pest_derive"
version = "2.7.13"
version = "2.7.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0"
checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd"
dependencies = [
"pest",
"pest_generator",
]

[[package]]
name = "pest_generator"
version = "2.7.13"
version = "2.7.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e"
checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e"
dependencies = [
"pest",
"pest_meta",
Expand All @@ -1590,9 +1590,9 @@ dependencies = [

[[package]]
name = "pest_meta"
version = "2.7.13"
version = "2.7.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f"
checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d"
dependencies = [
"once_cell",
"pest",
Expand Down Expand Up @@ -1904,9 +1904,9 @@ dependencies = [

[[package]]
name = "rustversion"
version = "1.0.17"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248"

[[package]]
name = "ryu"
Expand Down
19 changes: 14 additions & 5 deletions controller/api/destination/endpoint_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ func (et *endpointTranslator) sendClientAdd(set watcher.AddressSet) {
Addr: addr,
Weight: defaultWeight,
AuthorityOverride: authOverride,
MetricLabels: map[string]string{},
}

if address.Identity != "" {
Expand All @@ -465,12 +466,20 @@ func (et *endpointTranslator) sendClientAdd(set watcher.AddressSet) {
}
}

if et.extEndpointZoneWeights {
// EXPERIMENTAL: Use the endpoint weight field to indicate zonal
// preference so that local endoints are more heavily weighted.
if et.nodeTopologyZone != "" && address.Zone != nil && *address.Zone == et.nodeTopologyZone {
wa.Weight *= 10
if et.nodeTopologyZone != "" && address.Zone != nil {
if *address.Zone == et.nodeTopologyZone {
wa.MetricLabels["zone_locality"] = "local"

if et.extEndpointZoneWeights {
// EXPERIMENTAL: Use the endpoint weight field to indicate zonal
// preference so that local endoints are more heavily weighted.
wa.Weight *= 10
}
} else {
wa.MetricLabels["zone_locality"] = "remote"
}
} else {
wa.MetricLabels["zone_locality"] = "unknown"
}

addrs = append(addrs, wa)
Expand Down
2 changes: 2 additions & 0 deletions controller/api/destination/endpoint_translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ func TestEndpointTranslatorForPods(t *testing.T) {
"serviceaccount": "serviceaccount-name",
"control_plane_ns": "linkerd",
"zone": "",
"zone_locality": "unknown",
}
if diff := deep.Equal(actualAddedAddress1MetricLabels, expectedAddedAddress1MetricLabels); diff != nil {
t.Fatalf("Expected global metric labels sent to be [%v] but was [%v]", expectedAddedAddress1MetricLabels, actualAddedAddress1MetricLabels)
Expand Down Expand Up @@ -658,6 +659,7 @@ func TestEndpointTranslatorExternalWorkloads(t *testing.T) {
expectedAddedAddress1MetricLabels := map[string]string{
"external_workload": "ew-1",
"zone": "",
"zone_locality": "unknown",
"workloadgroup": "wg-name",
}
if diff := deep.Equal(actualAddedAddress1MetricLabels, expectedAddedAddress1MetricLabels); diff != nil {
Expand Down
10 changes: 5 additions & 5 deletions web/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"@babel/eslint-plugin": "7.25.1",
"@babel/eslint-plugin": "7.25.7",
"@fortawesome/fontawesome-svg-core": "6.6.0",
"@fortawesome/free-regular-svg-icons": "6.6.0",
"@fortawesome/free-solid-svg-icons": "6.6.0",
Expand All @@ -29,7 +29,7 @@
"make-plural": "^7.4.0",
"path": "0.12.7",
"prop-types": "15.8.1",
"query-string": "^9.1.0",
"query-string": "^9.1.1",
"react": "16.14.0",
"react-dom": "16.14.0",
"react-linkify": "1.0.0-alpha",
Expand All @@ -41,10 +41,10 @@
"whatwg-fetch": "3.6.20"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/core": "^7.25.8",
"@babel/eslint-parser": "^7.25.8",
"@babel/plugin-proposal-class-properties": "^7.17.12",
"@babel/preset-env": "^7.25.7",
"@babel/preset-env": "^7.25.8",
"@babel/preset-react": "^7.25.7",
"@babel/runtime": "^7.25.7",
"@lingui/cli": "3.17.2",
Expand Down
Loading

0 comments on commit 7f4b387

Please sign in to comment.