Skip to content
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

Eden as library: Refactoring stage 2 #827

Closed
uncleDecart opened this issue Dec 5, 2022 · 1 comment
Closed

Eden as library: Refactoring stage 2 #827

uncleDecart opened this issue Dec 5, 2022 · 1 comment

Comments

@uncleDecart
Copy link
Member

What:

In previous PR #803 we swept all global variables in mediator it does not solve the problem of confusing, but it enables easier refactor, which does not require rewriting whole application. We need to prune Runtime arguments which were added to config structure, remove as maximum as possible.

How:

We can use local variable reference (since we’re using Golang and we have garbage collector, we can do it). Example you can see below via configName variable

func NewRootCommand() *cobra.Command {
	var configName string

	rootCmd := &cobra.Command{
		Use: "root",
	}

	groups := CommandGroups{
		{
			Message: "Basic Commands",
			Commands: []*cobra.Command{
				newSetupCommand(&configName),
			},
		},
	}

	groups.AddTo(rootCmd)

	rootCmd.PersistentFlags().StringVar(&configName, "config", "test", "Name of config")

	return rootCmd
}

Outcome:

Fixed API, we can branch out eden and start developing on top of it (network configuration, testing framework, benchmarking framework)

uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 9, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
Removing them since they are unused.
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 15, 2022
Remove them since they are unused.
See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
uncleDecart added a commit to uncleDecart/eden that referenced this issue Dec 16, 2022
imageFormat and eveImageSizeMB inside utils.DownloadUEFI are not
required

See lf-edge#827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
giggsoff pushed a commit that referenced this issue Dec 19, 2022
* Remove EveConfigDir from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove NetBoot from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove Installer from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Removed SoftSerial from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove ZedcontrolURL from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove ConfigDist from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove IPXEOverride from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove GrubOptions from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove DryRun from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Removed VmName from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Removed EveConfigFromFile from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove VolumesToPurge from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove DeleteVolumes from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove AllConfigs from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove AdamRm from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove RegistryRm from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove RedisRm from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove EServerRm from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove CurrentContext from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove InfoTail from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove Follow from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove PrintFields from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove LogTail from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove MetricTail from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove ContextFile from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove PodName from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove NoHyper from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove PodMetadata from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove VncDisplay from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove VncPassword from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove PodNetworks from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove PortPublish from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove DiskSize from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove VolumeSize from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove AppMemory from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove VolumeType from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove AppCpus from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove PinCpus from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove ImageFormat from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove ACL from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove VLANs from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove SftpLoad from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove DirectLoad from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove Mount from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove Disks from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove Registry from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove OpenStackMetadata from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove Profiles from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove DatastoreOverride from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove AppAdapters from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove ACLOnlyHost from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove StartDelay from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove Host from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove SSHPort from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove TapInterface from RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove RuntimeConfig

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove configName and verbosity from info cmd

Removing them since they are unused.
See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove configName and verbosity from newLogCmd

Remove them since they are unused.
See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

* Remove uneccesary fields from setupSdn

imageFormat and eveImageSizeMB inside utils.DownloadUEFI are not
required

See #827

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>

Signed-off-by: Pavel Abramov <uncle.decart@gmail.com>
@uncleDecart
Copy link
Member Author

uncleDecart commented Dec 19, 2022

Merged #835

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant