operator: Fix makefile target operatorhub (#8930)

pull/8942/head
Periklis Tsirakidis 2 years ago committed by GitHub
parent 43ae1db14c
commit b76be36e0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      operator/CHANGELOG.md
  2. 51
      operator/hack/.checked-pr-template.md
  3. 15
      operator/hack/operatorhub.sh

@ -1,6 +1,6 @@
## Main
- [8930](https://github.com/grafana/loki/pull/8930) **periklis**: Fix makefile target operatorhub
- [8911](https://github.com/grafana/loki/pull/8911) **aminesnow**: Update LokiStack annotaion on RulerConfig delete
## 0.2.0 (2023-03-27)

@ -0,0 +1,51 @@
Thanks submitting your Operator. Please check below list before you create your Pull Request.
### New Submissions
* [x] Are you familiar with our [contribution guidelines](https://github.com/operator-framework/community-operators/blob/master/docs/contributing-via-pr.md)?
* [x] Have you [packaged and deployed](https://github.com/operator-framework/community-operators/blob/master/docs/testing-operators.md) your Operator for Operator Framework?
* [x] Have you tested your Operator with all Custom Resource Definitions?
* [x] Have you tested your Operator in all supported [installation modes](https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/design/building-your-csv.md#operator-metadata)?
* [x] Have you considered whether you want use [semantic versioning order](https://github.com/operator-framework/community-operators/blob/master/docs/operator-ci-yaml.md#semver-mode)?
* [x] Is your submission [signed](https://github.com/operator-framework/community-operators/blob/master/docs/contributing-prerequisites.md#sign-your-work)?
* [x] Is operator [icon](https://github.com/operator-framework/community-operators/blob/master/docs/packaging-operator.md#operator-icon) set?
### Updates to existing Operators
* [x] Did you create a `ci.yaml` file according to the [update instructions](https://github.com/operator-framework/community-operators/blob/master/docs/operator-ci-yaml.md)?
* [x] Is your new CSV pointing to the previous version with the `replaces` property if you chose `replaces-mode` via the `updateGraph` property in `ci.yaml`?
* [x] Is your new CSV referenced in the [appropriate channel](https://github.com/operator-framework/community-operators/blob/master/docs/packaging-operator.md#channels) defined in the `package.yaml` or `annotations.yaml` ?
* [ ] Have you tested an update to your Operator when deployed via OLM?
* [x] Is your submission [signed](https://github.com/operator-framework/community-operators/blob/master/docs/contributing-prerequisites.md#sign-your-work)?
### Your submission should not
* [x] Modify more than one operator
* [x] Modify an Operator you don't own
* [x] Rename an operator - please remove and add with a different name instead
* [x] Submit operators to both `upstream-community-operators` and `community-operators` at once
* [x] Modify any files outside the above mentioned folders
* [x] Contain more than one commit. **Please squash your commits.**
### Operator Description must contain (in order)
1. [x] Description about the managed Application and where to find more information
2. [x] Features and capabilities of your Operator and how to use it
3. [x] Any manual steps about potential pre-requisites for using your Operator
### Operator Metadata should contain
* [x] Human readable name and 1-liner description about your Operator
* [x] Valid [category name](https://github.com/operator-framework/community-operators/blob/master/docs/packaging-operator.md#categories)<sup>1</sup>
* [x] One of the pre-defined [capability levels](https://github.com/operator-framework/operator-courier/blob/4d1a25d2c8d52f7de6297ec18d8afd6521236aa2/operatorcourier/validate.py#L556)<sup>2</sup>
* [x] Links to the maintainer, source code and documentation
* [x] Example templates for all Custom Resource Definitions intended to be used
* [x] A quadratic logo
Remember that you can preview your CSV [here](https://operatorhub.io/preview).
--
<sup>1</sup> If you feel your Operator does not fit any of the pre-defined categories, file an issue against this repo and explain your need
<sup>2</sup> For more information see [here](https://sdk.operatorframework.io/docs/overview/#operator-capability-level)

@ -18,6 +18,7 @@ fi
SOURCE_DIR=$(pwd)
VERSION=$(grep "VERSION ?= " Makefile | awk -F= '{print $2}' | xargs)
INT_VERSION="${VERSION#v}"
for dest in ${COMMUNITY_OPERATORS_REPOSITORY} ${UPSTREAM_REPOSITORY}; do
(
@ -33,18 +34,18 @@ for dest in ${COMMUNITY_OPERATORS_REPOSITORY} ${UPSTREAM_REPOSITORY}; do
git checkout -q main
git rebase -q upstream/main
mkdir -p "operators/loki-operator/${VERSION}"
mkdir -p "operators/loki-operator/${INT_VERSION}"
if [[ "${dest}" = "${UPSTREAM_REPOSITORY}" ]]; then
cp -r "${SOURCE_DIR}/bundle/community-openshift"/* "operators/loki-operator/${VERSION}/"
cp -r "${SOURCE_DIR}/bundle/community-openshift"/* "operators/loki-operator/${INT_VERSION}/"
else
cp -r "${SOURCE_DIR}/bundle/community"/* "operators/loki-operator/${VERSION}/"
cp -r "${SOURCE_DIR}/bundle/community"/* "operators/loki-operator/${INT_VERSION}/"
fi
rm "operators/loki-operator/${VERSION}/bundle.Dockerfile"
rm "operators/loki-operator/${INT_VERSION}/bundle.Dockerfile"
if [[ "${dest}" = "${UPSTREAM_REPOSITORY}" ]]; then
python3 - << END
import os, yaml
with open("./operators/loki-operator/${VERSION}/metadata/annotations.yaml", 'r') as f:
with open("./operators/loki-operator/${INT_VERSION}/metadata/annotations.yaml", 'r') as f:
y=yaml.safe_load(f) or {}
y['annotations']['com.redhat.openshift.versions'] = os.getenv('SUPPORTED_OCP_VERSIONS')
with open("./operators/loki-operator/${VERSION}/metadata/annotations.yaml", 'w') as f:
@ -59,7 +60,7 @@ END
fi
git add .
git commit -sqm "Update loki-operator to v${VERSION}"
git commit -sqm "Update loki-operator to ${VERSION}"
if ! command -v gh > /dev/null;
then
@ -68,7 +69,7 @@ END
fi
echo "Submitting PR on your behalf via 'gh'"
gh pr create --title "Update loki-operator to v${VERSION}" --body-file "${SOURCE_DIR}/hack/.checked-pr-template.md"
gh pr create --title "Update loki-operator to ${VERSION}" --body-file "${SOURCE_DIR}/hack/.checked-pr-template.md"
)
done

Loading…
Cancel
Save