Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.7] Bug 1946831: Changing the name to make OSBS auto repo/registry replacements to work #109

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Installation docs are [here][operator-sdk-installation].
To run locally, you must set the operand image as shown below.

```
export OPERAND_IMAGE="quay.io/app-sre/cincinnati:2873c6b"
export RELATED_IMAGE_OPERAND="quay.io/app-sre/cincinnati:2873c6b"
operator-sdk run --local
```

Expand All @@ -26,7 +26,7 @@ make deploy
By default, operator will be deployed using the default operator image `quay.io/updateservice/update-service-operator:latest`. If you want to override the default operator image with your image, set

```
export OPERATOR_IMAGE="your-registry/your-repo/your-update-service-opertor-image:tag"
export RELATED_IMAGE_OPERATOR="your-registry/your-repo/your-update-service-opertor-image:tag"
```

## Run functional tests
Expand All @@ -35,7 +35,7 @@ export OPERATOR_IMAGE="your-registry/your-repo/your-update-service-opertor-image
make func-test
```

To run the functional testcases locally, you must set below environment variables as shown below along with optional `OPERAND_IMAGE` and `OPERATOR_IMAGE`.
To run the functional testcases locally, you must set below environment variables as shown below along with optional `RELATED_IMAGE_OPERAND` and `RELATED_IMAGE_OPERATOR`.

```
export KUBECONFIG="path-for-kubeconfig-file"
Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ spec:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "updateservice-operator"
- name: OPERAND_IMAGE
- name: RELATED_IMAGE_OPERAND
value: "quay.io/cincinnati/cincinnati:latest"
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ spec:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: updateservice-operator
- name: OPERAND_IMAGE
- name: RELATED_IMAGE_OPERAND
value: quay.io/cincinnati/cincinnati:latest
image: quay.io/updateservice/updateservice-operator:latest
imagePullPolicy: Always
Expand Down
14 changes: 7 additions & 7 deletions hack/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ set -e
# DEFAULT_OPERATOR_IMAGE is a placeholder for cincinnati-operator image placeholder
# During development override this when you want to use an specific image
DEFAULT_OPERATOR_IMAGE="controller:latest"
DEFAULT_OPERAND_IMAGE="quay.io/app-sre/cincinnati:2873c6b"
DEFAULT_OPERAND_IMAGE="quay.io/cincinnati/cincinnati:latest"

OPERATOR_IMAGE="${OPERATOR_IMAGE:-${DEFAULT_OPERATOR_IMAGE}}"
OPERAND_IMAGE="${OPERAND_IMAGE:-${DEFAULT_OPERAND_IMAGE}}"
RELATED_OPERATOR_IMAGE="${RELATED_IMAGE_OPERATOR:-${DEFAULT_OPERATOR_IMAGE}}"
RELATED_OPERAND_IMAGE="${RELATED_IMAGE_OPERAND:-${DEFAULT_OPERAND_IMAGE}}"

if [ -n "$OPENSHIFT_BUILD_NAMESPACE" ]; then
OPERATOR_IMAGE="registry.svc.ci.openshift.org/${OPENSHIFT_BUILD_NAMESPACE}/stable:updateservice-operator"
RELATED_OPERATOR_IMAGE="registry.svc.ci.openshift.org/${OPENSHIFT_BUILD_NAMESPACE}/stable:updateservice-operator"
GRAPH_DATA_IMAGE="registry.svc.ci.openshift.org/${OPENSHIFT_BUILD_NAMESPACE}/stable:updateservice-graph-data-container"

echo "Openshift CI detected, deploying using image $OPERATOR_IMAGE and ${GRAPH_DATA_IMAGE}"
echo "Openshift CI detected, deploying using image $RELATED_OPERATOR_IMAGE and ${GRAPH_DATA_IMAGE}"

else
if ! [ -n "$KUBECONFIG" ]; then
Expand All @@ -27,8 +27,8 @@ else
fi
fi

sed -i "s|quay.io/cincinnati/cincinnati:latest|$OPERAND_IMAGE|" config/manager/manager.yaml
sed -i "s|$DEFAULT_OPERATOR_IMAGE|$OPERATOR_IMAGE|" config/manager/manager.yaml
sed -i "s|$DEFAULT_OPERAND_IMAGE|$RELATED_OPERAND_IMAGE|" config/manager/manager.yaml
sed -i "s|$DEFAULT_OPERATOR_IMAGE|$RELATED_OPERATOR_IMAGE|" config/manager/manager.yaml
sed -i "s|your-registry/your-repo/your-init-container|$GRAPH_DATA_IMAGE|" config/samples/updateservice.operator.openshift.io_v1_updateservice_cr.yaml

NAMESPACE="openshift-updateservice"
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ func main() {
os.Exit(1)
}

operandImage := os.Getenv("OPERAND_IMAGE")
operandImage := os.Getenv("RELATED_IMAGE_OPERAND")
if operandImage == "" {
log.Error(errors.New("Must set envvar OPERAND_IMAGE"), "")
log.Error(errors.New("Must set envvar RELATED_IMAGE_OPERAND"), "")
os.Exit(1)
}
if err = (&controllers.UpdateServiceReconciler{
Expand Down