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

Commit 977db3c

Browse files
committed
rename all the things
1 parent 9b0a78f commit 977db3c

32 files changed

+172
-224
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ help: ## Display this help.
4343

4444
.PHONY: manifests
4545
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
46-
$(CONTROLLER_GEN) rbac:roleName=git-sync-controller-manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
46+
$(CONTROLLER_GEN) rbac:roleName=git-controller-manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
4747

4848
.PHONY: generate
4949
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

PROJECT

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
domain: ocm.software
22
layout:
33
- go.kubebuilder.io/v3
4-
projectName: git-sync-controller
5-
repo: github.com/open-component-model/git-sync-controller
4+
projectName: git-controller
5+
repo: github.com/open-component-model/git-controller
66
resources:
77
- api:
88
crdVersion: v1
99
namespaced: true
1010
controller: true
1111
domain: ocm.software
1212
group: delivery
13-
kind: GitSync
14-
path: github.com/open-component-model/git-sync-controller/api/v1alpha1
13+
kind: Sync
14+
path: github.com/open-component-model/git-controller/api/v1alpha1
1515
version: v1alpha1
1616
version: "3"

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# git-sync-controller
1+
# git-controller
22
// TODO(user): Add simple overview of use/purpose
33

44
## Description
@@ -16,15 +16,15 @@ kubectl apply -f config/samples/
1616
```
1717

1818
2. Build and push your image to the location specified by `IMG`:
19-
19+
2020
```sh
21-
make docker-build docker-push IMG=<some-registry>/git-sync-controller:tag
21+
make docker-build docker-push IMG=<some-registry>/git-controller:tag
2222
```
23-
23+
2424
3. Deploy the controller to the cluster with the image specified by `IMG`:
2525

2626
```sh
27-
make deploy IMG=<some-registry>/git-sync-controller:tag
27+
make deploy IMG=<some-registry>/git-controller:tag
2828
```
2929

3030
### Uninstall CRDs
@@ -47,8 +47,8 @@ make undeploy
4747
### How it works
4848
This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
4949

50-
It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
51-
which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
50+
It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)
51+
which provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster
5252

5353
### Test It Out
5454
1. Install the CRDs into the cluster:

Tiltfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install = kustomize('config/default')
1313
# running process.
1414
objects = decode_yaml_stream(install)
1515
for o in objects:
16-
if o.get('kind') == 'Deployment' and o.get('metadata').get('name') == 'git-sync-controller':
16+
if o.get('kind') == 'Deployment' and o.get('metadata').get('name') == 'git-controller':
1717
o['spec']['template']['spec']['securityContext']['runAsNonRoot'] = False
1818
break
1919

@@ -33,7 +33,7 @@ load('ext://restart_process', 'docker_build_with_restart')
3333
# Once done, rebuilding now should be a lot faster since only the relevant
3434
# binary is rebuilt and the hot swat wrapper takes care of the rest.
3535
local_resource(
36-
'git-sync-controller-binary',
36+
'git-controller-binary',
3737
'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/manager ./',
3838
deps = [
3939
"main.go",
@@ -54,7 +54,7 @@ local_resource(
5454
entrypoint = ['/manager']
5555
dockerfile = 'tilt.dockerfile'
5656
docker_build_with_restart(
57-
'ghcr.io/open-component-model/git-sync-controller',
57+
'ghcr.io/open-component-model/git-controller',
5858
'.',
5959
dockerfile = dockerfile,
6060
entrypoint = entrypoint,

api/v1alpha1/gitsync_types.go renamed to api/v1alpha1/sync_types.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ type CommitTemplate struct {
2424
Message string `json:"message"`
2525
}
2626

27-
// GitSyncSpec defines the desired state of GitSync
28-
type GitSyncSpec struct {
27+
// SyncSpec defines the desired state of Sync
28+
type SyncSpec struct {
2929
SnapshotRef Ref `json:"snapshotRef"`
3030
Interval metav1.Duration `json:"interval"`
3131
URL string `json:"url"`
@@ -36,8 +36,8 @@ type GitSyncSpec struct {
3636
Prune bool `json:"prune,omitempty"`
3737
}
3838

39-
// GitSyncStatus defines the observed state of GitSync
40-
type GitSyncStatus struct {
39+
// SyncStatus defines the observed state of Sync
40+
type SyncStatus struct {
4141
Digest string `json:"digest,omitempty"`
4242

4343
// ObservedGeneration is the last reconciled generation.
@@ -50,42 +50,42 @@ type GitSyncStatus struct {
5050
}
5151

5252
// GetConditions returns the conditions of the ComponentVersion.
53-
func (in *GitSync) GetConditions() []metav1.Condition {
53+
func (in *Sync) GetConditions() []metav1.Condition {
5454
return in.Status.Conditions
5555
}
5656

5757
// SetConditions sets the conditions of the ComponentVersion.
58-
func (in *GitSync) SetConditions(conditions []metav1.Condition) {
58+
func (in *Sync) SetConditions(conditions []metav1.Condition) {
5959
in.Status.Conditions = conditions
6060
}
6161

6262
// GetRequeueAfter returns the duration after which the ComponentVersion must be
6363
// reconciled again.
64-
func (in GitSync) GetRequeueAfter() time.Duration {
64+
func (in Sync) GetRequeueAfter() time.Duration {
6565
return in.Spec.Interval.Duration
6666
}
6767

6868
//+kubebuilder:object:root=true
6969
//+kubebuilder:subresource:status
7070

71-
// GitSync is the Schema for the gitsyncs API
72-
type GitSync struct {
71+
// Sync is the Schema for the syncs API
72+
type Sync struct {
7373
metav1.TypeMeta `json:",inline"`
7474
metav1.ObjectMeta `json:"metadata,omitempty"`
7575

76-
Spec GitSyncSpec `json:"spec,omitempty"`
77-
Status GitSyncStatus `json:"status,omitempty"`
76+
Spec SyncSpec `json:"spec,omitempty"`
77+
Status SyncStatus `json:"status,omitempty"`
7878
}
7979

8080
//+kubebuilder:object:root=true
8181

82-
// GitSyncList contains a list of GitSync
83-
type GitSyncList struct {
82+
// SyncList contains a list of Sync
83+
type SyncList struct {
8484
metav1.TypeMeta `json:",inline"`
8585
metav1.ListMeta `json:"metadata,omitempty"`
86-
Items []GitSync `json:"items"`
86+
Items []Sync `json:"items"`
8787
}
8888

8989
func init() {
90-
SchemeBuilder.Register(&GitSync{}, &GitSyncList{})
90+
SchemeBuilder.Register(&Sync{}, &SyncList{})
9191
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 37 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/delivery.ocm.software_gitsyncs.yaml renamed to config/crd/bases/delivery.ocm.software_syncs.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.9.2
77
creationTimestamp: null
8-
name: gitsyncs.delivery.ocm.software
8+
name: syncs.delivery.ocm.software
99
spec:
1010
group: delivery.ocm.software
1111
names:
12-
kind: GitSync
13-
listKind: GitSyncList
14-
plural: gitsyncs
15-
singular: gitsync
12+
kind: Sync
13+
listKind: SyncList
14+
plural: syncs
15+
singular: sync
1616
scope: Namespaced
1717
versions:
1818
- name: v1alpha1
1919
schema:
2020
openAPIV3Schema:
21-
description: GitSync is the Schema for the gitsyncs API
21+
description: Sync is the Schema for the syncs API
2222
properties:
2323
apiVersion:
2424
description: 'APIVersion defines the versioned schema of this representation
@@ -33,7 +33,7 @@ spec:
3333
metadata:
3434
type: object
3535
spec:
36-
description: GitSyncSpec defines the desired state of GitSync
36+
description: SyncSpec defines the desired state of Sync
3737
properties:
3838
authRef:
3939
description: Ref defines a name and namespace ref to any object.
@@ -92,7 +92,7 @@ spec:
9292
- url
9393
type: object
9494
status:
95-
description: GitSyncStatus defines the observed state of GitSync
95+
description: SyncStatus defines the observed state of Sync
9696
properties:
9797
conditions:
9898
items:

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/delivery.ocm.software_gitsyncs.yaml
5+
- bases/delivery.ocm.software_syncs.yaml
66
#+kubebuilder:scaffold:crdkustomizeresource
77

88
# the following config is for teaching kustomize how to do kustomization for CRDs.

0 commit comments

Comments
 (0)