Skip to content

Commit

Permalink
Document default MC image for MinIOJob CRD (minio#2187)
Browse files Browse the repository at this point in the history
Document default MC image
Add release script section to set a defined mc image instead of 'latest'

Signed-off-by: pjuarezd <[email protected]>
  • Loading branch information
pjuarezd authored Jun 29, 2024
1 parent 80f5652 commit 24f34a0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
8 changes: 3 additions & 5 deletions docs/job_crd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

:minio-image: https://hub.docker.com/r/minio/minio/tags[minio/minio:RELEASE.2024-05-01T01-11-10Z]
:kes-image: https://hub.docker.com/r/minio/kes/tags[minio/kes:2024-04-12T13-50-00Z]
:mc-image: https://hub.docker.com/r/minio/mc/tags[minio/mc:latest]


[id="{anchor_prefix}-job-min-io-v1alpha1"]
Expand All @@ -32,10 +33,7 @@ CommandSpec (`spec`) defines the configuration of a MinioClient Command.
| Field | Description

|*`op`* __string__
|*Required* +


Operation is the MinioClient Action
|Operation is the MinioClient Action

|*`name`* __string__
|Name is the Command Name, optional, required if want to reference it with `DependsOn`
Expand Down Expand Up @@ -197,7 +195,7 @@ Either `stopOnFailure` or `continueOnFailure`, defaults to `continueOnFailure`.
Commands List of MinioClient commands

|*`mcImage`* __string__
|mc job image
|The Docker image to use when deploying `mc` pods. Defaults to {mc-image}. +

|*`imagePullPolicy`* __link:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#pullpolicy-v1-core[$$PullPolicy$$]__
|*Optional* +
Expand Down
1 change: 1 addition & 0 deletions docs/policybinding_crd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

:minio-image: https://hub.docker.com/r/minio/minio/tags[minio/minio:RELEASE.2024-05-01T01-11-10Z]
:kes-image: https://hub.docker.com/r/minio/kes/tags[minio/kes:2024-04-12T13-50-00Z]
:mc-image: https://hub.docker.com/r/minio/mc/tags[minio/mc:latest]


[id="{anchor_prefix}-sts-min-io-v1beta1"]
Expand Down
1 change: 1 addition & 0 deletions docs/templates/asciidoctor/gv_list.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

:minio-image: https://hub.docker.com/r/minio/minio/tags[minio/minio:RELEASE.2024-05-01T01-11-10Z]
:kes-image: https://hub.docker.com/r/minio/kes/tags[minio/kes:2024-04-12T13-50-00Z]
:mc-image: https://hub.docker.com/r/minio/mc/tags[minio/mc:latest]

{{ range $groupVersions }}
{{ template "gvDetails" . }}
Expand Down
1 change: 1 addition & 0 deletions docs/tenant_crd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

:minio-image: https://hub.docker.com/r/minio/minio/tags[minio/minio:RELEASE.2024-05-01T01-11-10Z]
:kes-image: https://hub.docker.com/r/minio/kes/tags[minio/kes:2024-04-12T13-50-00Z]
:mc-image: https://hub.docker.com/r/minio/mc/tags[minio/mc:latest]


[id="{anchor_prefix}-minio-min-io-v2"]
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/job.min.io/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type MinIOJobSpec struct {
// Commands List of MinioClient commands
Commands []CommandSpec `json:"commands"`

// mc job image
// The Docker image to use when deploying `mc` pods. Defaults to {mc-image}. +
// +optional
// +kubebuilder:default="quay.io/minio/mc:latest"
MCImage string `json:"mcImage,omitempty"`
Expand Down
6 changes: 6 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ get_latest_release() {

MINIO_RELEASE=$(get_latest_release minio/minio)
KES_RELEASE=$(get_latest_release minio/kes)
MC_RELEASE=$(get_latest_release minio/mc)

KES_CURRENT_RELEASE=$(sed -nr 's/.*(minio\/kes\:)([v]?.*)"/\2/p' pkg/apis/minio.min.io/v2/constants.go)

MC_CURRENT_RELEASE=$(sed -nr 's/.*(minio\/mc\:)([v]?.*)"/\2/p' pkg/utils/miniojob/types.go)

files=(
"README.md"
"api/consts.go"
"pkg/apis/job.min.io/v1alpha1/types.go"
"docs/tenant_crd.adoc"
"docs/policybinding_crd.adoc"
"docs/job_crd.adoc"
"docs/templates/asciidoctor/gv_list.tpl"
"examples/kustomization/base/tenant.yaml"
"examples/kustomization/tenant-certmanager-kes/tenant.yaml"
Expand Down Expand Up @@ -50,6 +55,7 @@ for file in "${files[@]}"; do
sed -i -e "s/${CURRENT_RELEASE}/${RELEASE}/g" "$file"
sed -i -e "s/RELEASE\.[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]-[0-9][0-9]-[0-9][0-9]Z/${MINIO_RELEASE}/g" "$file"
sed -i -e "s/${KES_CURRENT_RELEASE}/${KES_RELEASE}/g" "$file"
sed -i -e "s/${MC_CURRENT_RELEASE}/${MC_RELEASE}/g" "$file"
done

annotations_files=(
Expand Down

0 comments on commit 24f34a0

Please sign in to comment.