Skip to content

Commit

Permalink
Refactor creating instance
Browse files Browse the repository at this point in the history
  • Loading branch information
hidekazuna committed Oct 2, 2020
1 parent 60f5a4c commit 4af658e
Show file tree
Hide file tree
Showing 8 changed files with 543 additions and 342 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha3/openstackcluster_types.go
Expand Up @@ -136,7 +136,7 @@ type OpenStackClusterStatus struct {

BastionSecurityGroup *SecurityGroup `json:"bastionSecurityGroup,omitempty"`

Bastion *Bastion `json:"bastion,omitempty"`
Bastion *Instance `json:"bastion,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
25 changes: 24 additions & 1 deletion api/v1alpha3/types.go
Expand Up @@ -125,6 +125,27 @@ type APIEndpoint struct {
Port int `json:"port"`
}

type Instance struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Trunk bool `json:"trunk,omitempty"`
FailureDomain string `json:"failureDomain,omitempty"`
SecurityGroups *[]string `json:"securigyGroups,omitempty"`
Networks *[]Network `json:"networks,omitempty"`
Tags []string `json:"tags,omitempty"`
Image string `json:"image,omitempty"`
Flavor string `json:"flavor,omitempty"`
SSHKeyName string `json:"sshKeyName,omitempty"`
UserData string `json:"userData,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
ConfigDrive *bool `json:"configDrive,omitempty"`
RootVolume *RootVolume `json:"rootVolume,omitempty"`
ServerGroupID string `json:"serverGroupID,omitempty"`
State InstanceState `json:"state,omitempty"`
IP string `json:"ip,omitempty"`
FloatingIP string `json:"floatingIP,omitempty"`
}

type RootVolume struct {
SourceType string `json:"sourceType,omitempty"`
SourceUUID string `json:"sourceUUID,omitempty"`
Expand Down Expand Up @@ -249,7 +270,9 @@ type Bastion struct {
//+optional
SSHKeyName string `json:"sshKeyName,omitempty"`
//+optional
SecurityGroups []SecurityGroupParam `json:"securityGroups,omitempty"`
Networks []NetworkParam `json:"networks,omitempty"`
//+optional
FloatingIP string `json:"floatingIP,omitempty"`
//+optional
SecurityGroups []SecurityGroupParam `json:"securityGroups,omitempty"`
}
66 changes: 65 additions & 1 deletion api/v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4af658e

Please sign in to comment.