Skip to content

Commit 2ef9b05

Browse files
authored
Merge pull request #5 from coryschwartz/cory/x
various
2 parents 2e60f90 + ef603fe commit 2ef9b05

File tree

291 files changed

+38683
-698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+38683
-698
lines changed

api/v1alpha1/ipfs_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ const (
3333

3434
type IpfsSpec struct {
3535
URL string `json:"url"`
36+
Public bool `json:"public"`
3637
IpfsStorage string `json:"ipfsStorage"`
3738
ClusterStorage string `json:"clusterStorage"`
38-
Public bool `json:"public"`
39+
Replicas int32 `json:"replicas"`
3940
}
4041

4142
type IpfsStatus struct {
4243
Conditions []metav1.Condition `json:"conditions,omitempty"`
43-
Address string `json:"address,omitempty"`
44+
Addresses []string `json:"addresses,omitempty"`
4445
}
4546

4647
//+kubebuilder:object:root=true

api/v1alpha1/zz_generated.deepcopy.go

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

bundle.Dockerfile

Lines changed: 1 addition & 1 deletion
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.18.0+git
9+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.19.0+git
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_ipfs.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,24 @@ spec:
3939
type: string
4040
public:
4141
type: boolean
42+
replicas:
43+
format: int32
44+
type: integer
4245
url:
4346
type: string
4447
required:
4548
- clusterStorage
4649
- ipfsStorage
4750
- public
51+
- replicas
4852
- url
4953
type: object
5054
status:
5155
properties:
52-
address:
53-
type: string
56+
addresses:
57+
items:
58+
type: string
59+
type: array
5460
conditions:
5561
items:
5662
description: "Condition contains details for one aspect of the current

bundle/manifests/ipfs-operator.clusterserviceversion.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ metadata:
1919
}
2020
]
2121
capabilities: Basic Install
22-
operators.operatorframework.io/builder: operator-sdk-v1.18.0+git
22+
operators.operatorframework.io/builder: operator-sdk-v1.19.0+git
2323
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
2424
name: ipfs-operator.v0.0.1
2525
namespace: placeholder
@@ -86,6 +86,18 @@ spec:
8686
- get
8787
- patch
8888
- update
89+
- apiGroups:
90+
- ""
91+
resources:
92+
- configmaps
93+
verbs:
94+
- create
95+
- delete
96+
- get
97+
- list
98+
- patch
99+
- update
100+
- watch
89101
- apiGroups:
90102
- ""
91103
resources:
@@ -98,6 +110,18 @@ spec:
98110
- patch
99111
- update
100112
- watch
113+
- apiGroups:
114+
- ""
115+
resources:
116+
- secrets
117+
verbs:
118+
- create
119+
- delete
120+
- get
121+
- list
122+
- patch
123+
- update
124+
- watch
101125
- apiGroups:
102126
- ""
103127
resources:
@@ -148,7 +172,9 @@ spec:
148172
- create
149173
serviceAccountName: ipfs-operator-controller-manager
150174
deployments:
151-
- name: ipfs-operator-controller-manager
175+
- label:
176+
control-plane: controller-manager
177+
name: ipfs-operator-controller-manager
152178
spec:
153179
replicas: 1
154180
selector:

bundle/metadata/annotations.yaml

Lines changed: 1 addition & 1 deletion
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.18.0+git
8+
operators.operatorframework.io.metrics.builder: operator-sdk-v1.19.0+git
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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,24 @@ spec:
4040
type: string
4141
public:
4242
type: boolean
43+
replicas:
44+
format: int32
45+
type: integer
4346
url:
4447
type: string
4548
required:
4649
- clusterStorage
4750
- ipfsStorage
4851
- public
52+
- replicas
4953
- url
5054
type: object
5155
status:
5256
properties:
53-
address:
54-
type: string
57+
addresses:
58+
items:
59+
type: string
60+
type: array
5561
conditions:
5662
items:
5763
description: "Condition contains details for one aspect of the current

config/rbac/role.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ rules:
5050
- get
5151
- patch
5252
- update
53+
- apiGroups:
54+
- ""
55+
resources:
56+
- configmaps
57+
verbs:
58+
- create
59+
- delete
60+
- get
61+
- list
62+
- patch
63+
- update
64+
- watch
5365
- apiGroups:
5466
- ""
5567
resources:
@@ -62,6 +74,18 @@ rules:
6274
- patch
6375
- update
6476
- watch
77+
- apiGroups:
78+
- ""
79+
resources:
80+
- secrets
81+
verbs:
82+
- create
83+
- delete
84+
- get
85+
- list
86+
- patch
87+
- update
88+
- watch
6589
- apiGroups:
6690
- ""
6791
resources:

controllers/configmap.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package controllers
2+
3+
import (
4+
corev1 "k8s.io/api/core/v1"
5+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
6+
ctrl "sigs.k8s.io/controller-runtime"
7+
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
8+
9+
clusterv1alpha1 "github.com/redhat-et/ipfs-operator/api/v1alpha1"
10+
)
11+
12+
func (r *IpfsReconciler) configMapConfig(m *clusterv1alpha1.Ipfs, cm *corev1.ConfigMap, peerid string) (controllerutil.MutateFn, string) {
13+
cmName := "ipfs-cluster-" + m.Name
14+
expected := &corev1.ConfigMap{
15+
ObjectMeta: metav1.ObjectMeta{
16+
Name: cmName,
17+
Namespace: m.Namespace,
18+
},
19+
Data: map[string]string{
20+
"BOOTSTRAP_PEER_ID": peerid,
21+
},
22+
}
23+
expected.DeepCopyInto(cm)
24+
ctrl.SetControllerReference(m, cm, r.Scheme)
25+
return func() error {
26+
return nil
27+
}, cmName
28+
}

0 commit comments

Comments
 (0)