Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.4

# Build the manager binary
FROM golang:1.23 as builder
FROM golang:1.24 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
7 changes: 5 additions & 2 deletions api/v1/groupversion_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import (

func TestAddKnownTypes(t *testing.T) {
scheme := runtime.NewScheme()
AddToScheme(scheme)
err := addKnownTypes(scheme)
err := AddToScheme(scheme)
if err != nil {
t.Fatalf("failure to add to Scheme %v", err)
}
err = addKnownTypes(scheme)
if err != nil {
t.Fatalf("failure to add known types %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1/testdata/parameter-set.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schemaVersion: 1.0.1
schemaVersion: 1.1.0
name: porter-test-me
namespace: dev
parameters:
Expand Down
171 changes: 156 additions & 15 deletions config/crd/bases/getporter.org_agentactions.yaml

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions controllers/agentaction_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func TestAgentActionReconciler_Reconcile(t *testing.T) {
},
},
}
controller := setupAgentActionController(testdata...)
controller := setupAgentActionController(t, testdata...)

var action v1.AgentAction
triggerReconcile := func() {
Expand Down Expand Up @@ -336,7 +336,7 @@ func TestAgentActionReconciler_createAgentVolume(t *testing.T) {
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
controller := setupAgentActionController()
controller := setupAgentActionController(t)
action := &v1.AgentAction{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.GroupVersion.String(),
Expand Down Expand Up @@ -468,7 +468,7 @@ func TestAgentActionReconciler_createConfigSecret(t *testing.T) {
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
controller := setupAgentActionController()
controller := setupAgentActionController(t)
action := &v1.AgentAction{
TypeMeta: metav1.TypeMeta{
APIVersion: v1.GroupVersion.String(),
Expand Down Expand Up @@ -597,7 +597,7 @@ func TestAgentActionReconciler_createWorkdirSecret(t *testing.T) {
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
controller := setupAgentActionController()
controller := setupAgentActionController(t)

action := &v1.AgentAction{
TypeMeta: metav1.TypeMeta{
Expand Down Expand Up @@ -682,7 +682,7 @@ func TestAgentActionReconciler_createWorkdirSecret(t *testing.T) {
}

func TestAgentActionReconciler_createAgentJob(t *testing.T) {
controller := setupAgentActionController()
controller := setupAgentActionController(t)

action := testAgentAction()
agentCfg := testAgentCfgSpec()
Expand Down Expand Up @@ -801,7 +801,7 @@ func TestAgentActionReconciler_createAgentJob_withImagePullSecrets(t *testing.T)
testdata := []client.Object{
testSA,
}
controller := setupAgentActionController(testdata...)
controller := setupAgentActionController(t, testdata...)

action := testAgentAction()
agentCfg := testAgentCfgSpec()
Expand Down Expand Up @@ -862,7 +862,7 @@ func TestAgentActionReconciler_createAgentJob_withImagePullSecrets(t *testing.T)
}

func TestAgentActionReconciler_getAgentVolumes_agentconfigaction(t *testing.T) {
controller := setupAgentActionController()
controller := setupAgentActionController(t)
action := testAgentAction()
agentCfg := testAgentCfgSpec()
pvc := &corev1.PersistentVolumeClaim{ObjectMeta: metav1.ObjectMeta{Name: "mypvc"}}
Expand Down Expand Up @@ -902,7 +902,7 @@ func TestAgentActionReconciler_getAgentVolumes_agentconfigaction(t *testing.T) {
// Ensure that we can create a valid AgentAction when no plugins were specified for the AgentConfig
// In which case we should not mount porter-plugins into the agent
func TestAgentActionReconciler_NoPluginsSpecified(t *testing.T) {
controller := setupAgentActionController()
controller := setupAgentActionController(t)
action := testAgentAction()
agentCfg := testAgentCfgSpec()

Expand Down Expand Up @@ -935,7 +935,7 @@ func TestDeletionTimeStampAgentAction(t *testing.T) {
},
}
ctx := context.Background()
r := setupAgentActionController(action)
r := setupAgentActionController(t, action)
_, err := r.Reconcile(ctx, ctrl.Request{})
assert.NoError(t, err)
}
Expand Down Expand Up @@ -963,7 +963,7 @@ func TestAgentActionReconciler_resolveAgentConfig(t *testing.T) {
actionWithOverride.Spec.AgentConfig = &corev1.LocalObjectReference{Name: overrideCfg.Name}
actionWithNoOverride := testAgentAction()
actionWithNoOverride.Name = "no override"
controller := setupAgentActionController(&systemCfg, &overrideCfg, actionWithOverride, actionWithNoOverride)
controller := setupAgentActionController(t, &systemCfg, &overrideCfg, actionWithOverride, actionWithNoOverride)

_, err := controller.resolveAgentConfig(context.Background(), logr.Discard(), actionWithOverride)
require.ErrorContains(t, err, "resolved agent configuration is not ready to be used")
Expand Down Expand Up @@ -1028,11 +1028,11 @@ func assertVolumeMount(t *testing.T, mounts []corev1.VolumeMount, name string, p
assert.Fail(t, fmt.Sprintf("expected the %s VolumeMount to be set", name))
}

func setupAgentActionController(objs ...client.Object) AgentActionReconciler {
func setupAgentActionController(t *testing.T, objs ...client.Object) AgentActionReconciler {
scheme := runtime.NewScheme()
v1.AddToScheme(scheme)
batchv1.AddToScheme(scheme)
corev1.AddToScheme(scheme)
assert.NoError(t, v1.AddToScheme(scheme))
assert.NoError(t, batchv1.AddToScheme(scheme))
assert.NoError(t, corev1.AddToScheme(scheme))

fakeBuilder := fake.NewClientBuilder()
fakeBuilder.WithScheme(scheme)
Expand Down
5 changes: 4 additions & 1 deletion controllers/installation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ func (r *InstallationReconciler) CheckOrCreateInstallationOutputsCR(ctx context.
}
// TODO: Wrap in a retry? Try to reduce the errors
log.V(Log5Trace).Info("setting owner references on outputs cr")
controllerutil.SetOwnerReference(inst, outputs, r.Scheme)
err = controllerutil.SetOwnerReference(inst, outputs, r.Scheme)
if err != nil {
return ctrl.Result{}, err
}
err = r.Create(ctx, outputs, &client.CreateOptions{})
if err != nil {
return ctrl.Result{}, err
Expand Down
4 changes: 2 additions & 2 deletions controllers/installation_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func TestUninstallInstallation(t *testing.T) {
err := rec.uninstallInstallation(ctx, rec.Log, inst)
assert.NoError(t, err)
gotInstall := &v1.Installation{}
rec.Get(ctx, types.NamespacedName{Name: "fake-install", Namespace: "fake-ns"}, gotInstall)
assert.NoError(t, rec.Get(ctx, types.NamespacedName{Name: "fake-install", Namespace: "fake-ns"}, gotInstall))
assert.NotEmpty(t, gotInstall.Status)
assert.Equal(t, v1.PhaseUnknown, gotInstall.Status.Phase)
}
Expand Down Expand Up @@ -507,7 +507,7 @@ func TestCheckOrCreateInstallationOutputsCRCreateFail(t *testing.T) {
func TestSetupWithManager(t *testing.T) {
r := &InstallationReconciler{}
scheme := runtime.NewScheme()
v1.AddToScheme(scheme)
assert.NoError(t, v1.AddToScheme(scheme))
var restConfig *rest.Config
mgr, err := manager.New(restConfig, manager.Options{})
assert.Error(t, err)
Expand Down
Loading
Loading