Skip to content

Commit

Permalink
feat: add support for ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
boulc committed May 12, 2024
1 parent 4b6d730 commit f717c5e
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 14 deletions.
11 changes: 7 additions & 4 deletions docs/local_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,13 @@ Build docker image
Build a BYOH bundle and publish it to an OCI-compliant repo

```shell
docker run --rm \
-v `pwd`/byoh-ingredients-download:/ingredients \
-e BUILD_ONLY=0 \
byoh-build-push-bundle-ubuntu-22.04 ubuntu_22.04_x86-64_k8s-vx.y.z docker.io/thegnoucommunity/cluster-api-byoh-bundle
(cd installer/bundle_builder/ubuntu && \
docker run --rm \
-v `pwd`/byoh-ingredients-download:/ingredients \
-v `pwd`/22.04/x86-64/k8s/conf:/conf \
-v `pwd`/22.04/x86-64/k8s/scripts:/scripts \
-e BUILD_ONLY=0 \
byoh-build-push-bundle-ubuntu-22.04 ubuntu_22.04_x86-64_k8s-vx.y.z docker.io/thegnoucommunity/cluster-api-byoh-bundle)
```

### Other options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CONFIG_PATH=$2

set -e

rm -rf $INGREDIENTS_PATH/$3.tar
rm -rf $INGREDIENTS_PATH/$4.tar

echo Building bundle...

Expand All @@ -35,6 +35,6 @@ cp $CONFIG_PATH/conf.tar .

echo Creating bundle tar
tar -cvf /bundle/bundle.tar *
cp /bundle/bundle.tar $INGREDIENTS_PATH/$3.tar
cp /bundle/bundle.tar $INGREDIENTS_PATH/$4.tar

echo Done
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

INGREDIENTS_PATH=$1
CONFIG_PATH=$2
SCRIPTS_PATH=$3

set -e

rm -rf $INGREDIENTS_PATH/$3.tar
rm -rf $INGREDIENTS_PATH/$4.tar

echo Building bundle...

Expand All @@ -35,6 +36,13 @@ cp $CONFIG_PATH/conf.tar .

echo Creating bundle tar
tar -cvf /bundle/bundle.tar *
cp /bundle/bundle.tar $INGREDIENTS_PATH/$3.tar
cp /bundle/bundle.tar $INGREDIENTS_PATH/$4.tar

if [ -d $SCRIPTS_PATH ];
then
echo Add scripts under well-known name
(cd $SCRIPTS_PATH && tar -cvf scripts.tar *)
cp $SCRIPTS_PATH/scripts.tar $INGREDIENTS_PATH/$4-scripts.tar
fi

echo Done
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

set -e

build-bundle.sh $1 $2 $3
build-bundle.sh $1 $2 $3 $4
if [ $BUILD_ONLY -eq 0 ]
then
push-bundle.sh $4:$3
push-bundle.sh $5:$4
fi

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -e

echo Pushing bundle "$*"
echo Pushing bundles "$*"

imgpkg push -f . -i $@

Expand Down
4 changes: 2 additions & 2 deletions installer/bundle_builder/ubuntu/Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ WORKDIR /bundle-builder
COPY ingredients/*.sh ./
RUN chmod a+x *.sh
#Default config
COPY ./conf/ /config/
COPY ./conf/ /conf/

RUN mkdir /ingredients && mkdir /bundle
ENV PATH="/bundle-builder:${PATH}"

WORKDIR /tmp/bundle
ENTRYPOINT ["build-push-bundle.sh", "/ingredients", "/config"]
ENTRYPOINT ["build-push-bundle.sh", "/ingredients", "/conf", "/scripts"]
2 changes: 1 addition & 1 deletion installer/bundle_downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (bd *bundleDownloader) getBundlePathWithRepo() string {

// GetBundleAddr returns the exact address to the bundle in the repo.
func (bd *bundleDownloader) GetBundleAddr(normalizedOsVersion, k8sVersion string) string {
return fmt.Sprintf("%s/%s-%s", bd.repoAddr, GetBundleName(normalizedOsVersion), k8sVersion)
return fmt.Sprintf("%s:%s-%s", bd.repoAddr, GetBundleName(normalizedOsVersion), k8sVersion)
}

// checkDirExist checks if a dirrectory exists.
Expand Down

0 comments on commit f717c5e

Please sign in to comment.