Skip to content

Commit

Permalink
merge main and resolve confilcts
Browse files Browse the repository at this point in the history
  • Loading branch information
djnakabaale committed Jan 24, 2024
2 parents ba4801a + 44c4ca2 commit abe9188
Show file tree
Hide file tree
Showing 4,218 changed files with 1,499,592 additions and 600 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
32 changes: 32 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
directory: "/"
schedule:
interval: "weekly"
groups:
ci-dependencies:
patterns:
- "*" # update all github-actions in single PR

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
target-branch: "main"

- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
groups:
k8s.io-dependencies:
patterns:
- "*k8s.io*"
54 changes: 54 additions & 0 deletions .github/workflows/build-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Publish Images

on:
push:
branches:
- 'main'
tags: # run on any tag that starts with `v` but not tags that end with `-downstream`
- 'v**'
- '!v**-downstream'

jobs:
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
# Get the repository's code
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
quay.io/project-koku/koku-metrics-operator
tags: |
type=semver,pattern={{raw}}
type=sha,prefix=,enable=${{ github.ref_type == 'tag' }}
# set latest tag for default branch
type=raw,value=latest
type=ref,event=branch
- name: Login to Quay.io
uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
provenance: false
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
18 changes: 9 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: golangci-lint
Expand All @@ -33,15 +33,15 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Display build environment
run: printenv

- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: go.mod

Expand All @@ -59,7 +59,7 @@ jobs:
go test ./... -v -coverprofile cover.out -covermode=atomic
- name: Upload test coverage file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage
path: cover.out
Expand All @@ -73,12 +73,12 @@ jobs:
- name: Checkout
# this checkout is required for the coverage report. If we don't do this, then
# the uploaded report is invalid and codecov doesn't know how to process it.
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download coverage result from unit-tests
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: coverage

Expand All @@ -99,12 +99,12 @@ jobs:
- name: Checkout
# this checkout is required for the coverage report. If we don't do this, then
# the uploaded report is invalid and codecov doesn't know how to process it.
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download coverage result from unit-tests
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: coverage

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ collector/test_files/test_reports/*
bundle/
community-operators-prod/
bundle.Dockerfile


# Ignore python virtual env
.venv/
22 changes: 6 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM registry.access.redhat.com/ubi8/go-toolset:1.19.10 AS builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} registry.access.redhat.com/ubi8/go-toolset:1.20.10-10 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand All @@ -10,30 +10,20 @@ WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we do not need to re-download as much
# and so that source changes do not invalidate our downloaded layer
RUN go mod download
COPY vendor/ vendor/

# Copy the go source
COPY main.go main.go
COPY cmd/ cmd/
COPY api/ api/
COPY clusterversion/ clusterversion/
COPY collector/ collector/
COPY controllers/ controllers/
COPY crhchttp/ crhchttp/
COPY dirconfig/ dirconfig/
COPY packaging/ packaging/
COPY sources/ sources/
COPY storage/ storage/
COPY strset/ strset/
COPY internal/ internal/

# Copy git to inject the commit during build
COPY .git .git
# Build
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
echo " injecting GIT COMMIT: $GIT_COMMIT" && \
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \
go build -ldflags "-w -s -X github.com/project-koku/koku-metrics-operator/controllers.GitCommit=$GIT_COMMIT" -a -o manager main.go
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} GOFLAGS=-mod=vendor \
go build -ldflags "-w -s -X github.com/project-koku/koku-metrics-operator/internal/controller.GitCommit=$GIT_COMMIT" -a -o manager cmd/main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
Loading

0 comments on commit abe9188

Please sign in to comment.