simplify code and remove unused code

This commit is contained in:
tanjunchen 2019-12-16 13:10:31 +08:00
parent 8df0d34c68
commit 52537053cc
6 changed files with 2 additions and 30 deletions

View File

@ -13,16 +13,8 @@ nodeup/pkg/model
pkg/apis/kops/v1alpha1 pkg/apis/kops/v1alpha1
pkg/apis/kops/v1alpha2 pkg/apis/kops/v1alpha2
pkg/apis/kops/validation pkg/apis/kops/validation
pkg/client/simple/api
pkg/diff
pkg/instancegroups pkg/instancegroups
pkg/model
pkg/model/alimodel
pkg/model/components pkg/model/components
pkg/model/components/etcdmanager
pkg/model/gcemodel
pkg/model/openstackmodel
pkg/model/spotinstmodel
pkg/resources/ali pkg/resources/ali
pkg/resources/aws pkg/resources/aws
pkg/resources/digitalocean pkg/resources/digitalocean

View File

@ -177,8 +177,3 @@ func restNamespaceForClusterName(clusterName string) string {
namespace := strings.Replace(clusterName, ".", "-", -1) namespace := strings.Replace(clusterName, ".", "-", -1)
return namespace return namespace
} }
func restNamespaceForFederationName(clusterName string) string {
namespace := strings.Replace(clusterName, ".", "-", -1)
return namespace
}

View File

@ -162,7 +162,7 @@ F`
diffs := dmp.DiffMain(l, r, false) diffs := dmp.DiffMain(l, r, false)
// We do need to cleanup, as otherwise we get some spurious changes on complex diffs // We do need to cleanup, as otherwise we get some spurious changes on complex diffs
diffs = dmp.DiffCleanupSemantic(diffs) dmp.DiffCleanupSemantic(diffs)
} }

View File

@ -60,12 +60,3 @@ func Test_SharedGroups(t *testing.T) {
} }
} }
} }
func makeTestInstanceGroupSec(role kops.InstanceGroupRole, secGroup *string) *kops.InstanceGroup {
return &kops.InstanceGroup{
Spec: kops.InstanceGroupSpec{
Role: role,
SecurityGroupOverride: secGroup,
},
}
}

View File

@ -27,8 +27,3 @@ func s(v string) *string {
func i64(v int64) *int64 { func i64(v int64) *int64 {
return fi.Int64(v) return fi.Int64(v)
} }
// i32 is a helper that builds a *int32 from an int32 value
func i32(v int32) *int32 {
return fi.Int32(v)
}

View File

@ -98,6 +98,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
} }
} }
// TODO: would be good to create these as shared, to verify them
if !sharedVPC { if !sharedVPC {
dhcp := &awstasks.DHCPOptions{ dhcp := &awstasks.DHCPOptions{
Name: s(b.ClusterName()), Name: s(b.ClusterName()),
@ -120,8 +121,6 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
VPC: b.LinkToVPC(), VPC: b.LinkToVPC(),
DHCPOptions: dhcp, DHCPOptions: dhcp,
}) })
} else {
// TODO: would be good to create these as shared, to verify them
} }
allSubnetsUnmanaged := true allSubnetsUnmanaged := true