Skip to content

Commit 80ae6af

Browse files
stubbiclaude
andcommitted
feat: rename CRD Kind to Instance (instances.paperclip.inc)
Rename PaperclipInstance -> Instance since the API group paperclip.inc already provides the namespace. CRD is now instances.paperclip.inc. - Kind: Instance - Plural: instances - API: paperclip.inc/v1alpha1 - Short name: pci Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1969e93 commit 80ae6af

37 files changed

Lines changed: 373 additions & 376 deletions

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
# Detect bare r.Update/r.Create calls in the controller that bypass
4040
# controllerutil.CreateOrUpdate. Only r.Update(ctx, instance) and
4141
# r.Status().Update(ctx, instance) are allowed (CR-level updates).
42-
VIOLATIONS=$(grep -n 'r\.Update(ctx,' internal/controller/paperclipinstance_controller.go \
42+
VIOLATIONS=$(grep -n 'r\.Update(ctx,' internal/controller/instance_controller.go \
4343
| grep -v 'instance)' \
4444
| grep -v '// reconcile-guard:allow' || true)
4545
if [ -n "$VIOLATIONS" ]; then
@@ -230,7 +230,7 @@ jobs:
230230
run: |
231231
echo "=== Operator pod status ==="
232232
kubectl get pods -n paperclip-operator-system
233-
echo "=== PaperclipInstance resources ==="
234-
kubectl get paperclipinstances -A -o wide || true
233+
echo "=== Instance resources ==="
234+
kubectl get instances -A -o wide || true
235235
echo "=== Operator logs (all) ==="
236236
kubectl logs -n paperclip-operator-system -l control-plane=controller-manager --tail=-1 || true

.github/workflows/operatorhub.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545
> "${BUNDLE_DIR}/manifests/paperclip-operator.v${VERSION}.clusterserviceversion.yaml"
4646
4747
# Copy CRD and metadata as-is
48-
cp bundle/manifests/paperclip.inc_paperclipinstances.yaml "${BUNDLE_DIR}/manifests/" 2>/dev/null || \
49-
cp config/crd/bases/paperclip.inc_paperclipinstances.yaml "${BUNDLE_DIR}/manifests/"
48+
cp bundle/manifests/paperclip.inc_instances.yaml "${BUNDLE_DIR}/manifests/" 2>/dev/null || \
49+
cp config/crd/bases/paperclip.inc_instances.yaml "${BUNDLE_DIR}/manifests/"
5050
cp bundle/metadata/annotations.yaml "${BUNDLE_DIR}/metadata/"
5151
5252
echo "Bundle prepared at ${BUNDLE_DIR}:"

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Features
66

77
* Initial release of the Paperclip Kubernetes Operator
8-
* PaperclipInstance CRD with comprehensive configuration (image, database, auth, storage, networking, security, scaling, observability)
8+
* Instance CRD with comprehensive configuration (image, database, auth, storage, networking, security, scaling, observability)
99
* Managed PostgreSQL mode with auto-generated credentials
1010
* External database support via connection string or Secret reference
1111
* Persistent storage with configurable PVC

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ go vet ./... # Go vet check
2929
## Architecture
3030

3131
```
32-
api/v1alpha1/ -> CRD types (PaperclipInstance)
32+
api/v1alpha1/ -> CRD types (Instance)
3333
internal/controller/ -> Reconciliation logic (single controller + metrics)
3434
internal/resources/ -> Pure resource builder functions (StatefulSet, Service, etc.)
3535
config/crd/bases/ -> Generated CRD YAML (committed to git)
3636
charts/ -> Helm chart (CRDs as templates in templates/crds/)
3737
bundle/ -> OLM bundle for OperatorHub submissions
38-
config/samples/ -> Example PaperclipInstance CRs
38+
config/samples/ -> Example Instance CRs
3939
hack/ -> Build/sync scripts (sync-chart-crds.sh, check-helm-rbac-sync.sh)
4040
.github/workflows/ -> CI/CD pipelines
4141
```
@@ -137,7 +137,7 @@ git worktree remove ../paperclip-operator-<suffix>
137137
```
138138

139139
### CRD API changes
140-
After modifying types in `api/v1alpha1/paperclipinstance_types.go`:
140+
After modifying types in `api/v1alpha1/instance_types.go`:
141141
1. Run `make generate` (regenerates `zz_generated.deepcopy.go`)
142142
2. Run `make manifests` (regenerates CRD YAML in `config/crd/bases/`)
143143
3. Run `make sync-chart-crds` (syncs CRDs into Helm chart templates)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Use [Conventional Commits](https://www.conventionalcommits.org/):
109109

110110
### CRD API Changes
111111

112-
After modifying types in `api/v1alpha1/paperclipinstance_types.go`:
112+
After modifying types in `api/v1alpha1/instance_types.go`:
113113
1. Run `make generate` (regenerates deepcopy methods)
114114
2. Run `make manifests` (regenerates CRD YAML)
115115
3. Run `make sync-chart-crds` (syncs CRDs into Helm chart)

PROJECT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ resources:
1717
controller: true
1818
domain: inc
1919
group: paperclip
20-
kind: PaperclipInstance
20+
kind: Instance
2121
path: github.com/stubbi/paperclip-operator/api/v1alpha1
2222
version: v1alpha1
2323
version: "3"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ kubectl apply -f https://github.com/stubbi/paperclip-operator/releases/latest/do
2929

3030
```yaml
3131
apiVersion: paperclip.inc/v1alpha1
32-
kind: PaperclipInstance
32+
kind: Instance
3333
metadata:
3434
name: my-paperclip
3535
spec:
@@ -59,7 +59,7 @@ kubectl apply -f my-paperclip.yaml
5959
### Check status
6060

6161
```bash
62-
kubectl get paperclipinstances
62+
kubectl get instances
6363
# or shorthand:
6464
kubectl get pci
6565
```

api/v1alpha1/paperclipinstance_types.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import (
2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
)
2424

25-
// PaperclipInstanceSpec defines the desired state of a Paperclip instance.
26-
type PaperclipInstanceSpec struct {
25+
// InstanceSpec defines the desired state of a Paperclip instance.
26+
type InstanceSpec struct {
2727
// Image specifies the Paperclip container image to deploy.
2828
// +optional
2929
Image ImageSpec `json:"image,omitempty"`
@@ -615,27 +615,27 @@ type BackupS3Spec struct {
615615

616616
// --- Status types ---
617617

618-
// PaperclipInstancePhase describes the phase of a PaperclipInstance.
618+
// InstancePhase describes the phase of a Instance.
619619
// +kubebuilder:validation:Enum=Pending;Provisioning;Running;Degraded;Failed;Terminating;BackingUp;Restoring;Updating
620-
type PaperclipInstancePhase string
620+
type InstancePhase string
621621

622622
const (
623-
PhasePending PaperclipInstancePhase = "Pending"
624-
PhaseProvisioning PaperclipInstancePhase = "Provisioning"
625-
PhaseRunning PaperclipInstancePhase = "Running"
626-
PhaseDegraded PaperclipInstancePhase = "Degraded"
627-
PhaseFailed PaperclipInstancePhase = "Failed"
628-
PhaseTerminating PaperclipInstancePhase = "Terminating"
629-
PhaseBackingUp PaperclipInstancePhase = "BackingUp"
630-
PhaseRestoring PaperclipInstancePhase = "Restoring"
631-
PhaseUpdating PaperclipInstancePhase = "Updating"
623+
PhasePending InstancePhase = "Pending"
624+
PhaseProvisioning InstancePhase = "Provisioning"
625+
PhaseRunning InstancePhase = "Running"
626+
PhaseDegraded InstancePhase = "Degraded"
627+
PhaseFailed InstancePhase = "Failed"
628+
PhaseTerminating InstancePhase = "Terminating"
629+
PhaseBackingUp InstancePhase = "BackingUp"
630+
PhaseRestoring InstancePhase = "Restoring"
631+
PhaseUpdating InstancePhase = "Updating"
632632
)
633633

634-
// PaperclipInstanceStatus defines the observed state of PaperclipInstance.
635-
type PaperclipInstanceStatus struct {
634+
// InstanceStatus defines the observed state of Instance.
635+
type InstanceStatus struct {
636636
// Phase is the current phase of the instance.
637637
// +optional
638-
Phase PaperclipInstancePhase `json:"phase,omitempty"`
638+
Phase InstancePhase `json:"phase,omitempty"`
639639

640640
// ObservedGeneration is the most recent generation observed by the controller.
641641
// +optional
@@ -715,24 +715,24 @@ type RestoreStatus struct {
715715
// +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.status.endpoint`
716716
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
717717

718-
// PaperclipInstance is the Schema for the paperclipinstances API.
719-
type PaperclipInstance struct {
718+
// Instance is the Schema for the instances API.
719+
type Instance struct {
720720
metav1.TypeMeta `json:",inline"`
721721
metav1.ObjectMeta `json:"metadata,omitempty"`
722722

723-
Spec PaperclipInstanceSpec `json:"spec,omitempty"`
724-
Status PaperclipInstanceStatus `json:"status,omitempty"`
723+
Spec InstanceSpec `json:"spec,omitempty"`
724+
Status InstanceStatus `json:"status,omitempty"`
725725
}
726726

727727
// +kubebuilder:object:root=true
728728

729-
// PaperclipInstanceList contains a list of PaperclipInstance.
730-
type PaperclipInstanceList struct {
729+
// InstanceList contains a list of Instance.
730+
type InstanceList struct {
731731
metav1.TypeMeta `json:",inline"`
732732
metav1.ListMeta `json:"metadata,omitempty"`
733-
Items []PaperclipInstance `json:"items"`
733+
Items []Instance `json:"items"`
734734
}
735735

736736
func init() {
737-
SchemeBuilder.Register(&PaperclipInstance{}, &PaperclipInstanceList{})
737+
SchemeBuilder.Register(&Instance{}, &InstanceList{})
738738
}

0 commit comments

Comments
 (0)