Skip to content

Commit

Permalink
operator: changes to support multiple api versions
Browse files Browse the repository at this point in the history
By moving the core deployment API fields that are expected to be
supported by all future API versions, we could minimize the code
duplication. Hence moved such fields into the `base` package that
supposed to inherited by all the API versions.

Made '{Controller,Node}Resources' specific to v1alpha1 api as upcoming
v1beta1 version plans to deprecate them in favour of container specific
resources.
  • Loading branch information
avalluri committed Nov 26, 2020
1 parent fe9ed98 commit 3106c9d
Show file tree
Hide file tree
Showing 27 changed files with 877 additions and 761 deletions.
4 changes: 4 additions & 0 deletions deploy/crd/pmem-csi.intel.com_deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ spec:
conditions:
description: Conditions
items:
description: DeploymentCondition type definition for driver deployment
status conditions
properties:
lastUpdateTime:
description: Last time the condition was probed.
Expand All @@ -205,6 +207,8 @@ spec:
type: array
driverComponents:
items:
description: DriverStatus type definition for representing deployed
driver status
properties:
component:
description: 'DriverComponent represents type of the driver:
Expand Down
6 changes: 3 additions & 3 deletions deploy/yamls.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"fmt"
"regexp"

api "github.com/intel/pmem-csi/pkg/apis/pmemcsi/v1alpha1"
"github.com/intel/pmem-csi/pkg/apis/pmemcsi/base"
"github.com/intel/pmem-csi/pkg/version"
)

Expand All @@ -29,7 +29,7 @@ type YamlFile struct {

// DeviceMode defines in which mode the deployed driver will
// operate.
DeviceMode api.DeviceMode
DeviceMode base.DeviceMode
}

var yamls []YamlFile
Expand All @@ -50,7 +50,7 @@ func init() {
Name: file,
Kubernetes: kubernetes,
Flavor: parts[3],
DeviceMode: api.DeviceMode(parts[3]),
DeviceMode: base.DeviceMode(parts[3]),
})
}
}
Expand Down
Loading

0 comments on commit 3106c9d

Please sign in to comment.