-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add support for private DNS server to PowerVS #6157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-robot
merged 1 commit into
openshift:master
from
hamzy:add-powervs-private-dns-1
Aug 29, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| output bootstrap_ip { | ||
| output "bootstrap_ip" { | ||
| value = local.bootstrap_ips[0] | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| output api_member_ext_id { | ||
| output "api_member_ext_id" { | ||
| value = ibm_is_lb_pool_member.api_member.id | ||
| } | ||
|
|
||
| output api_member_int_id { | ||
| output "api_member_int_id" { | ||
| value = ibm_is_lb_pool_member.api_member_int.id | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| output bootstrap_ip { | ||
| output "bootstrap_ip" { | ||
| value = module.vm.bootstrap_ip | ||
| } | ||
|
|
||
| output api_member_ext_id { | ||
| output "api_member_ext_id" { | ||
| value = module.lb.api_member_ext_id | ||
| } | ||
|
|
||
| output api_member_int_id { | ||
| output "api_member_int_id" { | ||
| value = module.lb.api_member_int_id | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| variable "master_ips" { | ||
| type = list | ||
| type = list(any) | ||
| description = "The IP addresses of the master nodes." | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| package powervs | ||
|
|
||
| import ( | ||
| "context" | ||
| "github.com/IBM/go-sdk-core/v5/core" | ||
| "github.com/IBM/vpc-go-sdk/vpcv1" | ||
| "github.com/pkg/errors" | ||
| "strings" | ||
| ) | ||
|
|
||
| const ( | ||
| cloudInstanceTypeName = "cloudInstance" | ||
| ) | ||
|
|
||
| // listCloudInstances lists instances in the cloud server. | ||
| func (o *ClusterUninstaller) listCloudInstances() (cloudResources, error) { | ||
| o.Logger.Debugf("Listing virtual Cloud service instances") | ||
|
|
||
| ctx, _ := o.contextWithTimeout() | ||
|
|
||
| options := o.vpcSvc.NewListInstancesOptions() | ||
|
|
||
| // https://raw.githubusercontent.com/IBM/vpc-go-sdk/master/vpcv1/vpc_v1.go | ||
| resources, _, err := o.vpcSvc.ListInstancesWithContext(ctx, options) | ||
| if err != nil { | ||
| o.Logger.Warnf("Error o.vpcSvc.ListInstancesWithContext: %v", err) | ||
| return nil, err | ||
| } | ||
|
|
||
| var foundOne = false | ||
|
|
||
| result := []cloudResource{} | ||
| for _, instance := range resources.Instances { | ||
| if strings.Contains(*instance.Name, o.InfraID) { | ||
| foundOne = true | ||
| o.Logger.Debugf("listCloudInstances: FOUND: %s, %s, %s", *instance.ID, *instance.Name, *instance.Status) | ||
| result = append(result, cloudResource{ | ||
| key: *instance.ID, | ||
| name: *instance.Name, | ||
| status: *instance.Status, | ||
| typeName: cloudInstanceTypeName, | ||
| id: *instance.ID, | ||
| }) | ||
| } | ||
| } | ||
| if !foundOne { | ||
| o.Logger.Debugf("listCloudInstances: NO matching virtual instance against: %s", o.InfraID) | ||
| for _, instance := range resources.Instances { | ||
| o.Logger.Debugf("listInstances: only found virtual instance: %s", *instance.Name) | ||
| } | ||
| } | ||
|
|
||
| return cloudResources{}.insert(result...), nil | ||
| } | ||
|
|
||
| // destroyCloudInstance deletes a given instance. | ||
| func (o *ClusterUninstaller) destroyCloudInstance(item cloudResource) error { | ||
| var ( | ||
| ctx context.Context | ||
| err error | ||
| getInstanceOptions *vpcv1.GetInstanceOptions | ||
| deleteInstanceOptions *vpcv1.DeleteInstanceOptions | ||
| response *core.DetailedResponse | ||
| ) | ||
|
|
||
| ctx, _ = o.contextWithTimeout() | ||
|
|
||
| getInstanceOptions = o.vpcSvc.NewGetInstanceOptions(item.id) | ||
|
|
||
| _, _, err = o.vpcSvc.GetInstanceWithContext(ctx, getInstanceOptions) | ||
| if err != nil { | ||
| o.deletePendingItems(item.typeName, []cloudResource{item}) | ||
| o.Logger.Infof("Deleted Cloud instance %q", item.name) | ||
| return nil | ||
| } | ||
|
|
||
| o.Logger.Debugf("Deleting Cloud instance %q", item.name) | ||
|
|
||
| deleteInstanceOptions = o.vpcSvc.NewDeleteInstanceOptions(item.id) | ||
|
|
||
| response, err = o.vpcSvc.DeleteInstanceWithContext(ctx, deleteInstanceOptions) | ||
| if err != nil { | ||
| o.Logger.Infof("Error: o.vpcSvc.DeleteInstanceWithContext: %q %q", err, response) | ||
| return err | ||
| } | ||
|
|
||
| o.deletePendingItems(item.typeName, []cloudResource{item}) | ||
| o.Logger.Infof("Deleted Cloud instance %q", item.name) | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| // destroyCloudInstances searches for Cloud instances that have a name that starts with | ||
| // the cluster's infra ID. | ||
| func (o *ClusterUninstaller) destroyCloudInstances() error { | ||
| found, err := o.listCloudInstances() | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| items := o.insertPendingItems(cloudInstanceTypeName, found.list()) | ||
|
|
||
| ctx, _ := o.contextWithTimeout() | ||
|
|
||
| for !o.timeout(ctx) { | ||
| for _, item := range items { | ||
| select { | ||
| case <-o.Context.Done(): | ||
| o.Logger.Debugf("destroyCloudInstances: case <-o.Context.Done()") | ||
| return o.Context.Err() // we're cancelled, abort | ||
| default: | ||
| } | ||
|
|
||
| if _, ok := found[item.key]; !ok { | ||
| // This item has finished deletion. | ||
| o.deletePendingItems(item.typeName, []cloudResource{item}) | ||
| o.Logger.Infof("Deleted Cloud instance %q", item.name) | ||
| continue | ||
| } | ||
| err := o.destroyCloudInstance(item) | ||
| if err != nil { | ||
| o.errorTracker.suppressWarning(item.key, err, o.Logger) | ||
| } | ||
| } | ||
|
|
||
| items = o.getPendingItems(cloudInstanceTypeName) | ||
| if len(items) == 0 { | ||
| break | ||
| } | ||
| } | ||
|
|
||
| if items = o.getPendingItems(cloudInstanceTypeName); len(items) > 0 { | ||
| return errors.Errorf("destroyCloudInstances: %d undeleted items pending", len(items)) | ||
| } | ||
|
|
||
| return nil | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.