Skip to content

Commit

Permalink
fix failing unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jaideep Rao <[email protected]>
  • Loading branch information
jaideepr97 committed Jan 2, 2024
1 parent a41ea6f commit 74235db
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion controllers/argocd/argocd_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func clusterResources(argocd *argoproj.ArgoCD) []client.Object {
// deletion of the associated objects.
func TestArgoCDReconciler_Reconcile_with_deleted(t *testing.T) {
logf.SetLogger(ZapLogger(true))
a := makeTestArgoCD(deletedAt(time.Now()))
a := makeTestArgoCD(deletedAt(time.Now()), addFinalizer("test-finalizer"))

resObjs := []client.Object{a}
subresObjs := []client.Object{a}
Expand Down
4 changes: 2 additions & 2 deletions controllers/argocd/keycloak_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestKeycloakContainerImage(t *testing.T) {
}),
updateCrFunc: nil,
templateAPIFound: true,
wantContainerImage: "registry.redhat.io/rh-sso-7/sso76-openshift-rhel8@sha256:ec9f60018694dcc5d431ba47d5536b761b71cb3f66684978fe6bb74c157679ac",
wantContainerImage: "registry.redhat.io/rh-sso-7/sso76-openshift-rhel8@sha256:720a7e4c4926c41c1219a90daaea3b971a3d0da5a152a96fed4fb544d80f52e3",
},
{
name: "ArgoCDKeycloakImageEnvVar env var set",
Expand Down Expand Up @@ -255,7 +255,7 @@ func TestNewKeycloakTemplate_testKeycloakContainer(t *testing.T) {
}
kc := getKeycloakContainer(a)
assert.Equal(t,
"registry.redhat.io/rh-sso-7/sso76-openshift-rhel8@sha256:ec9f60018694dcc5d431ba47d5536b761b71cb3f66684978fe6bb74c157679ac", kc.Image)
"registry.redhat.io/rh-sso-7/sso76-openshift-rhel8@sha256:720a7e4c4926c41c1219a90daaea3b971a3d0da5a152a96fed4fb544d80f52e3", kc.Image)
assert.Equal(t, corev1.PullAlways, kc.ImagePullPolicy)
assert.Equal(t, "${APPLICATION_NAME}", kc.Name)
}
Expand Down
3 changes: 1 addition & 2 deletions controllers/argocd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (

argoproj "github.com/argoproj-labs/argocd-operator/api/v1beta1"
"github.com/argoproj-labs/argocd-operator/pkg/argoutil"
"github.com/argoproj-labs/argocd-operator/pkg/workloads"
)

// reconcileStatus will ensure that all of the Status properties are updated for the given ArgoCD.
Expand Down Expand Up @@ -121,7 +120,7 @@ func (r *ReconcileArgoCD) reconcileStatusDex(cr *argoproj.ArgoCD) error {
func (r *ReconcileArgoCD) reconcileStatusKeycloak(cr *argoproj.ArgoCD) error {
status := "Unknown"

if workloads.IsTemplateAPIAvailable() {
if IsTemplateAPIAvailable() {
// keycloak is installed using OpenShift templates.
dc := &oappsv1.DeploymentConfig{
ObjectMeta: metav1.ObjectMeta{
Expand Down
2 changes: 1 addition & 1 deletion controllers/argocd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ func (r *ReconcileArgoCD) removeManagedByLabelFromNamespaces(namespace string) e

func argocdInstanceSelector(name string) (labels.Selector, error) {
selector := labels.NewSelector()
requirement, err := labels.NewRequirement(common.AppK8sKeyInstance, selection.Equals, []string{name})
requirement, err := labels.NewRequirement(common.ArgoCDKeyManagedBy, selection.Equals, []string{name})
if err != nil {
return nil, fmt.Errorf("failed to create a requirement for %w", err)
}
Expand Down

0 comments on commit 74235db

Please sign in to comment.