Skip to content

Commit 680d333

Browse files
authored
Merge pull request #16 from alphagov/BAU-remove-samples-directory
BAU - Remove `samples` directory
2 parents ffcd54b + 87c95f9 commit 680d333

17 files changed

Lines changed: 44 additions & 175 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
/dist
77
/bin
88
/crds
9+
/samples

PROJECT

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
# and allow the plugins properly work.
44
# More info: https://book.kubebuilder.io/reference/project-config.html
55
cliVersion: 4.14.0
6-
domain: gov.uk
6+
domain: publishing.service.gov.uk
77
layout:
88
- go.kubebuilder.io/v4
99
plugins:
1010
helm.kubebuilder.io/v2-alpha:
1111
manifests: dist/install.yaml
1212
output: dist
1313
projectName: govuk-job-request-operator
14-
repo: platform/JobRequest
14+
repo: publishing.service.gov.uk/govuk-job-request-operator
1515
resources:
1616
- api:
1717
crdVersion: v1
1818
namespaced: true
1919
controller: true
20-
domain: gov.uk
20+
domain: publishing.service.gov.uk
2121
group: platform
2222
kind: JobRequest
23-
path: platform/JobRequest/api/v1
23+
path: publishing.service.gov.uk/govuk-job-request-operator/api/v1
2424
version: v1
2525
version: "3"

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ brew install k3d
1515
### Custom Resource Definition (CRD)
1616

1717
```
18-
apiVersion: platform.gov.uk/v1
18+
apiVersion: platform.service.publishing.gov.uk/v1
1919
kind: JobRequest
2020
metadata:
2121
labels:
@@ -56,21 +56,6 @@ This will run the controller locally and not in the cluster.
5656
make run
5757
```
5858

59-
2. Create a custom resource
60-
61-
Edit `platform_v1_jobrequest.yaml` to the following:
62-
63-
```
64-
spec:
65-
foo: bar
66-
```
67-
68-
3. Apply the resource
69-
70-
```
71-
kubectl apply -k config/samples
72-
```
73-
7459
### Run the controller in the cluster
7560

7661
1. Build the controller in a docker image
@@ -93,6 +78,28 @@ imagePullPolicy: IfNotPresent
9378
k3d image import controller:latest -c cluster
9479
```
9580

81+
4. Deploy the controller to the cluster
82+
83+
```
84+
make deploy
85+
```
86+
87+
### Create an instance of the CRD
88+
89+
```
90+
cat <<EOF | kubectl apply -f -
91+
apiVersion: platform.publishing.service.gov.uk/v1
92+
kind: JobRequest
93+
metadata:
94+
labels:
95+
app.kubernetes.io/name: govuk-job-request-operator
96+
app.kubernetes.io/managed-by: kustomize
97+
name: jobrequest-sample
98+
spec:
99+
foo: bar
100+
EOF
101+
```
102+
96103
### Generate Helm chart
97104

98105
1. Generate a Helm chart

cmd/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import (
3535
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
3636
"sigs.k8s.io/controller-runtime/pkg/webhook"
3737

38-
platformv1 "platform/JobRequest/api/v1"
39-
"platform/JobRequest/internal/controller"
38+
platformv1 "publishing.service.gov.uk/govuk-job-request-operator/api/v1"
39+
"publishing.service.gov.uk/govuk-job-request-operator/internal/controller"
4040
// +kubebuilder:scaffold:imports
4141
)
4242

@@ -160,7 +160,7 @@ func main() {
160160
WebhookServer: webhookServer,
161161
HealthProbeBindAddress: probeAddr,
162162
LeaderElection: enableLeaderElection,
163-
LeaderElectionID: "768c8ed3.gov.uk",
163+
LeaderElectionID: "768c8ed3.publishing.service.gov.uk",
164164
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
165165
// when the Manager ends. This requires the binary to immediately end when the
166166
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly

config/crd/bases/platform.gov.uk_jobrequests.yaml

Lines changed: 0 additions & 126 deletions
This file was deleted.

config/crd/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# since it depends on service name and namespace that are out of this kustomize package.
33
# It should be run by config/default
44
resources:
5-
- bases/platform.gov.uk_jobrequests.yaml
5+
- bases/platform.publishing.service.gov.uk_jobrequests.yaml
66
# +kubebuilder:scaffold:crdkustomizeresource
77

88
patches:

config/rbac/jobrequest_admin_role.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ metadata:
1414
name: jobrequest-admin-role
1515
rules:
1616
- apiGroups:
17-
- platform.gov.uk
17+
- platform.publishing.service.gov.uk
1818
resources:
1919
- jobrequests
2020
verbs:
2121
- '*'
2222
- apiGroups:
23-
- platform.gov.uk
23+
- platform.publishing.service.gov.uk
2424
resources:
2525
- jobrequests/status
2626
verbs:

config/rbac/jobrequest_editor_role.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ metadata:
1414
name: jobrequest-editor-role
1515
rules:
1616
- apiGroups:
17-
- platform.gov.uk
17+
- platform.publishing.service.gov.uk
1818
resources:
1919
- jobrequests
2020
verbs:
@@ -26,7 +26,7 @@ rules:
2626
- update
2727
- watch
2828
- apiGroups:
29-
- platform.gov.uk
29+
- platform.publishing.service.gov.uk
3030
resources:
3131
- jobrequests/status
3232
verbs:

config/rbac/jobrequest_viewer_role.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ metadata:
1414
name: jobrequest-viewer-role
1515
rules:
1616
- apiGroups:
17-
- platform.gov.uk
17+
- platform.publishing.service.gov.uk
1818
resources:
1919
- jobrequests
2020
verbs:
2121
- get
2222
- list
2323
- watch
2424
- apiGroups:
25-
- platform.gov.uk
25+
- platform.publishing.service.gov.uk
2626
resources:
2727
- jobrequests/status
2828
verbs:

config/samples/kustomization.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)