Skip to content

Commit 4186ffb

Browse files
jmprusitmshort
authored andcommitted
rename InstalledBundleSource to InstalledBundleResource
Signed-off-by: Joaquim Moreno Prusi <[email protected]>
1 parent 91de1bd commit 4186ffb

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

api/v1alpha1/operator_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func init() {
8181
// OperatorStatus defines the observed state of Operator
8282
type OperatorStatus struct {
8383
// +optional
84-
InstalledBundleSource string `json:"installedBundleSource,omitempty"`
84+
InstalledBundleResource string `json:"installedBundleResource,omitempty"`
8585
// +optional
8686
ResolvedBundleResource string `json:"resolvedBundleResource,omitempty"`
8787

config/crd/bases/operators.operatorframework.io_operators.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ spec:
131131
x-kubernetes-list-map-keys:
132132
- type
133133
x-kubernetes-list-type: map
134-
installedBundleSource:
134+
installedBundleResource:
135135
type: string
136136
resolvedBundleResource:
137137
type: string

controllers/operator_controller.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
108108
if err := validators.ValidateOperatorSpec(op); err != nil {
109109
// Set the TypeInstalled condition to Unknown to indicate that the resolution
110110
// hasn't been attempted yet, due to the spec being invalid.
111-
op.Status.InstalledBundleSource = ""
111+
op.Status.InstalledBundleResource = ""
112112
apimeta.SetStatusCondition(&op.Status.Conditions, metav1.Condition{
113113
Type: operatorsv1alpha1.TypeInstalled,
114114
Status: metav1.ConditionUnknown,
@@ -131,7 +131,7 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
131131
// run resolution
132132
solution, err := r.Resolver.Resolve(ctx)
133133
if err != nil {
134-
op.Status.InstalledBundleSource = ""
134+
op.Status.InstalledBundleResource = ""
135135
apimeta.SetStatusCondition(&op.Status.Conditions, metav1.Condition{
136136
Type: operatorsv1alpha1.TypeInstalled,
137137
Status: metav1.ConditionUnknown,
@@ -154,7 +154,7 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
154154
// Operator's desired package name.
155155
bundleEntity, err := r.getBundleEntityFromSolution(solution, op.Spec.PackageName)
156156
if err != nil {
157-
op.Status.InstalledBundleSource = ""
157+
op.Status.InstalledBundleResource = ""
158158
apimeta.SetStatusCondition(&op.Status.Conditions, metav1.Condition{
159159
Type: operatorsv1alpha1.TypeInstalled,
160160
Status: metav1.ConditionUnknown,
@@ -176,7 +176,7 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
176176
// Get the bundle image reference for the bundle
177177
bundleImage, err := bundleEntity.BundlePath()
178178
if err != nil {
179-
op.Status.InstalledBundleSource = ""
179+
op.Status.InstalledBundleResource = ""
180180
apimeta.SetStatusCondition(&op.Status.Conditions, metav1.Condition{
181181
Type: operatorsv1alpha1.TypeInstalled,
182182
Status: metav1.ConditionUnknown,
@@ -210,7 +210,7 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
210210
dep := r.generateExpectedBundleDeployment(*op, bundleImage)
211211
if err := r.ensureBundleDeployment(ctx, dep); err != nil {
212212
// originally Reason: operatorsv1alpha1.ReasonInstallationFailed
213-
op.Status.InstalledBundleSource = ""
213+
op.Status.InstalledBundleResource = ""
214214
apimeta.SetStatusCondition(&op.Status.Conditions, metav1.Condition{
215215
Type: operatorsv1alpha1.TypeInstalled,
216216
Status: metav1.ConditionFalse,
@@ -225,7 +225,7 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
225225
existingTypedBundleDeployment := &rukpakv1alpha1.BundleDeployment{}
226226
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(dep.UnstructuredContent(), existingTypedBundleDeployment); err != nil {
227227
// originally Reason: operatorsv1alpha1.ReasonInstallationStatusUnknown
228-
op.Status.InstalledBundleSource = ""
228+
op.Status.InstalledBundleResource = ""
229229
apimeta.SetStatusCondition(&op.Status.Conditions, metav1.Condition{
230230
Type: operatorsv1alpha1.TypeInstalled,
231231
Status: metav1.ConditionUnknown,
@@ -236,11 +236,11 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
236236
return ctrl.Result{}, err
237237
}
238238

239-
// Let's set the proper Installed condition and installedBundleSource field based on the
239+
// Let's set the proper Installed condition and InstalledBundleResource field based on the
240240
// existing BundleDeployment object status.
241-
installedCond, installedBundleSource := mapBDStatusToInstalledCondition(existingTypedBundleDeployment, op)
241+
installedCond, InstalledBundleResource := mapBDStatusToInstalledCondition(existingTypedBundleDeployment, op)
242242
apimeta.SetStatusCondition(&op.Status.Conditions, installedCond)
243-
op.Status.InstalledBundleSource = installedBundleSource
243+
op.Status.InstalledBundleResource = InstalledBundleResource
244244

245245
// set the status of the operator based on the respective bundle deployment status conditions.
246246
return ctrl.Result{}, nil

controllers/operator_controller_test.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var _ = Describe("Operator Controller Test", func() {
7575

7676
By("Checking the status fields")
7777
Expect(operator.Status.ResolvedBundleResource).To(Equal(""))
78-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
78+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
7979

8080
By("checking the expected conditions")
8181
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -111,7 +111,7 @@ var _ = Describe("Operator Controller Test", func() {
111111

112112
By("Checking the status fields")
113113
Expect(operator.Status.ResolvedBundleResource).To(Equal(""))
114-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
114+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
115115

116116
By("checking the expected conditions")
117117
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -161,8 +161,8 @@ var _ = Describe("Operator Controller Test", func() {
161161
It("sets the resolvedBundleResource status field", func() {
162162
Expect(operator.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
163163
})
164-
It("sets the InstalledBundleSource status field", func() {
165-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
164+
It("sets the InstalledBundleResource status field", func() {
165+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
166166
})
167167
It("sets the status on operator", func() {
168168
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -240,7 +240,7 @@ var _ = Describe("Operator Controller Test", func() {
240240

241241
By("Checking the status fields")
242242
Expect(operator.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
243-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
243+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
244244

245245
By("checking the expected status conditions")
246246
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -288,7 +288,7 @@ var _ = Describe("Operator Controller Test", func() {
288288

289289
By("Checking the status fields")
290290
Expect(op.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
291-
Expect(op.Status.InstalledBundleSource).To(Equal(""))
291+
Expect(op.Status.InstalledBundleResource).To(Equal(""))
292292

293293
By("checking the expected conditions")
294294
cond := apimeta.FindStatusCondition(op.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -327,7 +327,7 @@ var _ = Describe("Operator Controller Test", func() {
327327

328328
By("Checking the status fields")
329329
Expect(op.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
330-
Expect(op.Status.InstalledBundleSource).To(Equal(""))
330+
Expect(op.Status.InstalledBundleResource).To(Equal(""))
331331

332332
By("checking the expected conditions")
333333
cond := apimeta.FindStatusCondition(op.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -366,7 +366,7 @@ var _ = Describe("Operator Controller Test", func() {
366366

367367
By("Checking the status fields")
368368
Expect(op.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
369-
Expect(op.Status.InstalledBundleSource).To(Equal(""))
369+
Expect(op.Status.InstalledBundleResource).To(Equal(""))
370370

371371
By("checking the expected conditions")
372372
cond := apimeta.FindStatusCondition(op.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -405,7 +405,7 @@ var _ = Describe("Operator Controller Test", func() {
405405

406406
By("Checking the status fields")
407407
Expect(op.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
408-
Expect(op.Status.InstalledBundleSource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
408+
Expect(op.Status.InstalledBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
409409

410410
By("checking the expected conditions")
411411
cond := apimeta.FindStatusCondition(op.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -451,7 +451,7 @@ var _ = Describe("Operator Controller Test", func() {
451451

452452
By("Checking the status fields")
453453
Expect(op.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
454-
Expect(op.Status.InstalledBundleSource).To(Equal(""))
454+
Expect(op.Status.InstalledBundleResource).To(Equal(""))
455455

456456
By("checking the expected conditions")
457457
cond := apimeta.FindStatusCondition(op.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -490,7 +490,7 @@ var _ = Describe("Operator Controller Test", func() {
490490

491491
By("Checking the status fields")
492492
Expect(op.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
493-
Expect(op.Status.InstalledBundleSource).To(Equal(""))
493+
Expect(op.Status.InstalledBundleResource).To(Equal(""))
494494

495495
By("checking the expected conditions")
496496
cond := apimeta.FindStatusCondition(op.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -558,8 +558,8 @@ var _ = Describe("Operator Controller Test", func() {
558558
It("sets the resolvedBundleResource status field", func() {
559559
Expect(operator.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
560560
})
561-
It("sets the InstalledBundleSource status field", func() {
562-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
561+
It("sets the InstalledBundleResource status field", func() {
562+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
563563
})
564564
It("sets resolution to unknown status", func() {
565565
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -597,7 +597,7 @@ var _ = Describe("Operator Controller Test", func() {
597597

598598
By("Checking the status fields")
599599
Expect(operator.Status.ResolvedBundleResource).To(Equal(""))
600-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
600+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
601601

602602
By("checking the expected conditions")
603603
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -650,7 +650,7 @@ var _ = Describe("Operator Controller Test", func() {
650650

651651
By("Checking the status fields")
652652
Expect(operator.Status.ResolvedBundleResource).To(Equal(""))
653-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
653+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
654654

655655
By("checking the expected conditions")
656656
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -741,7 +741,7 @@ var _ = Describe("Operator Controller Test", func() {
741741

742742
By("Checking the status fields")
743743
Expect(operator.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
744-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
744+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
745745

746746
By("checking the expected conditions")
747747
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -795,7 +795,7 @@ var _ = Describe("Operator Controller Test", func() {
795795

796796
By("Checking the status fields")
797797
Expect(operator.Status.ResolvedBundleResource).To(Equal("quay.io/operatorhubio/prometheus@sha256:5b04c49d8d3eff6a338b56ec90bdf491d501fe301c9cdfb740e5bff6769a21ed"))
798-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
798+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
799799

800800
By("checking the expected conditions")
801801
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -850,7 +850,7 @@ var _ = Describe("Operator Controller Test", func() {
850850

851851
By("Checking the status fields")
852852
Expect(operator.Status.ResolvedBundleResource).To(Equal(""))
853-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
853+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
854854

855855
By("checking the expected conditions")
856856
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -893,7 +893,7 @@ var _ = Describe("Operator Controller Test", func() {
893893

894894
By("Checking the status fields")
895895
Expect(operator.Status.ResolvedBundleResource).To(Equal(""))
896-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
896+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
897897

898898
By("checking the expected conditions")
899899
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -939,7 +939,7 @@ var _ = Describe("Operator Controller Test", func() {
939939

940940
By("Checking the status fields")
941941
Expect(operator.Status.ResolvedBundleResource).To(Equal(""))
942-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
942+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
943943

944944
By("checking the expected conditions")
945945
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)
@@ -1003,7 +1003,7 @@ var _ = Describe("Operator Controller Test", func() {
10031003

10041004
By("Checking the status fields")
10051005
Expect(operator.Status.ResolvedBundleResource).To(Equal(""))
1006-
Expect(operator.Status.InstalledBundleSource).To(Equal(""))
1006+
Expect(operator.Status.InstalledBundleResource).To(Equal(""))
10071007

10081008
By("checking the expected conditions")
10091009
cond := apimeta.FindStatusCondition(operator.Status.Conditions, operatorsv1alpha1.TypeResolved)

test/e2e/install_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ var _ = Describe("Operator Install", func() {
8888
g.Expect(cond.Status).To(Equal(metav1.ConditionTrue))
8989
g.Expect(cond.Reason).To(Equal(operatorv1alpha1.ReasonSuccess))
9090
g.Expect(cond.Message).To(ContainSubstring("installed from"))
91-
g.Expect(operator.Status.InstalledBundleSource).ToNot(BeEmpty())
91+
g.Expect(operator.Status.InstalledBundleResource).ToNot(BeEmpty())
9292
bd := rukpakv1alpha1.BundleDeployment{}
9393
err = c.Get(ctx, types.NamespacedName{Name: operatorName}, &bd)
9494
g.Expect(err).ToNot(HaveOccurred())

0 commit comments

Comments
 (0)