Skip to content

Commit 7386fd6

Browse files
authored
allign backend image flags with konnector ones (#530)
1 parent 726e73e commit 7386fd6

4 files changed

Lines changed: 24 additions & 25 deletions

File tree

cli/pkg/kubectl/dev/plugin/create.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ type DevOptions struct {
6060
Logs *logs.Options
6161
Streams genericclioptions.IOStreams
6262

63-
Image string
64-
Tag string
63+
BackendImage string
64+
BackendTag string
6565
ProviderClusterName string
6666
ConsumerClusterName string
6767
WaitForReadyTimeout time.Duration
@@ -102,16 +102,16 @@ func (o *DevOptions) AddCmdFlags(cmd *cobra.Command) {
102102
cmd.Flags().DurationVar(&o.WaitForReadyTimeout, "wait-for-ready-timeout", 2*time.Minute, "Timeout for waiting for the cluster to be ready")
103103
cmd.Flags().StringVar(&o.ChartPath, "chart-path", o.ChartPath, "Helm chart path or OCI registry URL")
104104
cmd.Flags().StringVar(&o.ChartVersion, "chart-version", o.ChartVersion, "The version of the Helm chart to use")
105-
cmd.Flags().StringVar(&o.Image, "image", "ghcr.io/kube-bind/backend", "The name of kube-bind backend to use in dev mode")
106-
cmd.Flags().StringVar(&o.Tag, "tag", "", "The tag of the kube-bind backend image to use in dev mode")
105+
cmd.Flags().StringVar(&o.BackendImage, "backend-image", "ghcr.io/kube-bind/backend", "The name of kube-bind backend to use in dev mode")
106+
cmd.Flags().StringVar(&o.BackendTag, "backend-tag", "", "The tag of the kube-bind backend image to use in dev mode")
107107
cmd.Flags().StringVar(&o.KindNetwork, "kind-network", "kube-bind-dev", "The name of the kind network to use in dev mode")
108108
}
109109

110110
// Complete completes the options
111111
func (o *DevOptions) Complete(args []string) error {
112112
// Only fetch the latest version if tag is not set
113113
var assetVersion string
114-
if o.Tag == "" {
114+
if o.BackendTag == "" {
115115
version, err := fetchLatestRelease()
116116
if err != nil {
117117
// Log the error but continue with fallback version
@@ -125,8 +125,8 @@ func (o *DevOptions) Complete(args []string) error {
125125
if o.ChartVersion == "" || o.ChartVersion == fallbackAssetVersion {
126126
o.ChartVersion = assetVersion
127127
}
128-
if o.Tag == "" || o.Tag == "v"+fallbackAssetVersion {
129-
o.Tag = "v" + assetVersion
128+
if o.BackendTag == "" || o.BackendTag == "v"+fallbackAssetVersion {
129+
o.BackendTag = "v" + assetVersion
130130
}
131131
}
132132

@@ -391,14 +391,14 @@ func (o *DevOptions) installHelmChart(_ context.Context, restConfig *rest.Config
391391
actionConfig.RegistryClient = registryClient
392392

393393
values := map[string]any{
394-
"image": map[string]any{
395-
"repository": o.Image,
396-
"tag": o.Tag,
397-
},
398394
"examples": map[string]any{
399395
"enabled": true,
400396
},
401397
"backend": map[string]any{
398+
"image": map[string]any{
399+
"repository": o.BackendImage,
400+
"tag": o.BackendTag,
401+
},
402402
"listenAddress": "0.0.0.0:8080",
403403
"namespacePrefix": "kube-bind-",
404404
"externalAddress": "https://kube-bind.dev.local:6443",

deploy/charts/backend/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ See [values.yaml](values.yaml) for the full list of configurable parameters.
3434
| backend.externalServerName | string | `""` | External server name for TLS SNI |
3535
| backend.extraArgs | list | `[]` | Extra command-line arguments to pass to the backend |
3636
| backend.frontendDisabled | bool | `false` | Disable the frontend UI |
37+
| backend.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
38+
| backend.image.repository | string | `"ghcr.io/kube-bind/backend"` | Image repository |
39+
| backend.image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion |
3740
| backend.kubeconfig | string | `""` | Path to a kubeconfig file. Only required if out-of-cluster. |
3841
| backend.listenAddress | string | `"0.0.0.0:8080"` | Address the backend listens on |
3942
| backend.loggingLevel | int | `2` | Logging verbosity level |
@@ -71,9 +74,6 @@ See [values.yaml](values.yaml) for the full list of configurable parameters.
7174
| gatewayApi.route.path | string | `"/"` | Path match for the HTTPRoute |
7275
| gatewayApi.route.pathType | string | `"PathPrefix"` | Path match type for the HTTPRoute |
7376
| hostAliases | list | `[]` | Host aliases for /etc/hosts injection into pods |
74-
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
75-
| image.repository | string | `"ghcr.io/kube-bind/backend"` | Image repository |
76-
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion |
7777
| imagePullSecrets | list | `[]` | Secrets for pulling images from a private repository |
7878
| initContainers | list | `[]` | Additional init containers |
7979
| livenessProbe | object | `{"httpGet":{"path":"/healthz","port":"http"}}` | Liveness probe configuration |

deploy/charts/backend/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ spec:
4646
securityContext:
4747
{{- toYaml . | nindent 12 }}
4848
{{- end }}
49-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
50-
imagePullPolicy: {{ .Values.image.pullPolicy }}
49+
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag | default .Chart.AppVersion }}"
50+
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
5151
env:
5252
{{- if .Values.backend.oidc.clientSecretName }}
5353
- name: OIDC_CLIENT_SECRET

deploy/charts/backend/values.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ replicaCount: 1
77

88
# Backend configuration
99
backend:
10+
# Container image configuration
11+
image:
12+
# -- Image repository
13+
repository: ghcr.io/kube-bind/backend
14+
# -- Image pull policy
15+
pullPolicy: IfNotPresent
16+
# -- Overrides the image tag whose default is the chart appVersion
17+
tag: ""
1018
# -- Address the backend listens on
1119
listenAddress: "0.0.0.0:8080"
1220
# -- Path to a kubeconfig file. Only required if out-of-cluster.
@@ -130,15 +138,6 @@ examples:
130138
# -- Enable example resources to seed on first start
131139
enabled: false
132140

133-
# Container image configuration
134-
image:
135-
# -- Image repository
136-
repository: ghcr.io/kube-bind/backend
137-
# -- Image pull policy
138-
pullPolicy: IfNotPresent
139-
# -- Overrides the image tag whose default is the chart appVersion
140-
tag: ""
141-
142141
# -- Secrets for pulling images from a private repository
143142
imagePullSecrets: []
144143
# -- Override the chart name

0 commit comments

Comments
 (0)