Skip to content

Conversation

@ajanikow
Copy link
Collaborator

@ajanikow ajanikow commented Nov 4, 2025

No description provided.

@ajanikow ajanikow requested a review from Copilot November 4, 2025 17:59
@cla-bot cla-bot bot added the cla-signed label Nov 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for managing registry credentials secrets for license authentication in the ArangoDB Kubernetes operator. The main changes include automatically creating and updating a Kubernetes secret containing registry credentials when API-based licensing is configured, and integrating those credentials into the deployment profiles.

Key changes:

  • Added RegistryConfig method to the license manager client that generates registry authentication configuration
  • Introduced PatchSecretData helper function for patching Kubernetes secret data
  • Added InputHash field to license status to track changes to license credentials
  • Integrated registry credentials secret into ArangoDB profiles for image pulling

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/util/k8sutil/patcher/secret.go New patcher function for updating secret data
pkg/util/k8sutil/license.go Added Hash method for license credentials
pkg/util/constants/gateway.go Extracted ChecksumKey constant for reuse
pkg/license_manager/client.go Added RegistryConfig method for generating registry auth
pkg/deployment/resources/arango_profiles.go Integrated image pull secrets into profiles
pkg/deployment/reconcile/plan_builder_license.go Added validation for registry secret changes
pkg/deployment/reconcile/action_license_generate.go Added registry secret creation/update logic
pkg/deployment/reconcile/action_license_set.go Updated to track InputHash in license status
pkg/deployment/pod/encryption.go Added helper for registry secret naming
pkg/apis/deployment/v*/deployment_status_license.go Added InputHash field to API definitions
pkg/platform/license_*.go Refactored to use lmanager alias consistently
pkg/util/cli/lm.go Updated to use lmanager alias
.golangci.yaml Added lmanager alias configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ajanikow ajanikow requested a review from Copilot November 4, 2025 19:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ajanikow ajanikow requested a review from Copilot November 4, 2025 20:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cache := a.actionCtx.ACS().CurrentClusterCache()

if s, ok := cache.Secret().V1().GetSimple(pod.GetLicenseRegistryCredentialsSecretName(a.actionCtx.GetName())); ok {
if string(util.Optional(s.Data, utilConstants.ChecksumKey, []byte{})) != l.API.Hash() {
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checksum comparison is duplicated in both the if and else branches (lines 176 and 246 in plan_builder_license.go). Consider extracting this logic into a helper function to improve maintainability and ensure consistent validation logic across the codebase.

Copilot uses AI. Check for mistakes.
Comment on lines +201 to +213
if _, err := cache.Client().Kubernetes().CoreV1().Secrets(a.actionCtx.GetNamespace()).Create(ctx, &core.Secret{
ObjectMeta: meta.ObjectMeta{
Name: pod.GetLicenseRegistryCredentialsSecretName(a.actionCtx.GetName()),
OwnerReferences: []meta.OwnerReference{
a.actionCtx.GetAPIObject().AsOwner(),
},
},
Data: map[string][]byte{
core.DockerConfigJsonKey: token,
utilConstants.ChecksumKey: []byte(l.API.Hash()),
},
Type: core.SecretTypeDockerConfigJson,
}, meta.CreateOptions{}); err != nil {
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Secret creation logic (lines 201-213) duplicates the data structure from the patch operation (lines 186-189). Consider extracting a helper function that constructs the Secret data map to avoid duplication and ensure consistency between create and update operations.

Copilot uses AI. Check for mistakes.
@ajanikow ajanikow merged commit b6b5275 into master Nov 5, 2025
3 checks passed
@ajanikow ajanikow deleted the feature/platform/registry_secret branch November 5, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants