Skip to content

Commit

Permalink
Update jsonnet lockfiles for new location of obs/deployments (#63)
Browse files Browse the repository at this point in the history
* Update jsonnet lockfiles for new location of obs/deployments

* Add vendor directory to gitignore

* Fix CI

* Update e2e test with new location

* Update subdir

* Switch to main branch for obs/obs
  • Loading branch information
onprem authored May 20, 2021
1 parent 08f589b commit 78fff4b
Show file tree
Hide file tree
Showing 265 changed files with 57 additions and 14,132 deletions.
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ jobs:
- run: git diff --exit-code

test:
machine: true
machine:
image: ubuntu-2004:202101-01
steps:
- checkout
- run: make jsonnet-vendor
- run:
name: e2e tests with operator
no_output_timeout: 30m
Expand All @@ -26,9 +28,10 @@ jobs:

container-push:
machine:
image: ubuntu-1604:201903-01
image: ubuntu-2004:202101-01
steps:
- checkout
- run: make jsonnet-vendor
- run: |
echo "$DOCKER_PASS" | docker login quay.io --username $DOCKER_USER --password-stdin
make container-push
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/kind
/kubectl
/tmp/
vendor
jsonnet/vendor
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apk add --update --no-cache git bash
WORKDIR /workspace
# Copy the jsonnet source
COPY . operator/
COPY ./jsonnet/vendor/github.com/observatorium/deployments/components/ components/
COPY ./jsonnet/vendor/github.com/observatorium/observatorium/configuration/components/ components/

# Build
WORKDIR /workspace/operator
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jsonnet-update: $(JB)
cd jsonnet; $(JB) update

jsonnet-update-deployments: $(JB)
cd jsonnet; $(JB) update github.com/observatorium/deployments
cd jsonnet; $(JB) update github.com/observatorium/observatorium

JSONNET_SRC = $(shell find . -type f -not -path './*vendor/*' \( -name '*.libsonnet' -o -name '*.jsonnet' \))
JSONNETFMT_CMD := $(JSONNETFMT) -n 2 --max-blank-lines 2 --string-style s --comment-style s
Expand Down
2 changes: 1 addition & 1 deletion example/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,6 @@ local dex = (import 'github.com/observatorium/deployments/components/dex.libsonn
securityContext: {
fsGroup: 65534,
runAsUser: 65534,
}
},
},
}
6 changes: 3 additions & 3 deletions jsonnet/jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
{
"source": {
"git": {
"remote": "https://github.com/observatorium/deployments.git",
"subdir": ""
"remote": "https://github.com/observatorium/observatorium.git",
"subdir": "configuration"
}
},
"version": "master"
"version": "main"
}
],
"legacyImports": true
Expand Down
22 changes: 11 additions & 11 deletions jsonnet/jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
{
"source": {
"git": {
"remote": "https://github.com/observatorium/deployments.git",
"subdir": ""
"remote": "https://github.com/observatorium/api.git",
"subdir": "jsonnet/lib"
}
},
"version": "00f27529b8943ec3ef4627c4fb514fea46508c79",
"sum": "PJ3Xq7RBx7DjhkwmEJZHxg3swqFMXscwiYvJTP4Nj/Q="
"version": "cbff1da9ba9371516a6254db359ae33545aefdf7",
"sum": "Z86CgnoTybhpdQKWc2ptURmps1d9Qxhec0/IK6v71kY=",
"name": "observatorium-api"
},
{
"source": {
"git": {
"remote": "https://github.com/observatorium/observatorium.git",
"subdir": "jsonnet/lib"
"subdir": "configuration"
}
},
"version": "937be40bc3199cc43ba0bcb2f5c2b8cc5b21cb0f",
"sum": "Z86CgnoTybhpdQKWc2ptURmps1d9Qxhec0/IK6v71kY=",
"name": "observatorium"
"version": "8f5144ea1f8d86bce5e0b5ab7186f2b882f544dd",
"sum": "JJw7XVf0i3iBxjHrs/AgMQCVdNQgT6RlETcgVdSYUuk="
},
{
"source": {
Expand All @@ -29,7 +29,7 @@
"subdir": "jsonnet/lib"
}
},
"version": "eb1b3c72615a3667babf6d4cbd091907c1b933f9",
"version": "ee165b6944c6e6c4453ec7497002244d1714c075",
"sum": "YEWIBzg8kVPUvvrED81YCpK+HeDNc3UMaDnEefEh8ME=",
"name": "thanos-receive-controller"
},
Expand All @@ -51,8 +51,8 @@
"subdir": "jsonnet/kube-thanos"
}
},
"version": "2ca480f61556c8ded05fe91f66cd33cde8ec968b",
"sum": "gGfheORoXWmXv2Sd+6xrvKmXFTxnXWpunnpLS0JAYJA="
"version": "f53ad9856c6f765989ea76ba8eff8dd1e77186b7",
"sum": "1wMHM/+NvluUAxS5cBW2c6APEKQNQYLYnv1ZCE1R3/A="
}
],
"legacyImports": false
Expand Down
34 changes: 17 additions & 17 deletions jsonnet/obs-operator.jsonnet
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
local cr = import 'generic-operator/config';
local thanos = (import 'github.com/observatorium/deployments/components/thanos.libsonnet');
local loki = (import 'github.com/observatorium/deployments/components/loki.libsonnet');
local api = (import 'github.com/observatorium/observatorium/jsonnet/lib/observatorium-api.libsonnet');
local obs = (import 'github.com/observatorium/deployments/components/observatorium.libsonnet');
local thanos = (import 'github.com/observatorium/observatorium/configuration/components/thanos.libsonnet');
local loki = (import 'github.com/observatorium/observatorium/configuration/components/loki.libsonnet');
local api = (import 'github.com/observatorium/api/jsonnet/lib/observatorium-api.libsonnet');
local obs = (import 'github.com/observatorium/observatorium/configuration/components/observatorium.libsonnet');

