Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RELATED_IMAGE_AUTHORINO env var #229

Merged
merged 2 commits into from
Nov 14, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ metadata:
capabilities: Basic Install
categories: Integration & Delivery
containerImage: quay.io/kuadrant/authorino-operator:latest
createdAt: "2024-10-30T16:22:39Z"
createdAt: "2024-11-14T11:17:40Z"
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/Kuadrant/authorino-operator
Expand Down Expand Up @@ -320,6 +320,9 @@ spec:
- --leader-elect
command:
- /manager
env:
- name: RELATED_IMAGE_AUTHORINO
value: quay.io/kuadrant/authorino:latest
image: quay.io/kuadrant/authorino-operator:latest
livenessProbe:
httpGet:
Expand Down Expand Up @@ -422,4 +425,7 @@ spec:
minKubeVersion: 1.25.0
provider:
name: Red Hat
relatedImages:
- image: quay.io/kuadrant/authorino:latest
name: authorino
version: 0.0.0
3 changes: 3 additions & 0 deletions charts/authorino-operator/templates/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5897,6 +5897,9 @@ spec:
- --leader-elect
command:
- /manager
env:
- name: RELATED_IMAGE_AUTHORINO
value: quay.io/kuadrant/authorino:latest
image: quay.io/kuadrant/authorino-operator:latest
livenessProbe:
httpGet:
Expand Down
3 changes: 3 additions & 0 deletions config/deploy/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5904,6 +5904,9 @@ spec:
- --leader-elect
command:
- /manager
env:
- name: RELATED_IMAGE_AUTHORINO
value: quay.io/kuadrant/authorino:latest
image: quay.io/kuadrant/authorino-operator:latest
livenessProbe:
httpGet:
Expand Down
3 changes: 3 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ spec:
containers:
- command:
- /manager
env:
- name: RELATED_IMAGE_AUTHORINO
value: quay.io/kuadrant/authorino:latest
args:
- --leader-elect
image: controller:latest
Expand Down
14 changes: 10 additions & 4 deletions controllers/authorino_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/env"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

Expand Down Expand Up @@ -191,8 +192,15 @@ func (r *AuthorinoReconciler) buildAuthorinoDeployment(authorino *api.Authorino)
var containers []k8score.Container
var saName = authorino.Name + "-authorino"

if authorino.Spec.Image == "" {
authorino.Spec.Image = DefaultAuthorinoImage
image := authorino.Spec.Image

if image == "" {
image = env.GetString("RELATED_IMAGE_AUTHORINO", DefaultAuthorinoImage)
}

if image == "" {
// `DefaultAuthorinoImage can be empty string. But image cannot be or deployment will fail
panic("DefaultAuthorinoImage is empty")
}

var volumes []k8score.Volume
Expand Down Expand Up @@ -259,8 +267,6 @@ func (r *AuthorinoReconciler) buildAuthorinoDeployment(authorino *api.Authorino)
volumes = append(volumes, authorinoResources.GetTlsVolume(authorinoOidcTlsCertVolumeName, secretName))
}

image := authorino.Spec.Image

args := r.buildAuthorinoArgs(authorino)
var envs []k8score.EnvVar

Expand Down
Loading