Skip to content

Commit

Permalink
Revert "Add unit tests for kopia repository server controller(PR #2) (#…
Browse files Browse the repository at this point in the history
…1997)" (#2178)

This reverts commit 6b1ceaa.
  • Loading branch information
PrasadG193 committed Jul 14, 2023
1 parent a66aec9 commit 5d16f29
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 563 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
# before running `make test`, to create some CRDs on the cluster.
- run: |
make install-csi-hostpath-driver
make install-minio
if: matrix.testSuite == 'test'
- run: make ${{ matrix.testSuite }}
build:
Expand Down
15 changes: 0 additions & 15 deletions build/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,6 @@ if [ -n "${ERRS}" ]; then
fi
echo

check_dependencies() {
# Check if minio is already deployed
if helm status minio -n minio > /dev/null 2>&1 ; then
# Setting env vars to access MinIO
export S3_COMPLIANT_AWS_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE"
export S3_COMPLIANT_AWS_SECRET_ACCESS_KEY="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
export S3_COMPLIANT_AWS_REGION="us-west-2"
export S3_COMPLIANT_LOCATION_ENDPOINT="http://minio.minio.svc.cluster.local:9000"
else
echo "Please install MinIO using 'make install-minio' and try again."
exit 1
fi
}

check_dependencies
echo "Running tests:"
go test -v -installsuffix "static" -i ${TARGETS}
go test -v ${TARGETS} -list .
Expand Down
9 changes: 3 additions & 6 deletions pkg/controllers/repositoryserver/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@ type RepoServerHandler struct {
}

func (h *RepoServerHandler) CreateOrUpdateOwnedResources(ctx context.Context) error {
if err := h.getSecretsFromCR(ctx); err != nil {
return errors.Wrap(err, "Failed to get Kopia API server secrets")
}

svc, err := h.reconcileService(ctx)
if err != nil {
return errors.Wrap(err, "Failed to reconcile service")
}

if err = h.getSecretsFromCR(ctx); err != nil {
return errors.Wrap(err, "Failed to get Kopia API server secrets")
}
envVars, pod, err := h.reconcilePod(ctx, svc)
if err != nil {
return errors.Wrap(err, "Failed to reconcile Kopia API server pod")
Expand Down Expand Up @@ -224,7 +222,6 @@ func (h *RepoServerHandler) updateServiceNameInPodLabels(pod *corev1.Pod, svc *c

func (h *RepoServerHandler) createPod(ctx context.Context, repoServerNamespace string, svc *corev1.Service) (*corev1.Pod, []corev1.EnvVar, error) {
podOverride, err := h.preparePodOverride(ctx)

if err != nil {
return nil, nil, err
}
Expand Down
73 changes: 0 additions & 73 deletions pkg/controllers/repositoryserver/repository_test.go

This file was deleted.

Loading

0 comments on commit 5d16f29

Please sign in to comment.