-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add a config.openshift.io/Infrastructure
instance to the cluster
#943
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
Add a config.openshift.io/Infrastructure
instance to the cluster
#943
Conversation
/retest |
|
||
// Infrastructure generates the cluster-infrastructure-*.yml files. | ||
type Infrastructure struct { | ||
config *configv1.Infrastructure |
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.
Do not need to store the config. It is not used.
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.
Fixed
|
||
crdData, err := content.GetBootkubeTemplate(infraCrdFilename) | ||
if err != nil { | ||
return err |
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.
Wrap this error with a meaningful message.
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.
Fixed — also, I wasn't aware of github.com/pkg/errors
, I like it and will propose using it in my team's operators. Thanks!
Gopkg.lock
Outdated
@@ -364,14 +364,14 @@ | |||
version = "1.0.1" | |||
|
|||
[[projects]] | |||
digest = "1:68214731af5ff5a3bfab4d28571578e5522bc4f667ad1232745d7b4189ccb442" | |||
digest = "1:400ab065329172f4f4a88ad94401795780566749b1b3cb73029d0d3971659925" |
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.
Put the vendor changes in a separate commit.
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.
Isn't this already the case?
0cd84d5
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.
Ah, yes, sorry for the noise.
|
||
configData, err := yaml.Marshal(i.config) | ||
if err != nil { | ||
return errors.Wrapf(err, "failed to create %s manifests from InstallConfig", i.Name()) |
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 message for this error does not match what the error is.
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.
Fixed
} | ||
|
||
// Load loads the already-rendered files back from disk. | ||
func (i *Infrastructure) Load(f asset.FileFetcher) (bool, error) { |
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.
This asset should not be loadable. Its files will be loaded by the Common Manifests asset. For more context, see #877.
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.
Ah, we may need to update the recent DNS config implementation for this too.
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'll refactor DNS once this PR merges
fd335ff
to
f4ed5ff
Compare
/hold Cloud provider is the wrong abstraction in the config. All cloudproviders are going to be |
That seems like a discussion we should have had in openshift/api#145. Are you going to open a new API PR with some proposed change? |
@rajatchopra Is there a distinction between manifests that should be part of manifest-templates and those that should not? I am wondering whether this new Infrastructure Config asset should be output from the manifest-templates target. It is not clear to me why the Ingress Config and Network Config are not. |
🙁 Yeah let me do that, sorry that PR slipped my radar. @ironcladlou is this PR blocking you on something important? |
Opened openshift/api#149 to discuss refactoring the config API |
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.
non-blocking comments.
I notice that even the ingress asset uses a template directly and not through a template asset. Can fix both of these in follow-up PR.
return errors.Wrapf(err, "failed to marshal config: %#v", config) | ||
} | ||
|
||
crdData, err := content.GetBootkubeTemplate(infraCrdFilename) |
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.
There should be a template asset first which this asset can depend upon. If we do it directly, then the 'templates' target will not dump this file (which may be okay, but inconsistent).
@@ -0,0 +1,16 @@ | |||
apiVersion: apiextensions.k8s.io/v1beta1 |
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.
Is this a bootkube file? Seems like an openshift file. I mean keep it in data/data/manifests/openshift/
@staebler I put my review comments and then saw your comment. I have the same feedback. There is no distinction as of now, I think we should put all templates/manifests as manifest-template assets first and depend upon them if needed. Unless there is a strong reason otherwise. I don't see the reason here. |
60c114f
to
fa5253f
Compare
@rajatchopra @staebler @abhinavdahiya refactored per feedback, PTAL. Tested manually with Are there any automated tests I should incorporate? |
Should the |
/retest |
|
/retest |
1 similar comment
/retest |
@abhinavdahiya @rajatchopra @staebler PTAL, tests are green. |
* Update the `openshift/api` package to a version containing the new config type. * Generate the `config.openshift.io/Infrastructure` custom resource definition manifest. * Generate the CRD instance manifest populated with cloud provider name from the install config. This enables consumers of cloud provider configuration to migrate away from install config.
fa5253f
to
696475e
Compare
/lgtm |
/hold cancel |
@rajatchopra re-tag? I accidentally removed it |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, ironcladlou, rajatchopra The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
C'mon, bot. |
/retest |
/retest |
/retest |
/retest |
1 similar comment
/retest |
/retest |
/retest |
2 similar comments
/retest |
/retest |
/refresh |
/retest |
2 similar comments
/retest |
/retest |
* Add the Network.config.openshift.io CRD * Generate the network config from the install config * Remove networkoperator types from install config (but use the same schema) * Move network CRDs to templates to match openshift#943 This doesn't change the json/yaml serialization of the install config, but it changes it internally.
Add a
config.openshift.io/Infrastructure
instance to the cluster.openshift/api
package to a version containing the new config type.config.openshift.io/Infrastructure
custom resource definition manifest.This enables consumers of cloud provider configuration to migrate away from install config.
/cc @openshift/sig-network-edge @rajatchopra @deads2k