Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@
meta = read_json('nix/meta.json')
operator_name = meta['operator']['name']

# If tilt_options.json exists read it and load the default_registry and default_repository value from it
# If tilt_options.json exists read it and load the default_registry, default_operator_repository,
# and default_product_repository value from it
settings = read_json('tilt_options.json', default={})
registry = settings.get('default_registry', 'oci.stackable.tech')
repository = settings.get('default_repository', registry + '/' + 'sdp')
operator_image_name = repository + '/' + operator_name

# Configure default registry either read from config file above, or with default value of "oci.stackable.tech"
# Construct the operator image repository. It uses the "sandbox" instead of the "sdp" namespace to
# separate "testing/local" images from official (published) images.
operator_repository = settings.get('default_operator_repository', registry + '/' + 'sandbox')
operator_image_name = operator_repository + '/' + operator_name

# For the product image, we wanna use the images in the "sdp" namespace, because "sandbox" doesn't
# contain those images (by default).
product_repository = settings.get('default_product_repository', registry + '/' + 'sdp')

# Configure default registry either read from config file above, or with default value of
# "oci.stackable.tech"
default_registry(registry)

custom_build(
Expand All @@ -31,14 +40,16 @@ k8s_kind('DaemonSet', image_json_path='{.spec.template.metadata.annotations.inte
# supported by helm(set).
helm_values = settings.get('helm_values', None)

helm_override_image_repository = 'image.repository=' + repository
helm_override_operator_image_repository = 'image.repository=' + operator_repository
helm_override_product_image_repository = 'image.productRepository=' + product_repository

k8s_yaml(helm(
'deploy/helm/' + operator_name,
name=operator_name,
namespace="stackable-operators",
set=[
helm_override_image_repository,
helm_override_operator_image_repository,
helm_override_product_image_repository,
],
values=helm_values,
))
2 changes: 1 addition & 1 deletion deploy/helm/commons-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ helm.sh/test: {{ include "operator.chart" . }}
{{- end }}

{{/*
Build the full container image reference.
Build the full operator container image reference.
*/}}
{{- define "operator.image" -}}
{{- printf "%s/%s:%s" .Values.image.repository .Chart.Name (.Values.image.tag | default .Chart.AppVersion) -}}
Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/commons-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ spec:
- name: OPERATOR_SERVICE_NAME
value: {{ include "operator.fullname" . }}

# The image repository, like "oci.stackable.tech/sdp"
# The product image repository, like "oci.stackable.tech/sdp".
- name: IMAGE_REPOSITORY
value: {{ .Values.image.repository }}
value: {{ .Values.image.productRepository | default .Values.image.repository }}

# Operators need to know the node name they are running on, to e.g. discover the
# Kubernetes domain name from the kubelet API.
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ARG STACKABLE_USER_NAME="stackable"
# "-c": Allows the execution of commands passed as a string
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

# These labels have mostly been superceded by the OpenContainer spec annotations below but it doesn't hurt to include them
# These labels have mostly been superseded by the OpenContainer spec annotations below but it doesn't hurt to include them
# http://label-schema.org/rc1/
LABEL name="Stackable Operator for Stackable Commons"
LABEL maintainer="info@stackable.tech"
Expand Down
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file includes unstable features, so you need to run "cargo +nightly fmt" to format your code.
# It's also ok to use the stable toolchain by simple running "cargo fmt", but using the nigthly formatter is prefered.
# It's also ok to use the stable toolchain by simple running "cargo fmt", but using the nightly formatter is preferred.

# https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rustfmt-style-edition.html
style_edition = "2024"
Expand Down
Loading