local operatorObs = obs {

Expand Down Expand Up @@ -39,11 +39,11 @@ local operatorObs = obs {
securityContext: if std.objectHas(cr.spec, 'securityContext') then cr.spec.securityContext else obs.thanos.storeCache.config.securityContext,
resources+: (
if std.objectHas(cr.spec.store.cache, 'resources') then {
memcached: cr.spec.store.cache.resources
memcached: cr.spec.store.cache.resources,
} else {}
) + (
if std.objectHas(cr.spec.store.cache, 'exporterResources') then {
exporter: cr.spec.store.cache.exporterResources
exporter: cr.spec.store.cache.exporterResources,
} else {}
),
},
Expand All @@ -58,18 +58,18 @@ local operatorObs = obs {

queryFrontendCache+:: {
securityContext: if std.objectHas(cr.spec, 'securityContext') then cr.spec.securityContext else obs.thanos.queryFrontendCache.config.securityContext,
}
},
}),

loki:: if std.objectHas(cr.spec, 'loki') then loki(obs.loki.config {
local cfg = self,
name: cr.metadata.name + '-' + cfg.commonLabels['app.kubernetes.io/name'],
namespace: cr.metadata.namespace,
image: if std.objectHas(cr.spec.loki, 'image') then cr.spec.loki.image else obs.loki.config.image,
replicas: if std.objectHas(cr.spec.loki, 'replicas') then cr.spec.loki.replicas else obs.loki.config.replicas,
version: if std.objectHas(cr.spec.loki, 'version') then cr.spec.loki.version else obs.loki.config.version,
objectStorageConfig: if cr.spec.objectStorageConfig.loki != null then cr.spec.objectStorageConfig.loki else obs.loki.config.objectStorageConfig,
}) else {},
local cfg = self,
name: cr.metadata.name + '-' + cfg.commonLabels['app.kubernetes.io/name'],
namespace: cr.metadata.namespace,
image: if std.objectHas(cr.spec.loki, 'image') then cr.spec.loki.image else obs.loki.config.image,
replicas: if std.objectHas(cr.spec.loki, 'replicas') then cr.spec.loki.replicas else obs.loki.config.replicas,
version: if std.objectHas(cr.spec.loki, 'version') then cr.spec.loki.version else obs.loki.config.version,
objectStorageConfig: if cr.spec.objectStorageConfig.loki != null then cr.spec.objectStorageConfig.loki else obs.loki.config.objectStorageConfig,
}) else {},

gubernator:: {},

Expand Down Expand Up @@ -144,15 +144,15 @@ local operatorObs = obs {
) + (
if (std.objectHas(obs.config, 'tolerations') && (v.kind == 'StatefulSet' || v.kind == 'Deployment')) then {
template+: {
spec+:{
spec+: {
tolerations: obs.config.tolerations,
},
},
} else {}
) + (
if (std.objectHas(cr.spec.rule, 'reloaderResources') && (v.kind == 'StatefulSet') && v.metadata.name == obs.config.name + '-thanos-rule') then {
template+: {
spec+:{
spec+: {
containers: [
if c.name == 'configmap-reloader' then c {
resources: cr.spec.rule.reloaderResources,
Expand Down
1 change: 0 additions & 1 deletion jsonnet/vendor/deployments

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 78fff4b

Please sign in to comment.