Skip to content

Commit

Permalink
Merge branch 'main' into ownership-metric
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvp8510 authored Mar 29, 2022
2 parents 9b6a8a1 + f904949 commit 613247a
Show file tree
Hide file tree
Showing 84 changed files with 2,657 additions and 419 deletions.
21 changes: 0 additions & 21 deletions .ci/install-gomplate.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .ci/install-kind.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .ci/install-kuttl.sh

This file was deleted.

4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ updates:
directory: "/"
schedule:
interval: daily
time: "03:00"
timezone: "Europe/Berlin"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "03:00"
timezone: "Europe/Berlin"
10 changes: 6 additions & 4 deletions .github/workflows/base-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ on:
jobs:
basic-checks:
runs-on: ubuntu-20.04
env:
USER: jaegertracing
steps:
- name: Set up Go
uses: actions/setup-go@v2.2.0
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: "install kubebuilder"
run: ./hack/install-kubebuilder.sh
run: ./hack/install/install-kubebuilder.sh

- name: "install kustomize"
run: ./hack/install-kustomize.sh
run: ./hack/install/install-kustomize.sh

- name: "basic checks"
run: make install-tools ci
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/e2e-smoke.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/publish-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
env:
USER: jaegertracing
steps:
- uses: actions/checkout@v3
- uses: docker/[email protected]
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ on:
jobs:
unit-tests:
runs-on: ubuntu-20.04
env:
USER: jaegertracing
steps:
- name: Set up Go
uses: actions/setup-go@v2.2.0
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.17

- uses: actions/checkout@v3

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sdk-scorecard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- name: "Check out code"
uses: actions/checkout@v3
- name: "Install KIND"
run: ./.ci/install-kind.sh
run: ./hack/install/install-kind.sh
- name: "Install KUTTL"
run: ./.ci/install-kuttl.sh
run: ./hack/install/install-kuttl.sh
- name: "Run Operator-SDK scorecard test"
env:
DOCKER_BUILD_OPTIONS: "--cache-from type=local,src=/tmp/.buildx-cache --cache-to type=local,dest=/tmp/.buildx-cache-new,mode=max --load"
Expand Down
19 changes: 16 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.16 as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down Expand Up @@ -32,9 +32,22 @@ ARG TARGETARCH
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on go build -ldflags="-X ${VERSION_PKG}.version=${VERSION} -X ${VERSION_PKG}.buildDate=${VERSION_DATE} -X ${VERSION_PKG}.defaultJaeger=${JAEGER_VERSION}" -a -o jaeger-operator main.go

FROM gcr.io/distroless/static:nonroot
FROM registry.access.redhat.com/ubi8/ubi

ENV USER_UID=1001 \
USER_NAME=jaeger-operator

RUN INSTALL_PKGS="openssl" && \
yum install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all && \
mkdir /tmp/_working_dir && \
chmod og+w /tmp/_working_dir

WORKDIR /
COPY --from=builder /workspace/jaeger-operator .
USER 65532:65532
COPY scripts/cert_generation.sh scripts/cert_generation.sh

USER ${USER_UID}:${USER_UID}

ENTRYPOINT ["/jaeger-operator"]
6 changes: 4 additions & 2 deletions Dockerfile.asserts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.16 as builder
FROM golang:1.17 as builder

WORKDIR /workspace

Expand All @@ -20,7 +20,9 @@ RUN go build -o ./reporter -a ./tests/assert-jobs/reporter/main.go
RUN go build -o ./query -a ./tests/assert-jobs/query/main.go
RUN go build -o ./index -a ./tests/assert-jobs/index/main.go

FROM golang:1.16
# Use the curl container image to ensure we have curl installed. Also, it is a
# minimal container image
FROM curlimages/curl:7.81.0
WORKDIR /
COPY --from=builder /workspace/uiconfig .
COPY --from=builder /workspace/reporter .
Expand Down
77 changes: 30 additions & 47 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ GOROOT ?= "$(shell go env GOROOT)"
ECHO ?= @echo $(echo_prefix)
SED ?= "sed"
CERTMANAGER_VERSION ?= 1.6.1
OPERATOR_SDK_VERSION ?= 1.13.1
OPERATOR_SDK_VERSION ?= 1.17.0

USE_KIND_CLUSTER ?= true
export OLM ?= false
Expand Down Expand Up @@ -77,7 +77,7 @@ endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false,maxDescLen=0,generateEmbeddedObjectMeta=true"
CRD_OPTIONS ?= "crd:maxDescLen=0,generateEmbeddedObjectMeta=true"

# If we are running in CI, run go test in verbose mode
ifeq (,$(CI))
Expand All @@ -95,7 +95,6 @@ check:
$(VECHO)[ ! -s "$(FMT_LOG)" ] || (echo "Go fmt, license check, or import ordering failures, run 'make format'" | cat - $(FMT_LOG) && false)

