-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
WIP: Moved oVirt installconfig to externalprovider #4517
Changes from 1 commit
11dc0bc
21c2ec8
8377ece
40df377
2253d86
507eaea
0091074
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
package provider | ||
|
||
import ( | ||
"github.com/openshift/installer/pkg/asset" | ||
"github.com/openshift/installer/pkg/asset/installconfig/aws" | ||
icazure "github.com/openshift/installer/pkg/asset/installconfig/azure" | ||
"github.com/openshift/installer/pkg/types" | ||
) | ||
|
||
// InstallConfigExternalProvider describes the methods required for the installconfig asset. | ||
type InstallConfigExternalProvider interface { | ||
// AddToInstallConfigPlatform adds the current platform to the installconfig. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe change to "adds the current provider to the installconfig Platform" |
||
AddToInstallConfigPlatform(p *types.Platform) error | ||
|
||
// ValidateInstallConfig validates the install config. | ||
ValidateInstallConfig( | ||
Config *types.InstallConfig, | ||
File *asset.File, | ||
AWS *aws.Metadata, | ||
Azure *icazure.Metadata, | ||
) error | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
package externalprovider | ||
|
||
import ( | ||
"github.com/openshift/installer/pkg/asset" | ||
"github.com/openshift/installer/pkg/asset/installconfig/aws" | ||
icazure "github.com/openshift/installer/pkg/asset/installconfig/azure" | ||
"github.com/openshift/installer/pkg/externalprovider/provider/ovirt" | ||
"github.com/openshift/installer/pkg/types" | ||
) | ||
|
@@ -19,3 +22,20 @@ func AddToInstallConfigPlatform( | |
provider := providerRegistry.MustGet(string(ProviderName)) | ||
return provider.AddToInstallConfigPlatform(p) | ||
} | ||
|
||
// ValidateInstallConfig validates the install config. | ||
func ValidateInstallConfig( | ||
ProviderName Name, | ||
Config *types.InstallConfig, | ||
File *asset.File, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like most providers will not need File, AWS or Azure... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The API is designed to 1:1 replace the current switch-cases with minimal changes to the code. Adding parameters to existing APIs is harder than adding new API calls. |
||
AWS *aws.Metadata, | ||
Azure *icazure.Metadata, | ||
) error { | ||
provider := providerRegistry.MustGet(string(ProviderName)) | ||
return provider.ValidateInstallConfig( | ||
Config, | ||
File, | ||
AWS, | ||
Azure, | ||
) | ||
} |
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.
The name is a bit confusing "InstallConfigExternalProvider", I understood that platforms are the "external providers", because of "ExternalProvider is a provider that is not maintained by the core installer team." [1] maybe you should use a different name? it seems like the InstallConfigExternalProvider is something that the installer team will want to maintain
[1]https://github.com/openshift/installer/pull/4517/files?file-filters%5B%5D=.go#diff-95c3eb6370ff093d7d65c61022511d7286d41e57f067925081077b6ded9fb55fR3
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.
I'm up for ideas instead of "External Provider", I'd like to wait for some feedback from the installer team on this.