Skip to content

Commit 1eaa33a

Browse files
author
Cory Schwartz
committed
IpfsCluster rename
1 parent 48a3073 commit 1eaa33a

33 files changed

+202
-93
lines changed

PROJECT

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
controller: true
1414
domain: ipfs.io
1515
group: cluster
16-
kind: Ipfs
16+
kind: CircuitRelay
1717
path: github.com/redhat-et/ipfs-operator/api/v1alpha1
1818
version: v1alpha1
1919
- api:
@@ -22,7 +22,7 @@ resources:
2222
controller: true
2323
domain: ipfs.io
2424
group: cluster
25-
kind: CircuitRelay
25+
kind: IpfsCluster
2626
path: github.com/redhat-et/ipfs-operator/api/v1alpha1
2727
version: v1alpha1
2828
version: "3"

api/v1alpha1/ipfs_cluster_types.go api/v1alpha1/ipfscluster_types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type IpfsClusterSpec struct {
7878
Reprovider ReprovideSettings `json:"reprovider,omitempty"`
7979
}
8080

81-
type IpfsStatus struct {
81+
type IpfsClusterStatus struct {
8282
Conditions []metav1.Condition `json:"conditions,omitempty"`
8383
CircuitRelays []string `json:"circuitRelays,omitempty"`
8484
}
@@ -91,8 +91,8 @@ type IpfsCluster struct {
9191
metav1.TypeMeta `json:",inline"`
9292
metav1.ObjectMeta `json:"metadata,omitempty"`
9393

94-
Spec IpfsClusterSpec `json:"spec,omitempty"`
95-
Status IpfsStatus `json:"status,omitempty"`
94+
Spec IpfsClusterSpec `json:"spec,omitempty"`
95+
Status IpfsClusterStatus `json:"status,omitempty"`
9696
}
9797

9898
//+kubebuilder:object:root=true

api/v1alpha1/zz_generated.deepcopy.go

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
66
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=ipfs-operator
88
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
9-
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.19.0+git
9+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-unknown
1010
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1111
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
1212

bundle/manifests/cluster.ipfs.io_circuitrelays.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
- name: v1alpha1
1818
schema:
1919
openAPIV3Schema:
20-
description: CircuitRelay is the Schema for the circuitrelays API
20+
description: CircuitRelay is the Schema for the circuitrelays API.
2121
properties:
2222
apiVersion:
2323
description: 'APIVersion defines the versioned schema of this representation
@@ -36,7 +36,7 @@ spec:
3636
status:
3737
properties:
3838
addrInfo:
39-
description: This is intended to mimic peer.AddrInfo
39+
description: This is intended to mimic peer.AddrInfo.
4040
properties:
4141
addrs:
4242
items:

bundle/manifests/cluster.ipfs.io_ipfs.yaml bundle/manifests/cluster.ipfs.io_ipfsclusters.yaml

+43-10
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ metadata:
44
annotations:
55
controller-gen.kubebuilder.io/version: v0.8.0
66
creationTimestamp: null
7-
name: ipfs.cluster.ipfs.io
7+
name: ipfsclusters.cluster.ipfs.io
88
spec:
99
group: cluster.ipfs.io
1010
names:
11-
kind: Ipfs
12-
listKind: IpfsList
13-
plural: ipfs
14-
singular: ipfs
11+
kind: IpfsCluster
12+
listKind: IpfsClusterList
13+
plural: ipfsclusters
14+
singular: ipfscluster
1515
scope: Namespaced
1616
versions:
1717
- name: v1alpha1
1818
schema:
1919
openAPIV3Schema:
20-
description: Ipfs is the Schema for the ipfs API
20+
description: IpfsCluster is the Schema for the ipfs API.
2121
properties:
2222
apiVersion:
2323
description: 'APIVersion defines the versioned schema of this representation
@@ -35,8 +35,24 @@ spec:
3535
properties:
3636
clusterStorage:
3737
type: string
38+
follows:
39+
items:
40+
properties:
41+
name:
42+
type: string
43+
template:
44+
type: string
45+
required:
46+
- name
47+
- template
48+
type: object
49+
type: array
3850
ipfsStorage:
39-
type: string
51+
anyOf:
52+
- type: integer
53+
- type: string
54+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
55+
x-kubernetes-int-or-string: true
4056
networking:
4157
properties:
4258
circuitRelays:
@@ -50,15 +66,32 @@ spec:
5066
replicas:
5167
format: int32
5268
type: integer
69+
reprovider:
70+
description: Reprovider Describes the settings that each IPFS node
71+
should use when reproviding content.
72+
properties:
73+
interval:
74+
description: Interval sets the time between rounds of reproviding
75+
local content to the routing system. Defaults to '12h'.
76+
type: string
77+
strategy:
78+
description: Strategy specifies the reprovider strategy, defaults
79+
to 'all'.
80+
enum:
81+
- all
82+
- pinned
83+
- roots
84+
type: string
85+
type: object
5386
url:
5487
type: string
5588
required:
5689
- clusterStorage
90+
- follows
5791
- ipfsStorage
5892
- networking
5993
- public
6094
- replicas
61-
- url
6295
type: object
6396
status:
6497
properties:
@@ -71,8 +104,8 @@ spec:
71104
description: "Condition contains details for one aspect of the current
72105
state of this API Resource. --- This struct is intended for direct
73106
use as an array at the field path .status.conditions. For example,
74-
type FooStatus struct{ // Represents the observations of a foo's
75-
current state. // Known .status.conditions.type are: \"Available\",
107+
\n type FooStatus struct{ // Represents the observations of a
108+
foo's current state. // Known .status.conditions.type are: \"Available\",
76109
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
77110
// +listType=map // +listMapKey=type Conditions []metav1.Condition
78111
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"

bundle/manifests/ipfs-operator.clusterserviceversion.yaml

+13-18
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,31 @@ metadata:
1414
},
1515
{
1616
"apiVersion": "cluster.ipfs.io/v1alpha1",
17-
"kind": "Ipfs",
17+
"kind": "IpfsCluster",
1818
"metadata": {
19-
"name": "ipfs-sample-1"
19+
"name": "ipfscluster-sample"
2020
},
21-
"spec": {
22-
"clusterStorage": "42Gi",
23-
"ipfsStorage": "32Gi",
24-
"public": true,
25-
"url": "apps.ci-ln-fy6ygqt-72292.origin-ci-int-gce.dev.rhcloud.com"
26-
}
21+
"spec": null
2722
}
2823
]
2924
capabilities: Basic Install
30-
operators.operatorframework.io/builder: operator-sdk-v1.19.0+git
25+
operators.operatorframework.io/builder: operator-sdk-unknown
3126
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
3227
name: ipfs-operator.v0.0.1
3328
namespace: placeholder
3429
spec:
3530
apiservicedefinitions: {}
3631
customresourcedefinitions:
3732
owned:
38-
- description: CircuitRelay is the Schema for the circuitrelays API
33+
- description: CircuitRelay is the Schema for the circuitrelays API.
3934
displayName: Circuit Relay
4035
kind: CircuitRelay
4136
name: circuitrelays.cluster.ipfs.io
4237
version: v1alpha1
43-
- description: Ipfs is the Schema for the ipfs API
44-
displayName: Ipfs
45-
kind: Ipfs
46-
name: ipfs.cluster.ipfs.io
38+
- description: IpfsCluster is the Schema for the ipfs API.
39+
displayName: Ipfs Cluster
40+
kind: IpfsCluster
41+
name: ipfsclusters.cluster.ipfs.io
4742
version: v1alpha1
4843
description: Operator for IPFS clustering
4944
displayName: ipfs
@@ -114,7 +109,7 @@ spec:
114109
- apiGroups:
115110
- cluster.ipfs.io
116111
resources:
117-
- ipfs
112+
- ipfsclusters
118113
verbs:
119114
- create
120115
- delete
@@ -126,13 +121,13 @@ spec:
126121
- apiGroups:
127122
- cluster.ipfs.io
128123
resources:
129-
- ipfs/finalizers
124+
- ipfsclusters/finalizers
130125
verbs:
131126
- update
132127
- apiGroups:
133128
- cluster.ipfs.io
134129
resources:
135-
- ipfs/status
130+
- ipfsclusters/status
136131
verbs:
137132
- get
138133
- patch
@@ -264,7 +259,7 @@ spec:
264259
- --leader-elect
265260
command:
266261
- /manager
267-
image: quay.io/redhat-et-ipfs/ipfs-operator:v0.0.1
262+
image: coryschwartz/ipfs-operator:v0.0.1
268263
imagePullPolicy: IfNotPresent
269264
livenessProbe:
270265
httpGet:

bundle/metadata/annotations.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ annotations:
55
operators.operatorframework.io.bundle.metadata.v1: metadata/
66
operators.operatorframework.io.bundle.package.v1: ipfs-operator
77
operators.operatorframework.io.bundle.channels.v1: alpha
8-
operators.operatorframework.io.metrics.builder: operator-sdk-v1.19.0+git
8+
operators.operatorframework.io.metrics.builder: operator-sdk-unknown
99
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
1010
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
1111

config/crd/bases/cluster.ipfs.io_ipfs.yaml config/crd/bases/cluster.ipfs.io_ipfsclusters.yaml

+13-9
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.8.0
77
creationTimestamp: null
8-
name: ipfs.cluster.ipfs.io
8+
name: ipfsclusters.cluster.ipfs.io
99
spec:
1010
group: cluster.ipfs.io
1111
names:
12-
kind: Ipfs
13-
listKind: IpfsList
14-
plural: ipfs
15-
singular: ipfs
12+
kind: IpfsCluster
13+
listKind: IpfsClusterList
14+
plural: ipfsclusters
15+
singular: ipfscluster
1616
scope: Namespaced
1717
versions:
1818
- name: v1alpha1
1919
schema:
2020
openAPIV3Schema:
21-
description: Ipfs is the Schema for the ipfs API.
21+
description: IpfsCluster is the Schema for the ipfs API.
2222
properties:
2323
apiVersion:
2424
description: 'APIVersion defines the versioned schema of this representation
@@ -49,7 +49,11 @@ spec:
4949
type: object
5050
type: array
5151
ipfsStorage:
52-
type: string
52+
anyOf:
53+
- type: integer
54+
- type: string
55+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
56+
x-kubernetes-int-or-string: true
5357
networking:
5458
properties:
5559
circuitRelays:
@@ -101,8 +105,8 @@ spec:
101105
description: "Condition contains details for one aspect of the current
102106
state of this API Resource. --- This struct is intended for direct
103107
use as an array at the field path .status.conditions. For example,
104-
type FooStatus struct{ // Represents the observations of a foo's
105-
current state. // Known .status.conditions.type are: \"Available\",
108+
\n type FooStatus struct{ // Represents the observations of a
109+
foo's current state. // Known .status.conditions.type are: \"Available\",
106110
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
107111
// +listType=map // +listMapKey=type Conditions []metav1.Condition
108112
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"

config/crd/kustomization.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
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/cluster.ipfs.io_ipfs.yaml
65
- bases/cluster.ipfs.io_circuitrelays.yaml
6+
- bases/cluster.ipfs.io_ipfsclusters.yaml
77
#+kubebuilder:scaffold:crdkustomizeresource
88

99
patchesStrategicMerge:
1010
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1111
# patches here are for enabling the conversion webhook for each CRD
1212
#- patches/webhook_in_ipfs.yaml
1313
#- patches/webhook_in_circuitrelays.yaml
14+
#- patches/webhook_in_ipfsclusters.yaml
1415
#+kubebuilder:scaffold:crdkustomizewebhookpatch
1516

1617
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
1718
# patches here are for enabling the CA injection for each CRD
1819
#- patches/cainjection_in_ipfs.yaml
1920
#- patches/cainjection_in_circuitrelays.yaml
21+
#- patches/cainjection_in_ipfsclusters.yaml
2022
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
2123

2224
# the following config is for teaching kustomize how to do kustomization for CRDs.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# The following patch adds a directive for certmanager to inject CA into the CRD
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
7+
name: ipfsclusters.cluster.ipfs.io
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# The following patch enables a conversion webhook for the CRD
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
name: ipfsclusters.cluster.ipfs.io
6+
spec:
7+
conversion:
8+
strategy: Webhook
9+
webhook:
10+
clientConfig:
11+
service:
12+
namespace: system
13+
name: webhook-service
14+
path: /convert
15+
conversionReviewVersions:
16+
- v1

config/manager/kustomization.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
1212
kind: Kustomization
1313
images:
1414
- name: controller
15-
newName: quay.io/redhat-et-ipfs/ipfs-operator
15+
newName: coryschwartz/ipfs-operator

0 commit comments

Comments
 (0)