ensure-generate-is-noop: VERSION=$(OPERATOR_VERSION)
ensure-generate-is-noop: USER=jaegertracing
ensure-generate-is-noop: set-image-controller generate bundle
$(VECHO)# on make bundle config/manager/kustomization.yaml includes changes, which should be ignored for the below check
$(VECHO)git restore config/manager/kustomization.yaml
Expand Down Expand Up @@ -273,7 +272,7 @@ else
endif

.PHONY: clean
clean: undeploy-kafka undeploy-es-operator undeploy-prometheus-operator undeploy-istio
clean: undeploy-kafka undeploy-prometheus-operator undeploy-istio
$(VECHO)kubectl delete namespace $(KAFKA_NAMESPACE) --ignore-not-found=true 2>&1 || true
$(VECHO)if [ -d tests/_build ]; then rm -rf tests/_build ; fi
$(VECHO)kubectl delete -f ./tests/cassandra.yml --ignore-not-found=true -n $(STORAGE_NAMESPACE) || true
Expand All @@ -296,13 +295,19 @@ all: check format lint security build test
.PHONY: ci
ci: ensure-generate-is-noop check format lint security build unit-tests

##@ Deployment

ifndef ignore-not-found
ignore-not-found = false
endif

.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl apply -f -

.PHONY: uninstall
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl delete -f -
$(KUSTOMIZE) build config/crd | kubectl delete -ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
Expand All @@ -311,7 +316,7 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -
$(KUSTOMIZE) build config/default | kubectl delete -ignore-not-found=$(ignore-not-found) -f -

.PHONY: operatorhub
operatorhub: check-operatorhub-pr-template
Expand All @@ -325,16 +330,12 @@ check-operatorhub-pr-template:
.PHONY: changelog
changelog:
$(ECHO) "Set env variable OAUTH_TOKEN before invoking, https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token"
$(VECHO)docker run --rm -v "${PWD}:/app" pavolloffay/gch:latest --oauth-token ${OAUTH_TOKEN} --owner jaegertracing --repo jaeger-operator
$(VECHO)docker run --rm -v "${PWD}:/app" pavolloffay/gch:latest --oauth-token ${OAUTH_TOKEN} --branch main --owner jaegertracing --repo jaeger-operator


CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/[email protected])
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])

ENVTEST = $(shell pwd)/bin/setup-envtest
envtest: ## Download envtest-setup locally if necessary.
Expand Down Expand Up @@ -367,7 +368,7 @@ bundle-build: ## Build the bundle image.

.PHONY: bundle-push
bundle-push: ## Push the bundle image.
$(MAKE) docker-push IMG=$(BUNDLE_IMG)
docker push $(BUNDLE_IMG)

.PHONY: opm
OPM = ./bin/opm
Expand Down Expand Up @@ -442,43 +443,11 @@ release-artifacts: set-image-controller
mkdir -p dist
$(KUSTOMIZE) build config/default -o dist/jaeger-operator.yaml


kuttl:
ifeq (, $(shell which kubectl-kuttl))
echo ${PATH}
ls -l /usr/local/bin
which kubectl-kuttl

@{ \
set -e ;\
echo "" ;\
echo "ERROR: kuttl not found." ;\
echo "Please check https://kuttl.dev/docs/cli.html for installation instructions and try again." ;\
echo "" ;\
exit 1 ;\
}
else
KUTTL=$(shell which kubectl-kuttl)
endif

# Set the controller image parameters
set-image-controller: manifests kustomize
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}

kind:
ifeq (, $(shell which kind))
@{ \
set -e ;\
echo "" ;\
echo "ERROR: KIND not found." ;\
echo "Please check https://kind.sigs.k8s.io/docs/user/quick-start/#installation for installation instructions and try again." ;\
echo "" ;\
exit 1 ;\
}
else
KIND=$(shell which kind)
endif

.PHONY: tools
tools: kustomize controller-gen operator-sdk

.PHONY: install-tools
Expand All @@ -487,7 +456,21 @@ install-tools: operator-sdk
golang.org/x/lint/golint \
golang.org/x/tools/cmd/goimports \
github.com/securego/gosec/cmd/[email protected]
$(VECHO)./.ci/install-gomplate.sh

.PHONY: kustomize
kustomize:
./hack/install/install-kustomize.sh
$(eval KUSTOMIZE=$(shell echo ${PWD}/bin/kustomize))

.PHONY: kuttl
kuttl:
./hack/install/install-kuttl.sh
$(eval KUTTL=$(shell echo ${PWD}/bin/kubectl-kuttl))

.PHONY: kind
kind:
./hack/install/install-kind.sh
$(eval KIND=$(shell echo ${PWD}/bin/kind))

.PHONY: prepare-release
prepare-release:
Expand Down
Loading

0 comments on commit 613247a

Please sign in to comment.