Skip to content

Commit

Permalink
Include Operand deprecation status in Infinispan CR .status. Resolves i…
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson committed May 16, 2024
1 parent a19b424 commit d5f4335
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions api/v1/infinispan_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,9 @@ const (
)

type OperandStatus struct {
// Whether the Operand has been deprecated and is subject for removal in a subsequent release
// +optional
Deprecated bool `json:"deprecated,omitempty"`
// The Image being used by the Operand currently being reconciled
// +optional
Image string `json:"image,omitempty"`
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/infinispan.org_infinispans.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2321,6 +2321,10 @@ spec:
operand:
description: The Operand status
properties:
deprecated:
description: Whether the Operand has been deprecated and is subject
for removal in a subsequent release
type: boolean
image:
description: The Image being used by the Operand currently being
reconciled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ func OperandStatus(i *ispnv1.Infinispan, phase ispnv1.OperandPhase, operand vers
}

return ispnv1.OperandStatus{
Image: img,
Phase: phase,
Version: operand.Ref(),
Deprecated: operand.Deprecated,
Image: img,
Phase: phase,
Version: operand.Ref(),
}
}
1 change: 1 addition & 0 deletions test/e2e/infinispan/upgrade_operand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func TestOperandUpgrade(t *testing.T) {
testKube.CreateInfinispan(spec, tutils.Namespace)
testKube.WaitForInfinispanPods(replicas, tutils.SinglePodTimeout, spec.Name, tutils.Namespace)
ispn := testKube.WaitForInfinispanCondition(spec.Name, spec.Namespace, ispnv1.ConditionWellFormed)
assert.True(t, ispn.Status.Operand.Deprecated)

// Follow the support Operand graph, updating the cluster to each non-cve release
for i := 1; i < len(versionManager.Operands); i++ {
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/utils/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ var VersionManager = func() *version.Manager {
_ = os.Setenv(ispnv1.OperatorOperandVersionEnvVarName, `[{
"downstream-version": "0.1.0",
"upstream-version": "13.0.10",
"image": "quay.io/infinispan/server:13.0.10.Final"
"image": "quay.io/infinispan/server:13.0.10.Final",
"deprecated": true
},{
"downstream-version": "0.2.0-1",
"upstream-version": "14.0.1",
Expand Down

0 comments on commit d5f4335

Please sign in to comment.