Skip to content
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

Set controller runtime logger in Azure e2e tests #3940

Merged
merged 2 commits into from
Jun 1, 2023
Merged
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
4 changes: 3 additions & 1 deletion tests/azure/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/klog/v2/klogr"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
runtimeLog "sigs.k8s.io/controller-runtime/pkg/log"

automationv1beta1 "github.com/fluxcd/image-automation-controller/api/v1beta1"
reflectorv1beta2 "github.com/fluxcd/image-reflector-controller/api/v1beta2"
Expand Down Expand Up @@ -111,7 +113,7 @@ func TestMain(m *testing.M) {

func setup(m *testing.M) (exitVal int, err error) {
ctx := context.TODO()

runtimeLog.SetLogger(klogr.New())
// Setup Terraform binary and init state
log.Println("Setting up Azure test infrastructure")
i := install.NewInstaller()
Expand Down
2 changes: 1 addition & 1 deletion tests/azure/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ require (
k8s.io/api v0.27.2
k8s.io/apimachinery v0.27.2
k8s.io/client-go v0.27.2
k8s.io/klog/v2 v2.100.1
sigs.k8s.io/controller-runtime v0.15.0
)

Expand Down Expand Up @@ -111,7 +112,6 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.27.2 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
3 changes: 3 additions & 0 deletions tests/azure/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ func getRepository(repoURL, branchName string, overrideBranch bool, password str
Branch: checkoutBranch,
},
})
if err != nil {
return nil, "", err
}

err = c.SwitchBranch(context.Background(), branchName)
if err != nil {
Expand Down