Skip to content

Commit

Permalink
Merge pull request observatorium#32 from marcolan018/pull
Browse files Browse the repository at this point in the history
support customized pull secret
  • Loading branch information
openshift-merge-robot authored May 12, 2021
2 parents c47b4b9 + a0b06e4 commit a1b868e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/observatorium_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ type ObservatoriumSpec struct {
// Security options the pod should run with.
// +optional
SecurityContext *v1.SecurityContext `json:"securityContext,omitempty"`
// Pull secret used to pull the images.
// +optional
PullSecret string `json:"pullSecret,omitempty"`
}

type ThanosSpec struct {
Expand Down
12 changes: 12 additions & 0 deletions jsonnet/obs-operator.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,18 @@ local operatorObs = obs {
},
},
} else {}
) + (
if (std.objectHas(cr.spec, 'pullSecret') && (v.kind == 'StatefulSet' || v.kind == 'Deployment')) then {
template+: {
spec+:{
imagePullSecrets: [
{
name: cr.spec.pullSecret,
},
],
},
},
} else {}
),
}, operatorObs.manifests),
}
3 changes: 3 additions & 0 deletions manifests/crds/core.observatorium.io_observatoria.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,9 @@ spec:
required:
- thanos
type: object
pullSecret:
description: Pull secret used to pull the images.
type: string
securityContext:
description: Security options the pod should run with.
properties:
Expand Down

0 comments on commit a1b868e

Please sign in to comment.