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

Remove elastic subnet #2068

Merged
merged 7 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions cmd/networkcmd/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/ava-labs/avalanche-cli/pkg/binutils"
"github.com/ava-labs/avalanche-cli/pkg/cobrautils"
"github.com/ava-labs/avalanche-cli/pkg/constants"
"github.com/ava-labs/avalanche-cli/pkg/elasticsubnet"
"github.com/ava-labs/avalanche-cli/pkg/models"
"github.com/ava-labs/avalanche-cli/pkg/subnet"
"github.com/ava-labs/avalanche-cli/pkg/teleporter"
Expand Down Expand Up @@ -79,9 +78,6 @@ func clean(*cobra.Command, []string) error {
if err := removeLocalDeployInfoFromSidecars(); err != nil {
return err
}
if err := removeLocalElasticSubnetInfoFromSidecars(); err != nil {
return err
}
return nil
}

Expand All @@ -106,38 +102,6 @@ func removeLocalDeployInfoFromSidecars() error {
return nil
}

func removeLocalElasticSubnetInfoFromSidecars() error {
// Remove all local elastic subnet info from sidecar files
elasticSubnets, err := elasticsubnet.GetLocalElasticSubnetsFromFile(app)
if err != nil {
return err
}

for _, subnet := range elasticSubnets {
sc, err := app.LoadSidecar(subnet)
if err != nil {
return err
}

delete(sc.ElasticSubnet, models.Local.String())
if err = app.UpdateSidecar(&sc); err != nil {
return err
}
if err = deleteElasticSubnetConfigFile(subnet); err != nil {
return err
}
}
return nil
}

func deleteElasticSubnetConfigFile(subnetName string) error {
elasticSubetConfigPath := app.GetElasticSubnetConfigPath(subnetName)
if err := os.Remove(elasticSubetConfigPath); err != nil {
return err
}
return nil
}

func cleanBins(dir string) {
if err := os.RemoveAll(dir); err != nil {
ux.Logger.PrintToUser("Removal failed: %s", err)
Expand Down
193 changes: 0 additions & 193 deletions cmd/subnetcmd/addDelegator.go

This file was deleted.

Loading
Loading