-
Notifications
You must be signed in to change notification settings - Fork 5
feat(ui): new manager-experience sub-command, use app-slug for data dir, respect flags as defaults #2284
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
base: main
Are you sure you want to change the base?
feat(ui): new manager-experience sub-command, use app-slug for data dir, respect flags as defaults #2284
Conversation
883e121
to
33d8ba6
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! |
99a930e
to
c0a2758
Compare
314eeb0
to
79c94b9
Compare
proxy, err := parseProxyFlags(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
flags.proxy = proxy | ||
|
||
if err := verifyProxyConfig(flags.proxy, prompts.New(), flags.assumeYes); err != nil { | ||
return err | ||
} | ||
logrus.Debug("User confirmed prompt to proceed installing with `http_proxy` set and `https_proxy` unset") | ||
|
||
if err := validateCIDRFlags(cmd); err != nil { | ||
return err | ||
} | ||
|
||
// parse the various cidr flags to make sure we have exactly what we want | ||
cidrCfg, err := getCIDRConfig(cmd) | ||
if err != nil { | ||
return fmt.Errorf("unable to determine pod and service CIDRs: %w", err) | ||
} | ||
flags.cidrCfg = cidrCfg | ||
|
||
// if a network interface flag was not provided, attempt to discover it | ||
if flags.networkInterface == "" { | ||
autoInterface, err := newconfig.DetermineBestNetworkInterface() | ||
if err == nil { | ||
flags.networkInterface = autoInterface | ||
} | ||
} |
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 is probably all redundant in the api right now where defaults are set
|
||
if err := validateCIDRFlags(cmd); err != nil { | ||
return err | ||
if err := updateRuntimeConfigFromInstallCmdFlags(flags, rc); 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.
rather than a configChan, we should just have a runtimeConfigChan and set it directly since its all computed in the api now.
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 got rid of the config chan in my branch that installs everything in the api, so there won't be a need for it
@@ -34,35 +33,12 @@ func (c *InstallController) ConfigureInstallation(ctx context.Context, config *t | |||
return fmt.Errorf("validate: %w", err) | |||
} | |||
|
|||
if err := c.computeCIDRs(config); 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.
this was moved to the manager
// TODO (@team): discuss the distinction between the runtime config and the installation config | ||
// update the runtime config | ||
c.rc.SetDataDir(config.DataDirectory) | ||
c.rc.SetLocalArtifactMirrorPort(config.LocalArtifactMirrorPort) | ||
c.rc.SetAdminConsolePort(config.AdminConsolePort) |
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 was moved to the manager
@@ -22,12 +22,11 @@ type InstallationManager interface { | |||
SetStatus(status types.Status) error | |||
ValidateConfig(config *types.InstallationConfig) error | |||
SetConfigDefaults(config *types.InstallationConfig) error | |||
ConfigureForInstall(ctx context.Context, config *types.InstallationConfig) error | |||
ConfigureHost(ctx context.Context) 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 feels out of place in this manager
@@ -190,65 +171,6 @@ func TestConfigureInstallation(t *testing.T) { | |||
} | |||
} | |||
|
|||
// TestIntegrationComputeCIDRs tests the CIDR computation with real networking utility | |||
func TestIntegrationComputeCIDRs(t *testing.T) { |
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 comment is not correct. it is redundant and tested already in the utils package
@@ -30,7 +30,7 @@ var k0sConfigPathOverride string | |||
func RenderK0sConfig(proxyRegistryDomain string) *k0sconfig.ClusterConfig { | |||
cfg := k0sconfig.DefaultClusterConfig() | |||
// Customize the default k0s configuration to our taste. | |||
cfg.Name = runtimeconfig.BinaryName() | |||
cfg.Name = "k0s" |
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 checked in the cluster and it seems to be named this regardless
if manager.installationStore == nil { | ||
manager.installationStore = NewMemoryStore(manager.installation) | ||
manager.installationStore = NewMemoryStore(manager.rc, types.NewStatus()) |
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 status needs to be tied to the one in the "install" type i think, can't be a new one, otherwise it wouldn't update correctly there. That's why the installation object was passed down as a reference
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.
Can you elaborate?
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.
before this change, the manager.installation
would be a pointer to the one on the install
object here:
installation.WithInstallation(controller.install.Steps.Installation), |
so the changes reflect in the install
object. with this change, it's creating a new status and changes wouldn't reflect in the install
object.
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.
Perhaps we need to refactor out these pointers? It is hard to understand and has side effects.
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.
Yeah agreed
{ | ||
Name: "k0s", | ||
VolumeSource: corev1.VolumeSource{ | ||
HostPath: &corev1.HostPathVolumeSource{ | ||
Path: runtimeconfig.K0sBinaryPath, | ||
Type: ptr.To(corev1.HostPathFile), | ||
}, | ||
}, | ||
}, |
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 have no idea why im all of a sudden seeing this error
$ kubectl -n embedded-cluster logs copy-host-preflight-results-node3-4d8ks
/embedded-cluster/bin/kubectl: /embedded-cluster/bin/kubectl: exec: exec: line 2: line 2: /usr/local/bin/k0s: not found
What this PR does / why we need it:
--manager-experience
flag to sub-command toembedded-cluster install manager-experience
Which issue(s) this PR fixes:
Does this PR require a test?
Does this PR require a release note?
Does this PR require documentation?