update osbuilder/osartifact

This commit is contained in:
Sebastian Florek
2025-01-30 21:07:00 +01:00
parent 6733cc712b
commit ebe602b113
9 changed files with 52 additions and 7 deletions

View File

@@ -80,6 +80,14 @@ type ExporterSpec struct {
// ExtraEnvVars allows to append extra env vars to the exporter pods.
// +optional
ExtraEnvVars *[]corev1.EnvVar `json:"extraEnvVars,omitempty"`
// Image is the image used for exporter pods
// +optional
Image string `json:"image,omitempty"`
// ExtraArgs allows appending args to the exporter image.
// +optional
ExtraArgs []string `json:"extraArgs,omitempty"`
}
func (in *ExporterSpec) IsECRRegistry() bool {

View File

@@ -46,6 +46,11 @@ func (in *ExporterSpec) DeepCopyInto(out *ExporterSpec) {
}
}
}
if in.ExtraArgs != nil {
in, out := &in.ExtraArgs, &out.ExtraArgs
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExporterSpec.

View File

@@ -5,4 +5,4 @@ maintainers:
- name: Plural
email: support@plural.sh
type: application
version: 0.6.2
version: 0.7.0

View File

@@ -27,6 +27,13 @@ spec:
{{- with .Values.exporter.extraEnvVars }}
extraEnvVars: {{ . | toYaml | nindent 4 }}
{{- end }}
{{- if .Values.exporter.image }}
image: {{ .Values.exporter.image }}
{{- end }}
{{ with .Values.exporter.extraArgs }}
extraArgs:
{{- . | toYaml | nindent 6 }}
{{- end }}
registry:
name: {{ .Values.exporter.registry.name }}
type: {{ .Values.exporter.registry.type }}

View File

@@ -61,11 +61,15 @@ extraCloudConfig: ~
exporter:
serviceAccount:
annotations: ~
# Defines extra env vars that will be added to the exporter pob
# Defines extra env vars that will be added to the exporter pod
# extraEnvVars:
# - name: MY_ENV_VAR
# value: myvalue
extraEnvVars: []
# Image used for exporter pods
image: ~
# Allows appending args to the exporter image
extraArgs: []
registry:
# Container registry DNS name where we should export packed ISO images
name: ~

View File

@@ -1,8 +1,8 @@
apiVersion: v2
name: osbuilder
description: A Helm chart for osbuilder
appVersion: 0.3.0
version: 0.1.14
appVersion: 0.4.0
version: 0.1.15
dependencies:
- name: cert-manager
version: v1.16.3

View File

@@ -75,6 +75,11 @@ spec:
Exporter when provided it will spawn an exporter job that
pushes images built by the osbuilder to the provided registry.
properties:
extraArgs:
description: ExtraArgs allows appending args to the exporter image.
items:
type: string
type: array
extraEnvVars:
description: ExtraEnvVars allows to append extra env vars to the
exporter pods.
@@ -196,6 +201,9 @@ spec:
- name
type: object
type: array
image:
description: Image is the image used for exporter pods
type: string
registry:
description: Registry is a registry spec used to push the final
images built by the osbuilder.

View File

@@ -75,6 +75,11 @@ spec:
Exporter when provided it will spawn an exporter job that
pushes images built by the osbuilder to the provided registry.
properties:
extraArgs:
description: ExtraArgs allows appending args to the exporter image.
items:
type: string
type: array
extraEnvVars:
description: ExtraEnvVars allows to append extra env vars to the
exporter pods.
@@ -196,6 +201,9 @@ spec:
- name
type: object
type: array
image:
description: Image is the image used for exporter pods
type: string
registry:
description: Registry is a registry spec used to push the final
images built by the osbuilder.

View File

@@ -309,14 +309,19 @@ func (r *OSArtifactReconciler) checkExport(ctx context.Context, artifact *osbuil
tag = "latest"
}
image := artifact.Spec.Exporter.Image
if len(image) == 0 {
image = "gcr.io/kaniko-project/executor:latest"
}
container := corev1.Container{
Name: "exporter",
Image: "gcr.io/kaniko-project/executor:latest",
Args: []string{
Image: image,
Args: append([]string{
"--context=/artifacts/",
"--dockerfile=/artifacts/Dockerfile",
fmt.Sprintf("--destination=%s/%s:%s", artifact.Spec.Exporter.Registry.Name, artifact.Spec.Exporter.Registry.Image.Repository, tag),
},
}, artifact.Spec.Exporter.ExtraArgs...),
VolumeMounts: []corev1.VolumeMount{
{
Name: "artifacts",