-
Notifications
You must be signed in to change notification settings - Fork 5
chore(app): add config values types #2486
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
Conversation
03ece9b
to
70dc2a7
Compare
This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID. Online Installer:
Airgap Installer (may take a few minutes before the airgap bundle is built):
Happy debugging! |
a0eadf6
to
f079e81
Compare
@@ -125,7 +127,12 @@ const ConfigurationStep: React.FC<ConfigurationStepProps> = ({ onNext }) => { | |||
// Initialize configValues with initial values when they load | |||
useEffect(() => { | |||
if (apiConfigValues && Object.keys(configValues).length === 0) { | |||
setConfigValues(apiConfigValues); | |||
// Convert AppConfigValues to Record<string, string> for local state |
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.
why not make local state the same type though?
@@ -13,7 +13,11 @@ func (c *InstallController) GetAppConfig(ctx context.Context) (kotsv1beta1.Confi | |||
return c.appConfigManager.GetConfig() | |||
} | |||
|
|||
func (c *InstallController) PatchAppConfigValues(ctx context.Context, values map[string]string) (finalErr error) { | |||
func (c *InstallController) PatchAppConfigValues(ctx context.Context, values types.AppConfigValues) (finalErr error) { | |||
if err := c.validateReleaseData(); err != nil { |
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.
was this intentionally added back?
api/controllers/linux/install/app.go
Outdated
@@ -13,7 +13,11 @@ func (c *InstallController) GetAppConfig(ctx context.Context) (kotsv1beta1.Confi | |||
return c.appConfigManager.GetConfig() | |||
} | |||
|
|||
func (c *InstallController) PatchAppConfigValues(ctx context.Context, values map[string]string) (finalErr error) { | |||
func (c *InstallController) PatchAppConfigValues(ctx context.Context, values types.AppConfigValues) (finalErr error) { | |||
if err := c.validateReleaseData(); err != nil { |
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.
was this intentionally added back?
Failures are flakes and unrelated. Merging |
What this PR does / why we need it:
This PR adds a config value type which allows us to extend value with metadata. This is required for the file input type which will hold the filename besides the actual file content in the Value property.
This is just a straight replacement change, no new functionality is added besides the filename field (and the new types) which is currently unused.
Which issue(s) this PR fixes:
Part of: https://app.shortcut.com/replicated/story/126680/add-file-config-item-type-backend-foundation
Does this PR require a test?
NONE
Does this PR require a release note?
Does this PR require documentation?
NONE