-
Notifications
You must be signed in to change notification settings - Fork 1.5k
openstack: get ignition via IP #1998
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
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 |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import ( | |
| "github.com/openshift/installer/pkg/asset" | ||
| "github.com/openshift/installer/pkg/asset/installconfig" | ||
| baremetaltypes "github.com/openshift/installer/pkg/types/baremetal" | ||
| openstacktypes "github.com/openshift/installer/pkg/types/openstack" | ||
| ) | ||
|
|
||
| // MCSCertKey is the asset that generates the MCS key/cert pair. | ||
|
|
@@ -45,6 +46,9 @@ func (a *MCSCertKey) Generate(dependencies asset.Parents) error { | |
| case baremetaltypes.Name: | ||
| cfg.IPAddresses = []net.IP{net.ParseIP(installConfig.Config.BareMetal.APIVIP)} | ||
| cfg.DNSNames = []string{hostname, installConfig.Config.BareMetal.APIVIP} | ||
| case openstacktypes.Name: | ||
|
||
| cfg.IPAddresses = []net.IP{net.ParseIP(installConfig.Config.OpenStack.APIVIP)} | ||
| cfg.DNSNames = []string{hostname, installConfig.Config.OpenStack.APIVIP} | ||
| default: | ||
| cfg.DNSNames = []string{hostname} | ||
| } | ||
|
|
||
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,9 +1,37 @@ | ||
| package defaults | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/apparentlymart/go-cidr/cidr" | ||
|
|
||
| "github.com/openshift/installer/pkg/types" | ||
| "github.com/openshift/installer/pkg/types/openstack" | ||
| ) | ||
|
|
||
| // Defaults for the openstack platform. | ||
| const ( | ||
| APIVIP = "" | ||
| DNSVIP = "" | ||
| ) | ||
|
|
||
| // SetPlatformDefaults sets the defaults for the platform. | ||
| func SetPlatformDefaults(p *openstack.Platform) { | ||
| func SetPlatformDefaults(p *openstack.Platform, c *types.InstallConfig) { | ||
| if p.APIVIP == "" { | ||
| vip, err := cidr.Host(&c.Networking.MachineCIDR.IPNet, 5) | ||
| if err != nil { | ||
| p.APIVIP = fmt.Sprintf("failed to get APIVIP from MachineCIDR: %s", err.Error()) | ||
| } else { | ||
| p.APIVIP = vip.String() | ||
| } | ||
| } | ||
|
|
||
| if p.DNSVIP == "" { | ||
| vip, err := cidr.Host(&c.Networking.MachineCIDR.IPNet, 6) | ||
| if err != nil { | ||
| p.DNSVIP = fmt.Sprintf("failed to get DNSVIP from MachineCIDR: %s", err.Error()) | ||
| } else { | ||
| p.DNSVIP = vip.String() | ||
| } | ||
| } | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
baremetalneeds to do something similar - seen https://github.com/openshift/installer/pull/1873/files#diff-d7037682a68150f4dbbbf5cc0d6e8f54R17Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that PR is linked from the commit message here (as is the oVirt's equivalent: #1948).
The intention here is to merge this smallish patch so that all three platforms (baremetal, ovirt, openstack) can validate this is an acceptable solution and that they can build on.