mirror of
https://github.com/openshift/installer.git
synced 2026-02-06 00:48:45 +01:00
Merge pull request #1338 from flaper87/sec-groups-update
openstack: Security groups update
This commit is contained in:
4
Gopkg.lock
generated
4
Gopkg.lock
generated
@@ -883,14 +883,14 @@
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:4c282f9a6274e8614446fbbe4faad65ea1588ebff812eaae286355f56fd81236"
|
||||
digest = "1:55b6b7044d6e27db021b0e645e6c135958815a27bde5e5167e52e85888f8569e"
|
||||
name = "sigs.k8s.io/cluster-api-provider-openstack"
|
||||
packages = [
|
||||
"pkg/apis",
|
||||
"pkg/apis/openstackproviderconfig/v1alpha1",
|
||||
]
|
||||
pruneopts = "NUT"
|
||||
revision = "2b8ee6bc02ae0c13e88e6484b8097adba4e7a894"
|
||||
revision = "9e913e83ca639e7f6e10fdffa8445f504b101f3c"
|
||||
source = "https://github.com/openshift/cluster-api-provider-openstack.git"
|
||||
|
||||
[[projects]]
|
||||
|
||||
@@ -106,7 +106,11 @@ func provider(clusterID string, platform *openstack.Platform, mpool *openstack.M
|
||||
},
|
||||
},
|
||||
AvailabilityZone: az,
|
||||
SecurityGroups: []string{role},
|
||||
SecurityGroups: []openstackprovider.SecurityGroupParam{
|
||||
{
|
||||
Name: role,
|
||||
},
|
||||
},
|
||||
// TODO(flaper87): Trunk support missing. Need to add it back
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ type OpenstackProviderSpec struct {
|
||||
AvailabilityZone string `json:"availabilityZone,omitempty"`
|
||||
|
||||
// The names of the security groups to assign to the instance
|
||||
SecurityGroups []string `json:"securityGroups,omitempty"`
|
||||
SecurityGroups []SecurityGroupParam `json:"securityGroups,omitempty"`
|
||||
|
||||
// The name of the secret containing the user data (startup script in most cases)
|
||||
UserDataSecret *corev1.SecretReference `json:"userDataSecret,omitempty"`
|
||||
@@ -71,6 +71,30 @@ type OpenstackProviderSpec struct {
|
||||
RootVolume RootVolume `json:"root_volume,omitempty"`
|
||||
}
|
||||
|
||||
type SecurityGroupParam struct {
|
||||
// Security Group UID
|
||||
UUID string `json:"uuid,omitempty"`
|
||||
// Security Group name
|
||||
Name string `json:"name,omitempty"`
|
||||
// Filters used to query security groups in openstack
|
||||
Filter SecurityGroupFilter `json:"filter,omitempty"`
|
||||
}
|
||||
|
||||
type SecurityGroupFilter struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
TenantID string `json:"tenant_id,omitempty"`
|
||||
ProjectID string `json:"project_id,omitempty"`
|
||||
Limit int `json:"limit,omitempty"`
|
||||
Marker string `json:"marker,omitempty"`
|
||||
SortKey string `json:"sort_key,omitempty"`
|
||||
SortDir string `json:"sort_dir,omitempty"`
|
||||
Tags string `json:"tags,omitempty"`
|
||||
TagsAny string `json:"tags-any,omitempty"`
|
||||
NotTags string `json:"not-tags,omitempty"`
|
||||
NotTagsAny string `json:"not-tags-any,omitempty"`
|
||||
}
|
||||
|
||||
type NetworkParam struct {
|
||||
// The UUID of the network. Required if you omit the port attribute.
|
||||
UUID string `json:"uuid,omitempty"`
|
||||
|
||||
@@ -202,7 +202,7 @@ func (in *OpenstackProviderSpec) DeepCopyInto(out *OpenstackProviderSpec) {
|
||||
}
|
||||
if in.SecurityGroups != nil {
|
||||
in, out := &in.SecurityGroups, &out.SecurityGroups
|
||||
*out = make([]string, len(*in))
|
||||
*out = make([]SecurityGroupParam, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.UserDataSecret != nil {
|
||||
@@ -285,6 +285,39 @@ func (in *SecurityGroup) DeepCopy() *SecurityGroup {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SecurityGroupFilter) DeepCopyInto(out *SecurityGroupFilter) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupFilter.
|
||||
func (in *SecurityGroupFilter) DeepCopy() *SecurityGroupFilter {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SecurityGroupFilter)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SecurityGroupParam) DeepCopyInto(out *SecurityGroupParam) {
|
||||
*out = *in
|
||||
out.Filter = in.Filter
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupParam.
|
||||
func (in *SecurityGroupParam) DeepCopy() *SecurityGroupParam {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SecurityGroupParam)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SecurityGroupRule) DeepCopyInto(out *SecurityGroupRule) {
|
||||
*out = *in
|
||||
|
||||
Reference in New Issue
Block a user