Skip to content

Commit

Permalink
Merge pull request #382 from ispeakc0de/v1.13.x-tracker
Browse files Browse the repository at this point in the history
[cheerypick for 2.0.0-RC-1]
  • Loading branch information
Shubham Chaudhary authored Aug 5, 2021
2 parents dc559cf + 1234c30 commit a3e7148
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: build-pipeline
on:
pull_request:
branches: [v1.13.x]
branches: [v2.0.x]
types: [opened, synchronize, reopened]

jobs:
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
IS_DOCKER_INSTALLED = $(shell which docker >> /dev/null 2>&1; echo $$?)

# docker info
DOCKER_REGISTRY ?= docker.io
DOCKER_REPO ?= litmuschaos
DOCKER_IMAGE ?= chaos-operator
DOCKER_TAG ?= ci
Expand Down Expand Up @@ -73,18 +74,18 @@ build-chaos-operator:
@echo "-------------------------"
@echo "--> Build go-runner image"
@echo "-------------------------"
@docker buildx build --file build/Dockerfile --progress plane --no-cache --platform linux/arm64,linux/amd64 --tag $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) .
@docker buildx build --file build/Dockerfile --progress plane --no-cache --platform linux/arm64,linux/amd64 --tag $(DOCKER_REGISTRY)/$(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) .

.PHONY: push-chaos-operator
push-chaos-operator:
@echo "------------------------------"
@echo "--> Pushing image"
@echo "------------------------------"
@docker buildx build --file build/Dockerfile --progress plane --no-cache --push --platform linux/arm64,linux/amd64 --tag $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) .
@docker buildx build --file build/Dockerfile --progress plane --no-cache --push --platform linux/arm64,linux/amd64 --tag $(DOCKER_REGISTRY)/$(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) .

.PHONY: build-amd64
build-amd64:
@echo "-------------------------"
@echo "--> Build go-runner image"
@echo "-------------------------"
@docker build -f build/Dockerfile --no-cache -t $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) . --build-arg TARGETPLATFORM="linux/amd64"
@docker build -f build/Dockerfile --no-cache -t $(DOCKER_REGISTRY)/$(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG) . --build-arg TARGETPLATFORM="linux/amd64"
4 changes: 4 additions & 0 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: OPERATOR_NAME
value: "chaos-operator"
15 changes: 9 additions & 6 deletions pkg/controller/chaosengine/chaosengine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,12 +761,15 @@ func (r *ReconcileChaosEngine) updateChaosStatus(engine *chaosTypes.EngineInfo,
return err
}

found, err := isResultCRDAvailable()
if err != nil {
return err
}
if !found {
return nil
// skipping CRD validation for the namespace scoped operator
if os.Getenv("WATCH_NAMESPACE") == "" {
found, err := isResultCRDAvailable()
if err != nil {
return err
}
if !found {
return nil
}
}
return r.updatChaosResult(engine, request)
}
Expand Down

0 comments on commit a3e7148

Please sign in to comment.