Skip to content

Commit

Permalink
adds gardener images to component descriptor (gardener#5818)
Browse files Browse the repository at this point in the history
* adds gardener images to component descriptor

* Update component_descriptor

* adds missing images
  • Loading branch information
jschicktanz authored Apr 19, 2022
1 parent 23765d8 commit 703a799
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .ci/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: 'admission-controller'
version: '${COMPONENT_VERSION}'
type: 'ociImage'
relation: 'local'
access:
type: 'ociRegistry'
imageReference: 'eu.gcr.io/gardener-project/gardener/admission-controller:${COMPONENT_VERSION}'
---
---
name: 'apiserver'
version: '${COMPONENT_VERSION}'
type: 'ociImage'
relation: 'local'
access:
type: 'ociRegistry'
imageReference: 'eu.gcr.io/gardener-project/gardener/apiserver:${COMPONENT_VERSION}'
---
---
name: 'controller-manager'
version: '${COMPONENT_VERSION}'
type: 'ociImage'
relation: 'local'
access:
type: 'ociRegistry'
imageReference: 'eu.gcr.io/gardener-project/gardener/controller-manager:${COMPONENT_VERSION}'
---
---
name: 'gardenlet'
version: '${COMPONENT_VERSION}'
type: 'ociImage'
relation: 'local'
access:
type: 'ociRegistry'
imageReference: 'eu.gcr.io/gardener-project/gardener/gardenlet:${COMPONENT_VERSION}'
---
---
name: 'resource-manager'
version: '${COMPONENT_VERSION}'
type: 'ociImage'
relation: 'local'
access:
type: 'ociRegistry'
imageReference: 'eu.gcr.io/gardener-project/gardener/resource-manager:${COMPONENT_VERSION}'
---
---
name: 'scheduler'
version: '${COMPONENT_VERSION}'
type: 'ociImage'
relation: 'local'
access:
type: 'ociRegistry'
imageReference: 'eu.gcr.io/gardener-project/gardener/scheduler:${COMPONENT_VERSION}'
---
---
name: 'seed-admission-controller'
version: '${COMPONENT_VERSION}'
type: 'ociImage'
relation: 'local'
access:
type: 'ociRegistry'
imageReference: 'eu.gcr.io/gardener-project/gardener/seed-admission-controller:${COMPONENT_VERSION}'
---
28 changes: 28 additions & 0 deletions hack/.ci/component_descriptor
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ repo_root_dir="$1"
repo_name="${2:-github.com/gardener/gardener}"
descriptor_out_file="${COMPONENT_DESCRIPTOR_PATH}"

resources_file="$repo_root_dir/.ci/resources.yaml"
if [[ -f ${resources_file} ]]; then
echo "Adding additional resources from ${resources_file}"

# component-cli expects a directory where the component descriptor file is named component-descriptor.yaml.
# however the pre-rendered component descriptors of the pipeline have different filenames.
# therefore create a tempdir and copy the pre-rendered component descriptor to it with the correct filename.
tmp_dir="$(mktemp -d)"
tmp_cd="${tmp_dir}/component-descriptor.yaml"
cp "${BASE_DEFINITION_PATH}" "${tmp_cd}"
echo "${tmp_cd}"

# read component component version.
if [[ -z ${VERSION_PATH} ]]; then
echo "The env variable VERSION_PATH must be set"
exit 1
fi
component_version="$(cat ${VERSION_PATH}/version)"

# adds all resources defined in the resources file to the component descriptor.
component-cli component-archive resources add ${tmp_dir} ${resources_file} -v=3 -- COMPONENT_VERSION=${component_version}

# move modified component descriptor back to the original file.
mv "${tmp_cd}" "${BASE_DEFINITION_PATH}"
else
echo "Resources file ${resources_file} not found. Skip adding additional resources."
fi

echo "Enriching component descriptor from ${BASE_DEFINITION_PATH}"

if [[ -f "$repo_root_dir/charts/images.yaml" ]]; then
Expand Down

0 comments on commit 703a799

Please sign in to comment.