build: Remove redundant check. Pass tests on image build. Remove test execution on make file image build. (#970)

* Remove redudant check. Pass tests on image build. Remove test execution on make file image build.

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
pull/973/head
Oleksandr Andriienko 2021-07-28 16:34:44 +03:00 committed by GitHub
parent 8d90bb1419
commit ae276a4d2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 24 deletions

View File

@ -39,9 +39,13 @@ COPY controllers/ controllers/
COPY templates/ templates/
COPY pkg/ pkg/
COPY vendor/ vendor/
COPY mocks/ mocks/
COPY config/ config/
# build operator
RUN export ARCH="$(uname -m)" && if [[ ${ARCH} == "x86_64" ]]; then export ARCH="amd64"; elif [[ ${ARCH} == "aarch64" ]]; then export ARCH="arm64"; fi && \
export MOCK_API=true && \
go test -mod=vendor -v ./... && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -mod=vendor -a -o che-operator main.go
RUN unzip /tmp/asset-devworkspace-operator.zip */deploy/deployment/* -d /tmp && \

View File

@ -284,7 +284,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
IMAGE_TOOL=docker
docker-build: test ## Build docker image with the manager.
docker-build: ## Build docker image with the manager.
${IMAGE_TOOL} build -t ${IMG} .
docker-push: ## Push docker image with the manager.

View File

@ -110,19 +110,6 @@ var (
Package: "kubernetes-imagepuller-operator",
},
}
wrongSubscription = &operatorsv1alpha1.Subscription{
ObjectMeta: metav1.ObjectMeta{
Name: "kubernetes-imagepuller-operator",
Namespace: namespace,
},
Spec: &operatorsv1alpha1.SubscriptionSpec{
CatalogSource: "community-operators",
Channel: "beta",
CatalogSourceNamespace: "olm",
InstallPlanApproval: operatorsv1alpha1.ApprovalAutomatic,
Package: "kubernetes-imagepuller-operator",
},
}
valueTrue = true
clusterServiceVersion = &operatorsv1alpha1.ClusterServiceVersion{
ObjectMeta: metav1.ObjectMeta{
@ -654,16 +641,6 @@ func TestImagePullerConfiguration(t *testing.T) {
},
expectedSubscription: subscription,
},
{
name: "image puller enabled, subscription created but has changed, should update subscription, this shouldn't happen",
initCR: InitCheCRWithImagePullerEnabled(),
initObjects: []runtime.Object{
packageManifest,
operatorGroup,
wrongSubscription,
},
expectedSubscription: subscription,
},
{
name: "image puller enabled, subscription created, should add finalizer",
initCR: InitCheCRWithImagePullerEnabled(),