Skip to content

Commit

Permalink
Merge pull request #214 from fromanirh/cleanup-csv-generator
Browse files Browse the repository at this point in the history
cleanup: streamline and use csv-generator options
  • Loading branch information
openshift-merge-robot authored May 6, 2020
2 parents b621100 + bf8617a commit aedf620
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions hack/csv-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ OUT_CSV_FILE="${OUT_CSV_DIR}/${PACKAGE_NAME}.v${CSV_VERSION}.clusterserviceversi
EXTRA_ANNOTATIONS=""
MAINTAINERS=""

if [ -n "$DESCRIPTION_FILE" ]; then
DESCRIPTION="-description-from=$DESCRIPTION_FILE"
fi
if [ -n "$MAINTAINERS_FILE" ]; then
MAINTAINERS="-maintainers-from=$MAINTAINERS_FILE"
fi

if [ -n "$ANNOTATIONS_FILE" ]; then
EXTRA_ANNOTATIONS="-inject-annotations-from=$ANNOTATIONS_FILE"
EXTRA_ANNOTATIONS="-annotations-from=$ANNOTATIONS_FILE"
fi

clean_package() {
Expand Down Expand Up @@ -60,6 +62,7 @@ build/_output/bin/csv-generator \
--olm-bundle-directory "$OUT_CSV_DIR" \
--replaces-csv-version "$REPLACES_CSV_VERSION" \
--skip-range "$CSV_SKIP_RANGE" \
"${DESCRIPTION}" \
"${MAINTAINERS}" \
"${EXTRA_ANNOTATIONS}"

Expand Down
5 changes: 4 additions & 1 deletion tools/csv-generator/csv-generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (

outputDir = flag.String("olm-bundle-directory", "", "The directory to output the unified CSV and CRDs to")

annotationsFile = flag.String("inject-annotations-from", "", "inject metadata annotations from given file")
annotationsFile = flag.String("annotations-from", "", "add metadata annotations from given file")
maintainersFile = flag.String("maintainers-from", "", "add maintainers list from given file")
descriptionFile = flag.String("description-from", "", "replace the description with the content of the given file")

Expand Down Expand Up @@ -137,6 +137,9 @@ func generateUnifiedCSV(userData csvUserData) {
// Set Description
operatorCSV.Spec.Description = `
Performance Addon Operator provides the ability to enable advanced node performance tunings on a set of nodes.`
if userData.Description != "" {
operatorCSV.Spec.Description = userData.Description
}

operatorCSV.Spec.DisplayName = "Performance Addon Operator"

Expand Down

0 comments on commit aedf620

Please sign in to comment.