Skip to content

Commit

Permalink
Merge pull request #140 from equinor/master
Browse files Browse the repository at this point in the history
Release radix-cost-allocation
  • Loading branch information
nilsgstrabo authored Dec 16, 2024
2 parents b99c0ee + c2b2c78 commit 5cd8db5
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: "playground"
ref: "refs/heads/release"
acr-name: "radixdev"
acr-name: "radixplayground"
client-id: "4b607a0a-b4f7-4918-8586-0f1ee8a69d5b"
subscription-id: "16ede44b-1f74-40a5-b428-46cca9a5741b"

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createSchema.sql'
arguments: '-v RADIX_ZONE=${{matrix.target.name}}'

- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM docker.io/golang:1.22-alpine3.20 AS builder
FROM --platform=$BUILDPLATFORM docker.io/golang:1.22-alpine3.20 AS builder

ARG TARGETARCH

ENV CGO_ENABLED=0 \
GOOS=linux
GOOS=linux \
GOARCH=$TARGETARCH

WORKDIR /src

Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ VERSION=latest
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
IMAGE_NAME=$(DOCKER_REGISTRY)/radix-cost-allocation:$(BRANCH)-$(VERSION)

.PHONY: build
build:
docker build -t $(IMAGE_NAME) .

push:
.PHONY: push
push: build
az acr login -n $(DOCKER_REGISTRY)
docker push $(IMAGE_NAME)

.PHONY: pushmultiplatform
pushmultiplatform:
az acr login -n $(DOCKER_REGISTRY)
docker buildx build --platform=linux/amd64,linux/arm64 -t $(IMAGE_NAME) --push .

.PHONY: test
test:
go test -cover `go list ./...`
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![build workflow](https://github.com/equinor/radix-cost-allocation/actions/workflows/build-push.yml/badge.svg)
![build workflow](https://github.com/equinor/radix-cost-allocation/actions/workflows/build-push.yml/badge.svg) [![SCM Compliance](https://scm-compliance-api.radix.equinor.com/repos/equinor/radix-cost-allocation/badge)](https://developer.equinor.com/governance/scm-policy/)

# RADIX-COST-ALLOCATION

Expand All @@ -12,12 +12,6 @@ We use arm template and github action to create azure resources
The SQL Server database and objects are deployed on push to master and release branch.
All SQL scripts on azure-infrastructure must be idempotent.

Note: The Github Workflow is not allowed to create new external users, so you must run it locally. Se more here: https://github.com/equinor/radix-vulnerability-scanner/issues/54
Workaround:
```sh
sqlcmd -S ${SERVER_NAME}.database.windows.net -d ${DATABASE_NAME} -G --variables RADIX_ZONE=${RADIX_ZONE} -i createSchema.sql
```

## Deploy to cluster

Installation on cluster is handled by flux through [flux repo](https://github.com/equinor/radix-flux).
Expand Down
4 changes: 2 additions & 2 deletions charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: radix-cost-allocation
description: Pull cost data from containers and push to sql server
kubeVersion: ">=1.24.0"
appVersion: 1.1.1
version: 1.2.1
appVersion: 1.2.2
version: 1.2.2
sources:
- https://github.com/equinor/radix-cost-allocation
maintainers:
Expand Down
85 changes: 44 additions & 41 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,41 @@ go 1.22.0
toolchain go1.22.5

require (
github.com/equinor/radix-operator v1.57.1
github.com/equinor/radix-operator v1.68.1
github.com/golang/mock v1.6.0
github.com/microsoft/go-mssqldb v1.7.2
github.com/microsoft/go-mssqldb v1.8.0
github.com/pkg/errors v0.9.1
github.com/robfig/cron/v3 v3.0.1
github.com/rs/zerolog v1.33.0
github.com/stretchr/testify v1.9.0
github.com/vrischmann/envconfig v1.3.0
golang.org/x/sync v0.7.0
k8s.io/api v0.30.1
k8s.io/apimachinery v0.30.1
k8s.io/client-go v0.30.1
golang.org/x/sync v0.10.0
k8s.io/api v0.31.0
k8s.io/apimachinery v0.31.0
k8s.io/client-go v0.31.0
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/equinor/radix-common v1.9.2 // indirect
github.com/evanphx/json-patch v5.8.1+incompatible // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/equinor/radix-common v1.9.4 // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/expr-lang/expr v1.15.8 // indirect
github.com/expr-lang/expr v1.16.9 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.7 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand All @@ -51,7 +51,8 @@ require (
github.com/imdario/mergo v0.3.16 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kedacore/keda/v2 v2.13.1 // indirect
github.com/kedacore/keda/v2 v2.15.1 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand All @@ -61,32 +62,34 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/client_golang v1.20.2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/oauth2 v0.19.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.6.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
knative.dev/pkg v0.0.0-20240116073220-b488e7be5902 // indirect
sigs.k8s.io/controller-runtime v0.18.2 // indirect
k8s.io/apiextensions-apiserver v0.31.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240808142205-8e686545bdb8 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
knative.dev/pkg v0.0.0-20240805063731-c88d5dad9653 // indirect
sigs.k8s.io/controller-runtime v0.19.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/secrets-store-csi-driver v1.4.0 // indirect
sigs.k8s.io/secrets-store-csi-driver v1.4.5 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit 5cd8db5

Please sign in to comment.