File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ type InitOptions struct {
69
69
// SkipTemplateProcess allows for skipping the call to the template processor, including also variable replacement in the component YAML.
70
70
// NOTE this works only if the rawYaml is a valid yaml by itself, like e.g when using envsubst/the simple processor.
71
71
skipTemplateProcess bool
72
+
73
+ // IgnoreValidationErrors allows for skipping the validation of provider installs.
74
+ // NOTE this should only be used for development
75
+ IgnoreValidationErrors bool
72
76
}
73
77
74
78
// Init initializes a management cluster by adding the requested list of providers.
@@ -108,7 +112,10 @@ func (c *clusterctlClient) Init(options InitOptions) ([]Components, error) {
108
112
// - There should be only one instance of the same provider.
109
113
// - All the providers must support the same API Version of Cluster API (contract)
110
114
if err := installer .Validate (); err != nil {
111
- return nil , err
115
+ if ! options .IgnoreValidationErrors {
116
+ return nil , err
117
+ }
118
+ log .Error (err , "Ignoring validation errors" )
112
119
}
113
120
114
121
// Before installing the providers, ensure the cert-manager Webhook is in place.
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ type initOptions struct {
34
34
infrastructureProviders []string
35
35
targetNamespace string
36
36
listImages bool
37
+ validate bool
37
38
waitProviders bool
38
39
waitProviderTimeout int
39
40
}
@@ -108,6 +109,8 @@ func init() {
108
109
"Wait for providers to be installed." )
109
110
initCmd .Flags ().IntVar (& initOpts .waitProviderTimeout , "wait-provider-timeout" , 5 * 60 ,
110
111
"Wait timeout per provider installation in seconds. This value is ignored if --wait-providers is false" )
112
+ initCmd .Flags ().BoolVar (& initOpts .validate , "validate" , true ,
113
+ "If true, clusterctl will validate that the deployments will succeed on the management cluster." )
111
114
112
115
// TODO: Move this to a sub-command or similar, it shouldn't really be a flag.
113
116
initCmd .Flags ().BoolVar (& initOpts .listImages , "list-images" , false ,
@@ -132,6 +135,7 @@ func runInit() error {
132
135
LogUsageInstructions : true ,
133
136
WaitProviders : initOpts .waitProviders ,
134
137
WaitProviderTimeout : time .Duration (initOpts .waitProviderTimeout ) * time .Second ,
138
+ IgnoreValidationErrors : ! initOpts .validate ,
135
139
}
136
140
137
141
if initOpts .listImages {
You can’t perform that action at this time.
0 commit comments