-
Notifications
You must be signed in to change notification settings - Fork 141
Upgrade Dependencies for APIM-APK Agent #1332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughUpdates dependency baselines (Alpine, grpc-health-probe, Go toolchain, indirect Go modules) and standardizes log formatting to printf-style. TokenIssuer handling in the k8s client was adjusted to use Create in additional paths and some namespace/log formatting changes were applied. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as Updater
participant K8s as k8sClient
participant K8sAPI as Kubernetes API
Note over Caller,K8s: TokenIssuer reconciliation (high level)
Caller->>K8s: Ensure TokenIssuer exists (Get)
alt TokenIssuer found
K8s->>K8sAPI: (optionally) Update TokenIssuer
K8sAPI-->>K8s: 200 OK
K8s-->>Caller: Log "updated" (or keep existing)
else TokenIssuer missing
K8s->>K8sAPI: Create TokenIssuer
K8sAPI-->>K8s: 201 Created
K8s-->>Caller: Log "created" (uses "%s" formatting)
end
Note right of K8s: Logging standardized to printf-style\nand namespace read from resource struct
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apim-apk-agent/Dockerfile (1)
27-28: Critical: Checksums must be updated for the new grpc-health-probe version.The grpc-health-probe version was updated from v0.4.37 to v0.4.42, but the checksums on lines 27-28 remain unchanged. This will cause the checksum verification to fail during the Docker build, resulting in a build failure.
Please update the checksums to match the v0.4.42 binaries:
#!/bin/bash # Fetch the actual checksums for grpc-health-probe v0.4.42 echo "AMD64 checksum:" curl -sL https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.42/grpc_health_probe-linux-amd64 | sha256sum echo "ARM64 checksum:" curl -sL https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.42/grpc_health_probe-linux-arm64 | sha256sumAlso applies to: 50-50
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
apim-apk-agent/Dockerfile(2 hunks)apim-apk-agent/go.mod(1 hunks)apim-apk-agent/internal/k8sClient/k8s_client.go(4 hunks)apim-apk-agent/internal/logging/logging_test.go(1 hunks)apim-apk-agent/internal/synchronizer/aiproviders_fetcher.go(1 hunks)apim-apk-agent/internal/utils/apis_fetcher.go(1 hunks)apim-apk-agent/pkg/logging/log_format.go(1 hunks)apim-apk-agent/pkg/logging/package_logs.go(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
apim-apk-agent/internal/synchronizer/aiproviders_fetcher.go (1)
apim-apk-agent/internal/loggers/logger.go (1)
LoggerSynchronizer(51-51)
apim-apk-agent/internal/utils/apis_fetcher.go (2)
apim-apk-agent/pkg/loggers/logger.go (1)
LoggerUtils(53-53)apim-apk-agent/internal/loggers/logger.go (1)
LoggerUtils(52-52)
apim-apk-agent/pkg/logging/package_logs.go (1)
apim-apk-agent/pkg/logging/log_constants.go (2)
SEVERITY(41-41)ERRORCODE(42-42)
apim-apk-agent/internal/k8sClient/k8s_client.go (1)
apim-apk-agent/internal/loggers/logger.go (1)
LoggerK8sClient(48-48)
🔇 Additional comments (10)
apim-apk-agent/internal/utils/apis_fetcher.go (1)
78-81: LGTM: Printf-style formatting improves consistency.The change from string concatenation to printf-style formatting is a good improvement that aligns with Go best practices and improves consistency across the codebase.
apim-apk-agent/pkg/logging/log_format.go (1)
74-74: LGTM: Removes unnecessary fmt.Sprintf wrapper.The change correctly removes the redundant
fmt.Sprintfcall sinceentry.Time.Format()already returns a string.apim-apk-agent/pkg/logging/package_logs.go (1)
42-43: LGTM: Format string prevents injection vulnerabilities.Using an explicit format string
"%s"prevents potential format string injection ife.Messagecontains format specifiers. This is a security improvement.apim-apk-agent/internal/logging/logging_test.go (1)
51-51: LGTM: Test updated to match new PrintError signature.The test correctly reflects the API change where
PrintErrornow accepts a format string and variadic arguments.apim-apk-agent/internal/k8sClient/k8s_client.go (2)
669-669: LGTM: Printf-style formatting improves consistency.The logging changes use printf-style formatting with
%sinstead of string concatenation, which is more idiomatic and consistent with other changes in this PR.Also applies to: 712-712
703-703: LGTM: Direct field access is cleaner.Accessing
internalKeyTokenIssuer.Namespacedirectly instead ofinternalKeyTokenIssuer.ObjectMeta.Namespaceis cleaner sinceNamespaceis promoted to the top level.apim-apk-agent/internal/synchronizer/aiproviders_fetcher.go (1)
118-118: LGTM: Printf-style formatting improves consistency.The change from string concatenation to printf-style formatting aligns with Go best practices and is consistent with other logging improvements in this PR.
apim-apk-agent/Dockerfile (2)
17-17: No issues found—Alpine 3.22.1 is a valid, available release.The verification confirms that Alpine 3.22.1 exists and is available in the official Alpine Linux repository. The Dockerfile base image reference is correct.
50-50: Version v0.4.42 is confirmed to exist and be available.grpc-health-probe v0.4.42 is published on GitHub Releases (released 12 Nov 2025). The URL and version in the Dockerfile are valid.
apim-apk-agent/go.mod (1)
3-3: No issues found — Go 1.25.4 is valid and current.The latest stable Go release as of November 2025 is Go 1.25.4 (released November 5, 2025). The code change in
apim-apk-agent/go.modis correct and uses the current stable version. The original concern was based on outdated information from early 2025.Likely an incorrect or invalid review comment.
Purpose
Summary by CodeRabbit
Chores
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.