Skip to content

Commit

Permalink
Add availability zone secret and struct (#352)
Browse files Browse the repository at this point in the history
* add availability zone secret and struct
  • Loading branch information
lukeatdell authored and falfaroc committed Nov 21, 2024
1 parent b4f7dac commit 3c16a58
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 17 deletions.
31 changes: 30 additions & 1 deletion samples/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,39 @@
# Default value: ""
# This is an optional field from v2.10.0 onwards for PowerFlex storage system >=4.0.x
nasName: "nas-server"
# # To add more PowerFlex systems, uncomment the following lines and provide the required values

# # zone: A cluster availability zone to which the PowerFlex system should be bound.
# # The mapping is one-to-one - the PowerFlex system cannot belong to more than one zone.
# # Ideally, the PowerFlex system and cluster nodes that define the availability zone would be
# # geographically co-located.
# # Optional: true
# # Default value: none
# zone:
# # name: The name of the container orchestrator's availability zone to which the PowerFlex system
# # should be mapped.
# name: "zoneA"
# # protectionDomains: A list of the protection domains and their associated pools, defined in
# # the PowerFlex system.
# # Currently, csi-powerflex only supports one protection domain per zone.
# protectionDomains:
# # pools: A list of pools that belong to a single protection defined in the PowerFlex system.
# # Currently, csi-powerflex only supports one pool per protection domain.
# - pools:
# - "pool1"
# # name: The name of the protection domain in the PowerFlex system.
# # Optional: true
# # name is required if storage pool names are not unique across protection domains.
# name: "domain1"
# To add more PowerFlex systems, uncomment the following lines and provide the required values
# - username: "admin"
# password: "password"
# systemID: "2b11bb111111bb1b"
# endpoint: "https://127.0.0.2"
# skipCertificateValidation: true
# mdm: "10.0.0.3,10.0.0.4"
# zone:
# name: "ZoneB"
# protectionDomains:
# - name: "my-app-domain"
# pools:
# - "my-backend-pool"
47 changes: 31 additions & 16 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,37 @@ var Log = logrus.New()

// ArrayConnectionData contains data required to connect to array
type ArrayConnectionData struct {
SystemID string `json:"systemID"`
Username string `json:"username"`
Password string `json:"password"`
Endpoint string `json:"endpoint"`
SkipCertificateValidation bool `json:"skipCertificateValidation,omitempty"`
Insecure bool `json:"insecure,omitempty"`
IsDefault bool `json:"isDefault,omitempty"`
AllSystemNames string `json:"allSystemNames"`
NasName string `json:"nasName"`
Mdm string `json:"mdm,omitempty"`
Zone ZoneInfo `json:"zone,omitempty"`
}

type ZoneInfo struct {
Name string `json:"name"`
LabelKey string `json:"labelKey"`
SystemID string `json:"systemID"`
Username string `json:"username"`
Password string `json:"password"`
Endpoint string `json:"endpoint"`
SkipCertificateValidation bool `json:"skipCertificateValidation,omitempty"`
Insecure bool `json:"insecure,omitempty"`
IsDefault bool `json:"isDefault,omitempty"`
AllSystemNames string `json:"allSystemNames"`
NasName string `json:"nasName"`
Mdm string `json:"mdm,omitempty"`
AvailabilityZone *AvailabilityZone `json:"zone,omitempty"`
}

// Definitions to make AvailabilityZone decomposition easier to read.
type (
ZoneName string
ZoneTargetMap map[ZoneName][]ProtectionDomain
ProtectionDomainName string
PoolName string
)

// AvailabilityZone provides a mapping between cluster zones labels and storage systems
type AvailabilityZone struct {
Name ZoneName `json:"name"`
ProtectionDomains []ProtectionDomain `json:"protectionDomains"`
}

// ProtectionDomain provides protection domain information for a cluster's availability zone
type ProtectionDomain struct {
Name ProtectionDomainName `json:"name"`
Pools []PoolName `json:"pools"`
}

// Manifest is the SP's manifest.
Expand Down

0 comments on commit 3c16a58

Please sign in to comment.