mirror of https://github.com/kubernetes/kops.git
Remove tags from NodeupConfig
This commit is contained in:
parent
28caf07afa
commit
c2cb6646af
|
|
@ -28,8 +28,6 @@ import (
|
||||||
|
|
||||||
// Config is the configuration for the nodeup binary
|
// Config is the configuration for the nodeup binary
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// Tags enable/disable chunks of the model
|
|
||||||
Tags []string `json:",omitempty"`
|
|
||||||
// Assets are locations where we can find files to be installed
|
// Assets are locations where we can find files to be installed
|
||||||
// TODO: Remove once everything is in containers?
|
// TODO: Remove once everything is in containers?
|
||||||
Assets map[architectures.Architecture][]string `json:",omitempty"`
|
Assets map[architectures.Architecture][]string `json:",omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -1172,7 +1172,6 @@ type nodeUpConfigBuilder struct {
|
||||||
cluster *kops.Cluster
|
cluster *kops.Cluster
|
||||||
etcdManifests map[kops.InstanceGroupRole][]string
|
etcdManifests map[kops.InstanceGroupRole][]string
|
||||||
images map[kops.InstanceGroupRole]map[architectures.Architecture][]*nodeup.Image
|
images map[kops.InstanceGroupRole]map[architectures.Architecture][]*nodeup.Image
|
||||||
nodeUpTags []string
|
|
||||||
protokubeImage map[kops.InstanceGroupRole]*nodeup.Image
|
protokubeImage map[kops.InstanceGroupRole]*nodeup.Image
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1184,12 +1183,6 @@ func (c *ApplyClusterCmd) newNodeUpConfigBuilder(assetBuilder *assets.AssetBuild
|
||||||
return nil, fmt.Errorf("error parsing config base %q: %v", cluster.Spec.ConfigBase, err)
|
return nil, fmt.Errorf("error parsing config base %q: %v", cluster.Spec.ConfigBase, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove
|
|
||||||
clusterTags, err := buildCloudupTags(cluster)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
channels := []string{
|
channels := []string{
|
||||||
configBase.Join("addons", "bootstrap-channel.yaml").Path(),
|
configBase.Join("addons", "bootstrap-channel.yaml").Path(),
|
||||||
}
|
}
|
||||||
|
|
@ -1198,11 +1191,6 @@ func (c *ApplyClusterCmd) newNodeUpConfigBuilder(assetBuilder *assets.AssetBuild
|
||||||
channels = append(channels, cluster.Spec.Addons[i].Manifest)
|
channels = append(channels, cluster.Spec.Addons[i].Manifest)
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeUpTags, err := buildNodeupTags(cluster, clusterTags)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
useGossip := dns.IsGossipHostname(cluster.Spec.MasterInternalName)
|
useGossip := dns.IsGossipHostname(cluster.Spec.MasterInternalName)
|
||||||
|
|
||||||
etcdManifests := map[kops.InstanceGroupRole][]string{}
|
etcdManifests := map[kops.InstanceGroupRole][]string{}
|
||||||
|
|
@ -1307,7 +1295,6 @@ func (c *ApplyClusterCmd) newNodeUpConfigBuilder(assetBuilder *assets.AssetBuild
|
||||||
cluster: cluster,
|
cluster: cluster,
|
||||||
etcdManifests: etcdManifests,
|
etcdManifests: etcdManifests,
|
||||||
images: images,
|
images: images,
|
||||||
nodeUpTags: nodeUpTags.List(),
|
|
||||||
protokubeImage: protokubeImage,
|
protokubeImage: protokubeImage,
|
||||||
}
|
}
|
||||||
return &configBuilder, nil
|
return &configBuilder, nil
|
||||||
|
|
@ -1327,8 +1314,6 @@ func (n *nodeUpConfigBuilder) BuildConfig(ig *kops.InstanceGroup, apiserverAddit
|
||||||
}
|
}
|
||||||
|
|
||||||
config := nodeup.NewConfig(cluster, ig)
|
config := nodeup.NewConfig(cluster, ig)
|
||||||
config.Tags = append(config.Tags, n.nodeUpTags...)
|
|
||||||
|
|
||||||
config.Assets = make(map[architectures.Architecture][]string)
|
config.Assets = make(map[architectures.Architecture][]string)
|
||||||
for _, arch := range architectures.GetSupported() {
|
for _, arch := range architectures.GetSupported() {
|
||||||
config.Assets[arch] = []string{}
|
config.Assets[arch] = []string{}
|
||||||
|
|
|
||||||
|
|
@ -65,19 +65,3 @@ func buildCloudupTags(cluster *api.Cluster) (sets.String, error) {
|
||||||
|
|
||||||
return tags, nil
|
return tags, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildNodeupTags(cluster *api.Cluster, clusterTags sets.String) (sets.String, error) {
|
|
||||||
tags := sets.NewString()
|
|
||||||
|
|
||||||
if clusterTags.Has("_gce") {
|
|
||||||
tags.Insert("_gce")
|
|
||||||
}
|
|
||||||
if clusterTags.Has("_aws") {
|
|
||||||
tags.Insert("_aws")
|
|
||||||
}
|
|
||||||
if clusterTags.Has("_do") {
|
|
||||||
tags.Insert("_do")
|
|
||||||
}
|
|
||||||
|
|
||||||
return tags, nil
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -78,15 +78,6 @@ func TestBuildTags_CloudProvider_AWS_Weave(t *testing.T) {
|
||||||
if !tags.Has("_aws") {
|
if !tags.Has("_aws") {
|
||||||
t.Fatal("tag _aws not found")
|
t.Fatal("tag _aws not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeUpTags, err := buildNodeupTags(c, tags)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("buildNodeupTags error: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !nodeUpTags.Has("_aws") {
|
|
||||||
t.Fatal("nodeUpTag _aws not found")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildTags_CloudProvider_AWS_Flannel(t *testing.T) {
|
func TestBuildTags_CloudProvider_AWS_Flannel(t *testing.T) {
|
||||||
|
|
@ -104,15 +95,6 @@ func TestBuildTags_CloudProvider_AWS_Flannel(t *testing.T) {
|
||||||
if !tags.Has("_aws") {
|
if !tags.Has("_aws") {
|
||||||
t.Fatal("tag _aws not found")
|
t.Fatal("tag _aws not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeUpTags, err := buildNodeupTags(c, tags)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("buildNodeupTags error: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !nodeUpTags.Has("_aws") {
|
|
||||||
t.Fatal("nodeUpTag _aws not found")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildTags_CloudProvider_AWS_Calico(t *testing.T) {
|
func TestBuildTags_CloudProvider_AWS_Calico(t *testing.T) {
|
||||||
|
|
@ -130,15 +112,6 @@ func TestBuildTags_CloudProvider_AWS_Calico(t *testing.T) {
|
||||||
if !tags.Has("_aws") {
|
if !tags.Has("_aws") {
|
||||||
t.Fatal("tag _aws not found")
|
t.Fatal("tag _aws not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeUpTags, err := buildNodeupTags(c, tags)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("buildNodeupTags error: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !nodeUpTags.Has("_aws") {
|
|
||||||
t.Fatal("nodeUpTag _aws not found")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildTags_CloudProvider_AWS_Canal(t *testing.T) {
|
func TestBuildTags_CloudProvider_AWS_Canal(t *testing.T) {
|
||||||
|
|
@ -156,15 +129,6 @@ func TestBuildTags_CloudProvider_AWS_Canal(t *testing.T) {
|
||||||
if !tags.Has("_aws") {
|
if !tags.Has("_aws") {
|
||||||
t.Fatal("tag _aws not found")
|
t.Fatal("tag _aws not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeUpTags, err := buildNodeupTags(c, tags)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("buildNodeupTags error: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !nodeUpTags.Has("_aws") {
|
|
||||||
t.Fatal("nodeUpTag _aws not found")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildTags_CloudProvider_AWS(t *testing.T) {
|
func TestBuildTags_CloudProvider_AWS(t *testing.T) {
|
||||||
|
|
@ -179,15 +143,6 @@ func TestBuildTags_CloudProvider_AWS(t *testing.T) {
|
||||||
if !tags.Has("_aws") {
|
if !tags.Has("_aws") {
|
||||||
t.Fatal("tag _aws not found")
|
t.Fatal("tag _aws not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeUpTags, err := buildNodeupTags(c, tags)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("buildNodeupTags error: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !nodeUpTags.Has("_aws") {
|
|
||||||
t.Fatal("nodeUpTag _aws not found")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildTags_KubernetesVersions(t *testing.T) {
|
func TestBuildTags_KubernetesVersions(t *testing.T) {
|
||||||
|
|
@ -225,13 +180,4 @@ func TestBuildTags_CloudProvider_AWS_Cilium(t *testing.T) {
|
||||||
if !tags.Has("_aws") {
|
if !tags.Has("_aws") {
|
||||||
t.Fatal("tag _aws not found")
|
t.Fatal("tag _aws not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeUpTags, err := buildNodeupTags(c, tags)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("buildNodeupTags error: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !nodeUpTags.Has("_aws") {
|
|
||||||
t.Fatal("nodeUpTag _aws not found")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -173,11 +173,9 @@ func (c *NodeUpCommand) Run(out io.Writer) error {
|
||||||
distroTags := distribution.BuildTags()
|
distroTags := distribution.BuildTags()
|
||||||
|
|
||||||
nodeTags := sets.NewString()
|
nodeTags := sets.NewString()
|
||||||
nodeTags.Insert(c.config.Tags...)
|
|
||||||
nodeTags.Insert(archTags...)
|
nodeTags.Insert(archTags...)
|
||||||
nodeTags.Insert(distroTags...)
|
nodeTags.Insert(distroTags...)
|
||||||
|
|
||||||
klog.Infof("Config tags: %v", c.config.Tags)
|
|
||||||
klog.Infof("Arch tags: %v", archTags)
|
klog.Infof("Arch tags: %v", archTags)
|
||||||
klog.Infof("Distro tags: %v", distroTags)
|
klog.Infof("Distro tags: %v", distroTags)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue