Skip to content

Commit

Permalink
plz: add imagePullSecrets
Browse files Browse the repository at this point in the history
  • Loading branch information
yorugac committed Jul 24, 2024
1 parent f737f89 commit 3b9d5d3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
11 changes: 6 additions & 5 deletions api/v1alpha1/privateloadzone_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ import (

// PrivateLoadZoneSpec defines the desired state of PrivateLoadZone
type PrivateLoadZoneSpec struct {
Token string `json:"token"`
Resources corev1.ResourceRequirements `json:"resources"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Image string `json:"image,omitempty"`
Token string `json:"token"`
Resources corev1.ResourceRequirements `json:"resources"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Image string `json:"image,omitempty"`
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}

// PrivateLoadZoneStatus defines the observed state of PrivateLoadZone
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions config/crd/bases/k6.io_privateloadzones.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ spec:
properties:
image:
type: string
imagePullSecrets:
items:
properties:
name:
type: string
type: object
x-kubernetes-map-type: atomic
type: array
nodeSelector:
additionalProperties:
type: string
Expand Down
2 changes: 2 additions & 0 deletions pkg/testrun/plz.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func NewPLZTestRun(plz *v1alpha1.PrivateLoadZone, trData *cloud.TestRunData, ing
Spec: v1alpha1.TestRunSpec{
Runner: v1alpha1.Pod{
Image: trData.RunnerImage,
ImagePullSecrets: plz.Spec.ImagePullSecrets,
ServiceAccountName: plz.Spec.ServiceAccountName,
NodeSelector: plz.Spec.NodeSelector,
Resources: plz.Spec.Resources,
Expand All @@ -64,6 +65,7 @@ func NewPLZTestRun(plz *v1alpha1.PrivateLoadZone, trData *cloud.TestRunData, ing
Starter: v1alpha1.Pod{
ServiceAccountName: plz.Spec.ServiceAccountName,
NodeSelector: plz.Spec.NodeSelector,
ImagePullSecrets: plz.Spec.ImagePullSecrets,
},
Script: v1alpha1.K6Script{
LocalFile: "/test/archive.tar",
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// Internal type created to support Spec.script options
type Script struct {
Name string // Name of ConfigMap or VolumeClaim or "LocalFile"
ReadOnly bool // VolumeClaim only
ReadOnly bool // VolumeClaim only
Filename string
Path string
Type string // ConfigMap | VolumeClaim | LocalFile
Expand Down

0 comments on commit 3b9d5d3

Please sign in to comment.