Skip to content

Commit d526218

Browse files
Assorted improvements (#3)
1 parent 66e4533 commit d526218

9 files changed

Lines changed: 62 additions & 98 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ tags
7575
.vscode/*
7676
.history
7777
# End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
78-
controller
78+
operator
7979
/vendor
8080
.idea

.project-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.3
1+
0.0.4

README.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Delete stale feature branches in your `Kubernetes` cluster.
1717
* [Docker Image](#docker-image)
1818
* [Contributing](#contributing)
1919
* [Code Style](#code-style)
20+
* [Testing](#testing)
2021
* [Custom Resource Definitions](#custom-resource-definitions)
2122

2223
## Getting Started
@@ -77,22 +78,17 @@ for development and maintenance.
7778

7879
## Installation
7980

80-
Define the project's version with the operator version's environment variable. The full list of versions is available
81-
[here](https://github.com/dmytrostriletskyi/stale-feature-branch-operator/releases).
82-
83-
```bash
84-
$ export OPERATOR_VERSION=0.0.3
85-
```
86-
87-
Once you applied the configurations with the command below, it will create the `StaleFeatureBranch` resource, install
88-
the operator into `stale-feature-branch` namespace, create a [service account](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/)
81+
Apply the latest release configurations with the command below, it will create the `StaleFeatureBranch` resource,
82+
install the operator into `stale-feature-branch-operator` namespace, create a [service account](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/)
8983
and necessary [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac) roles.
9084

9185
```bash
9286
$ kubectl apply -f \
93-
https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/v${OPERATOR_VERSION}/configs/production.yml
87+
https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/master/configs/production.yml
9488
```
9589

90+
If you need any previous release, full list of versions is available [here](https://github.com/dmytrostriletskyi/stale-feature-branch-operator/releases).
91+
9692
## Usage
9793

9894
To delete stale feature branches, after applying installation instructions above, create a configuration file with
@@ -156,17 +152,18 @@ Switched to context "minikube".
156152

157153
Applied configurations in the same way you apply it to a production cluster. But as it's production configurations, they
158154
will expect old namespaces present in your cluster. Our cluster is fresh, and no old resources are present there.
159-
As you do not have them, the operator allows you to specify the debug setting. If the debug setting is enabled, all
155+
As you do not have them, the operator allows you to specify the debug parameter. If the debug is enabled, all
160156
namespaces will be deleted without checking for an oldness:
161157

162158
Copy the production configurations to your personal computer:
163159

164160
```bash
165-
$ export OPERATOR_VERSION=0.0.3
166-
$ curl https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/v${OPERATOR_VERSION}/configs/production.yml > \
161+
$ curl https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/master/configs/production.yml > \
167162
stale-feature-branch-production-configs.yml
168163
```
169164

165+
If you need any previous release, full list of versions is available [here](https://github.com/dmytrostriletskyi/stale-feature-branch-operator/releases).
166+
170167
Enable debug by changing the setting. For `Linux` it's:
171168

172169
```bash
@@ -218,8 +215,8 @@ as well (deployment, service, secrets, etc.).:
218215

219216
```bash
220217
$ kubectl apply \
221-
-f https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/v${OPERATOR_VERSION}/fixtures/first-feature-branch.yml \
222-
-f https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/v${OPERATOR_VERSION}/fixtures/second-feature-branch.yml
218+
-f https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/master/fixtures/first-feature-branch.yml \
219+
-f https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/master/fixtures/second-feature-branch.yml
223220
namespace/project-pr-1 created
224221
deployment.apps/project-pr-1 created
225222
service/project-pr-1 created
@@ -256,7 +253,7 @@ we create `StaleFeatureBranch` configurations, the namespaces will be deleted im
256253

257254
```bash
258255
$ kubectl apply -f \
259-
https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/v${OPERATOR_VERSION}/fixtures/stale-feature-branch.yml
256+
https://raw.githubusercontent.com/dmytrostriletskyi/stale-feature-branch-operator/master/fixtures/stale-feature-branch.yml
260257
```
261258

262259
After, check the logs of the operator, and you will that namespaces are deleted:

configs/production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ spec:
8282
serviceAccountName: stale-feature-branch-operator
8383
containers:
8484
- name: stale-feature-branch-operator
85-
image: dmytrostriletskyi/stale-feature-branch-operator:v0.0.3
85+
image: dmytrostriletskyi/stale-feature-branch-operator:v0.0.4
8686
imagePullPolicy: Always
8787
env:
8888
- name: OPERATOR_NAME

go.mod

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ module github.com/dmytrostriletskyi/stale-feature-branch-operator
33
go 1.13
44

55
require (
6-
github.com/stretchr/testify v1.6.1
7-
github.com/operator-framework/operator-sdk v0.18.1
8-
github.com/spf13/pflag v1.0.5
9-
k8s.io/api v0.18.2
10-
k8s.io/apimachinery v0.18.2
11-
k8s.io/client-go v12.0.0+incompatible
12-
sigs.k8s.io/controller-runtime v0.6.0
6+
github.com/operator-framework/operator-sdk v0.18.1
7+
github.com/stretchr/testify v1.6.1
8+
k8s.io/api v0.18.2
9+
k8s.io/apimachinery v0.18.2
10+
k8s.io/client-go v12.0.0+incompatible
11+
sigs.k8s.io/controller-runtime v0.6.0
1312
)
1413

1514
replace (

0 commit comments

Comments
 (0)