Skip to content

Conversation

@debdutdeb
Copy link
Member

No description provided.

@debdutdeb debdutdeb requested a review from Copilot November 20, 2025 15:09
Copilot finished reviewing on behalf of debdutdeb November 20, 2025 15:10
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 basic integration tests using k3d clusters and updates dependencies to newer versions. The changes include new test utilities for managing k3d clusters and kubectl operations, test suite configuration, and controller integration tests.

Key Changes:

  • Added test infrastructure using k3d for integration testing
  • Updated Go modules and Kubernetes dependencies to newer versions
  • Migrated from envtest to k3d-based integration tests
  • Updated controller code to use newer controller-runtime APIs

Reviewed Changes

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

Show a summary per file
File Description
tests/utils/utils.go Utility functions for running commands in tests
tests/utils/kubectl.go Kubectl wrapper for test operations
tests/utils/k3d.go K3d cluster management utilities
tests/suite_test.go Test suite setup migrated from envtest to k3d
tests/controller_test.go Integration tests for airlock controller
tests/assets/ Test fixtures for MongoDB and airlock resources
go.mod Invalid Go version 1.25.3 specified
go.sum Updated dependency checksums
controllers/mongodbcluster_controller.go Updated to newer controller-runtime API
main.go Commented out metrics and webhook ports
config/ Namespace changed from "system" to "airlock-system"
Makefile Test command updated to use new test suite
.github/workflows/ Invalid Go version 1.25 in golangci-lint workflow

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


_, hasConnectionString := secret.Data["connectionString"]
if !hasConnectionString {
return fmt.Errorf("generated secret is missing connectionSecret")
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

Typo in error message: "connectionSecret" should be "connectionString" to match the actual secret field being checked.

Suggested change
return fmt.Errorf("generated secret is missing connectionSecret")
return fmt.Errorf("generated secret is missing connectionString")

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

agreed


Context("Airlock Controller", func() {
It("should run successfully", func() {
// FIXME: this is failig -_-
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

Typo in comment: "failig" should be "failing".

Suggested change
// FIXME: this is failig -_-
// FIXME: this is failing -_-

Copilot uses AI. Check for mistakes.
Comment on lines +70 to +71
// MetricsBindAddress: metricsAddr,
// Port: 9443,
Copy link
Contributor

Choose a reason for hiding this comment

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

why commenting these out?

Copy link
Contributor

@geekgonecrazy geekgonecrazy left a comment

Choose a reason for hiding this comment

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

Over all seems like a good improvement to be doing more integration testing and seeing how this thing will actually behave in a kubernetes cluster

- --leader-elect
image: controller:latest
imagePullPolicy: Always
image: docker.io/library/controller:latest
Copy link
Member

Choose a reason for hiding this comment

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

erm, why change this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will revert. Was checking something.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will revert. Was checking something.

image: controller:latest
imagePullPolicy: Always
image: docker.io/library/controller:latest
imagePullPolicy: IfNotPresent
Copy link
Member

Choose a reason for hiding this comment

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

and this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Pull policy yes needs changing because I'm importing image to k3d, and always policy will not use that image but try to pull

Copy link
Member Author

Choose a reason for hiding this comment

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

Pull policy yes needs changing because I'm importing image to k3d, and always policy will not use that image but try to pull

Copy link
Member Author

Choose a reason for hiding this comment

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

Pull policy yes needs changing because I'm importing image to k3d, and always policy will not use that image but try to pull

metadata:
name: controller-manager
namespace: system
namespace: airlock-system
Copy link
Member

Choose a reason for hiding this comment

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

I don't get why those changes to the namespace is needed.

In config/default/kustomization.yaml, there is

namespace: airlock-system

namePrefix: airlock-

so all resources here will go to that namespace, and be named correctly.....

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll revert. Did this before saw the kustomize file

app.kubernetes.io/part-of: airlock
app.kubernetes.io/managed-by: kustomize
name: system
name: airlock-system
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, this will break, it will be called airlock-airlock-system


ready := false

// TODO: i doubt this is full proof
Copy link
Member

Choose a reason for hiding this comment

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

should we look in mongo to see if it actually created? or do we just trust ourselves?

return err
}

_, hasConnectionString := secret.Data["connectionString"]
Copy link
Member

Choose a reason for hiding this comment

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

same here, should we try to connect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants