Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit 4b40b4b

Browse files
authored
Merge pull request #56 from oracle/oss-prep
Update the project in preparation for open source. Publish 0.1.0 release
2 parents 492978b + 9784f10 commit 4b40b4b

File tree

6 files changed

+51
-32
lines changed

6 files changed

+51
-32
lines changed

docs/tutorial.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,12 @@ First create the namespace that the operator will reside in:
1616
kubectl create ns mysql-operator
1717
```
1818

19-
Next, export a docker secret which holds the ODX Docker Registry password. Our images are published to a shared
20-
private Docker registry. Until there are public repos available, you will need a secret to pull images from this repository.
21-
22-
You will need to create a secret in **both** the default and mysql-operator namespace.
23-
24-
```
25-
kubectl -n mysql-operator create secret docker-registry odx-docker-pull-secret \
26-
--docker-server="wcr.io" \
27-
--docker-username="XXX" \
28-
--docker-password="XXX" \
29-
--docker-email="[email protected]"
30-
31-
kubectl create secret docker-registry odx-docker-pull-secret \
32-
--docker-server="wcr.io" \
33-
--docker-username="XXX" \
34-
--docker-password="XXX" \
35-
--docker-email="[email protected]"
36-
```
37-
3819
## Deploy a version of the MySQL Operator using Helm
3920

4021
The MySQL Operator is installed into your cluster via a Helm chart
4122

4223
### Ensure you have Helm installed and working.
4324

44-
4525
Install the helm tool locally by following [these instructions](https://docs.helm.sh/using_helm/#installing-helm)
4626

4727
If you have not already installed tiller to your cluster set it up with:

hack/release.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
3+
# This script will pull down an existing build and tag it for release.
4+
# Example: SHA=492978... RELEASE=0.1.0 hack/release.sh
5+
6+
set -e
7+
8+
RELEASE=${RELEASE:=0.1.0}
9+
10+
SHA=${SHA:=$(git rev-parse HEAD)}
11+
12+
OPERATOR_IMAGE=wcr.io/oracle/mysql-operator
13+
AGENT_IMAGE=wcr.io/oracle/mysql-agent
14+
15+
function do_release() {
16+
echo "Creating release $RELEASE from existing version $SHA"
17+
18+
if git rev-parse "$RELEASE" >/dev/null 2>&1; then
19+
echo "Tag $RELEASE already exists. Doing nothing."
20+
exit 1
21+
fi
22+
23+
echo "Creating images"
24+
docker pull $OPERATOR_IMAGE:$SHA
25+
docker tag $OPERATOR_IMAGE:$SHA $OPERATOR_IMAGE:$RELEASE
26+
docker push $OPERATOR_IMAGE:$RELEASE
27+
28+
docker pull $AGENT_IMAGE:$SHA
29+
docker tag $AGENT_IMAGE:$SHA $AGENT_IMAGE:$RELEASE
30+
docker push $AGENT_IMAGE:$RELEASE
31+
32+
echo "Creating release tag $RELEASE"
33+
git tag -a "$RELEASE" -m "Release version: $RELEASE"
34+
git push --tags
35+
}
36+
37+
read -r -p "Are you sure you want to release ${SHA} as ${RELEASE}? [y/N] " response
38+
case "$response" in
39+
[yY][eE][sS]|[yY])
40+
do_release
41+
;;
42+
*)
43+
exit
44+
;;
45+
esac

mysql-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: mysql-operator
33
version: 0.1.0
4-
description: A Helm chart for deploying the Oracle mysql-operator
4+
description: A Helm chart for deploying the Oracle MySQL Operator
55
maintainers:
66
- name: Owain Lewis
77

mysql-operator/templates/03-deployment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ spec:
2121
prometheus.io/port: "8080"
2222
spec:
2323
serviceAccountName: mysql-operator
24-
imagePullSecrets:
25-
- name: {{ .Values.docker.pullSecret }}
2624
containers:
2725
- name: mysql-operator-controller
2826
imagePullPolicy: {{ .Values.image.pullPolicy }}

mysql-operator/values.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@ operator:
55
global: true
66
register_crd: true
77
image:
8-
tag: 0.3.0
8+
tag: 0.1.0
99
pullPolicy: Always
10-
docker:
11-
pullSecret: odx-docker-pull-secret

pkg/resources/statefulsets/statefulset.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,10 @@ func NewForCluster(cluster *api.MySQLCluster, images operatoropts.Images, servic
361361
// create service accounts and (cluster role bindings?)
362362
// for each namespace.
363363
ServiceAccountName: "mysql-agent",
364-
// TODO: Remove before open sourcing?
365-
ImagePullSecrets: []v1.LocalObjectReference{{Name: "odx-docker-pull-secret"}},
366-
NodeSelector: cluster.Spec.NodeSelector,
367-
Affinity: cluster.Spec.Affinity,
368-
Containers: containers,
369-
Volumes: podVolumes,
364+
NodeSelector: cluster.Spec.NodeSelector,
365+
Affinity: cluster.Spec.Affinity,
366+
Containers: containers,
367+
Volumes: podVolumes,
370368
},
371369
},
372370
ServiceName: serviceName,

0 commit comments

Comments
 (0)