Skip to content

Commit

Permalink
pkg/asset/machines: Give AWS workers public IPs (for now)
Browse files Browse the repository at this point in the history
Workers have not had public IPs since (at least) we moved them to
cluster-API creation in e2dc955 (pkg/asset: add ClusterK8sIO,
machines.Worker assets, 2018-10-15, #468).  But it turns out a number
of e2e tests assume SSH access to workers (e.g. [1]), and we don't
have time to fix those tests now.  We'll remove this once the tests
have been fixed.

[1]: https://github.com/kubernetes/kubernetes/blob/v1.13.1/test/e2e/node/ssh.go#L43
  • Loading branch information
wking committed Dec 17, 2018
1 parent 8f02020 commit 0055276
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/asset/machines/aws/machinesets.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/pointer"
awsprovider "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1"
clusterapi "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1"

"github.com/openshift/installer/pkg/types"
Expand Down Expand Up @@ -88,3 +90,14 @@ func MachineSets(config *types.InstallConfig, pool *types.MachinePool, role, use

return machinesets, nil
}

// ConfigWorkers sets the PublicIP flag for the given machine sets.
//
// Deprecated: We'll remove this once the e2e tests no longer require
// worker SSH access.
func ConfigWorkers(machineSets []clusterapi.MachineSet) {
for _, machineSet := range machineSets {
providerConfig := machineSet.Spec.Template.Spec.ProviderConfig.Value.Object.(*awsprovider.AWSMachineProviderConfig)
providerConfig.PublicIP = pointer.BoolPtr(true)
}
}
1 change: 1 addition & 0 deletions pkg/asset/machines/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (w *Worker) Generate(dependencies asset.Parents) error {
if err != nil {
return errors.Wrap(err, "failed to create worker machine objects")
}
aws.ConfigWorkers(sets)

list := listFromMachineSets(sets)
raw, err := yaml.Marshal(list)
Expand Down

0 comments on commit 0055276

Please sign in to comment.