Update to go 1.11 and fix new linting errors (#3763)

* update go-dev-tools image

See https://github.com/deis/docker-go-dev/releases/tag/v1.15.0

* Fix new go vet errors in go 1.11

* Update go-dev image to 1.15.1 for goimports fix.

The "goimports" binary/plugin needed to be built with go 1.11.

* Update go-dev image to 1.16.0 for parity with AKS

* Test just headers of SSH keys

Go 1.11 now randomizes rsa.GenerateKey to prevent exactly this
type of implementation-specific test.

* Update go-dev image to 1.17.0 for party with AKS

* Add private key length and validation tests
This commit is contained in:
Matt Boersma 2018-09-12 10:34:30 -06:00 коммит произвёл GitHub
Родитель 3c7ebbe9e9
Коммит 353c8bb50c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
14 изменённых файлов: 151 добавлений и 197 удалений

Просмотреть файл

@ -3,7 +3,7 @@ version: 2
defaults: &defaults
working_directory: /go/src/github.com/Azure/acs-engine
docker:
- image: quay.io/deis/go-dev:v1.14.0
- image: quay.io/deis/go-dev:v1.17.0
environment:
GOPATH: /go

Просмотреть файл

@ -25,7 +25,7 @@ GITTAG := $(VERSION_SHORT)
endif
REPO_PATH := github.com/Azure/acs-engine
DEV_ENV_IMAGE := quay.io/deis/go-dev:v1.14.0
DEV_ENV_IMAGE := quay.io/deis/go-dev:v1.17.0
DEV_ENV_WORK_DIR := /go/src/${REPO_PATH}
DEV_ENV_OPTS := --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_VARS}
DEV_ENV_CMD := docker run ${DEV_ENV_OPTS} ${DEV_ENV_IMAGE}
@ -157,4 +157,4 @@ devenv:
include versioning.mk
include test.mk
include packer.mk
include packer.mk

Просмотреть файл

@ -166,7 +166,7 @@ func (dc *deployCmd) mergeAPIModel() error {
// overrides the api model and generates a new file
dc.apimodelPath, err = transform.MergeValuesWithAPIModel(dc.apimodelPath, m)
if err != nil {
return errors.Wrapf(err, "error merging --set values with the api model: %s")
return errors.Wrapf(err, "error merging --set values with the api model: %s", dc.apimodelPath)
}
log.Infoln(fmt.Sprintf("new api model file has been generated during merge: %s", dc.apimodelPath))

Просмотреть файл

@ -1,5 +1,5 @@
$REPO_PATH = "github.com/Azure/acs-engine"
$DEV_ENV_IMAGE = "quay.io/deis/go-dev:v1.14.0"
$DEV_ENV_IMAGE = "quay.io/deis/go-dev:v1.17.0"
$DEV_ENV_WORK_DIR = "/go/src/$REPO_PATH"
docker.exe run -it --rm -w $DEV_ENV_WORK_DIR -v `"$($PWD)`":$DEV_ENV_WORK_DIR $DEV_ENV_IMAGE bash

Просмотреть файл

@ -282,15 +282,15 @@ func getK8sVersionComponents(version string, overrides map[string]string) map[st
switch majorMinor {
case "1.12":
ret = map[string]string{
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.12"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.12"]["dashboard"],
"exechealthz": k8sComponentVersions["1.12"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.12"]["addon-resizer"],
"heapster": k8sComponentVersions["1.12"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.12"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.12"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.12"]["dashboard"],
"exechealthz": k8sComponentVersions["1.12"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.12"]["addon-resizer"],
"heapster": k8sComponentVersions["1.12"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.12"]["metrics-server"],
"dns": k8sComponentVersions["1.12"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.12"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.12"]["dnsmasq"],
@ -318,15 +318,15 @@ func getK8sVersionComponents(version string, overrides map[string]string) map[st
}
case "1.11":
ret = map[string]string{
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.11"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.11"]["dashboard"],
"exechealthz": k8sComponentVersions["1.11"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.11"]["addon-resizer"],
"heapster": k8sComponentVersions["1.11"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.11"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.11"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.11"]["dashboard"],
"exechealthz": k8sComponentVersions["1.11"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.11"]["addon-resizer"],
"heapster": k8sComponentVersions["1.11"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.11"]["metrics-server"],
"dns": k8sComponentVersions["1.11"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.11"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.11"]["dnsmasq"],
@ -354,15 +354,15 @@ func getK8sVersionComponents(version string, overrides map[string]string) map[st
}
case "1.10":
ret = map[string]string{
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.10"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.10"]["dashboard"],
"exechealthz": k8sComponentVersions["1.10"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.10"]["addon-resizer"],
"heapster": k8sComponentVersions["1.10"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.10"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.10"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.10"]["dashboard"],
"exechealthz": k8sComponentVersions["1.10"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.10"]["addon-resizer"],
"heapster": k8sComponentVersions["1.10"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.10"]["metrics-server"],
"dns": k8sComponentVersions["1.10"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.10"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.10"]["dnsmasq"],
@ -390,15 +390,15 @@ func getK8sVersionComponents(version string, overrides map[string]string) map[st
}
case "1.9":
ret = map[string]string{
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.9"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.9"]["dashboard"],
"exechealthz": k8sComponentVersions["1.9"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.9"]["addon-resizer"],
"heapster": k8sComponentVersions["1.9"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.9"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.9"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.9"]["dashboard"],
"exechealthz": k8sComponentVersions["1.9"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.9"]["addon-resizer"],
"heapster": k8sComponentVersions["1.9"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.9"]["metrics-server"],
"dns": k8sComponentVersions["1.9"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.9"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.9"]["dnsmasq"],
@ -425,15 +425,15 @@ func getK8sVersionComponents(version string, overrides map[string]string) map[st
}
case "1.8":
ret = map[string]string{
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.8"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.8"]["dashboard"],
"exechealthz": k8sComponentVersions["1.8"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.8"]["addon-resizer"],
"heapster": k8sComponentVersions["1.8"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.8"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v" + version,
"ccm": "cloud-controller-manager-amd64:v" + version,
"windowszip": "v" + version + "-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.8"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.8"]["dashboard"],
"exechealthz": k8sComponentVersions["1.8"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.8"]["addon-resizer"],
"heapster": k8sComponentVersions["1.8"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.8"]["metrics-server"],
"dns": k8sComponentVersions["1.8"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.8"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.8"]["dnsmasq"],
@ -458,13 +458,13 @@ func getK8sVersionComponents(version string, overrides map[string]string) map[st
}
case "1.7":
ret = map[string]string{
"hyperkube": "hyperkube-amd64:v" + version,
"dockerEngineVersion": k8sComponentVersions["1.7"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.7"]["dashboard"],
"exechealthz": k8sComponentVersions["1.7"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.7"]["addon-resizer"],
"heapster": k8sComponentVersions["1.7"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.7"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v" + version,
"dockerEngineVersion": k8sComponentVersions["1.7"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.7"]["dashboard"],
"exechealthz": k8sComponentVersions["1.7"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.7"]["addon-resizer"],
"heapster": k8sComponentVersions["1.7"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.7"]["metrics-server"],
"dns": k8sComponentVersions["1.7"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.7"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.7"]["dnsmasq"],
@ -489,13 +489,13 @@ func getK8sVersionComponents(version string, overrides map[string]string) map[st
}
case "1.6":
ret = map[string]string{
"hyperkube": "hyperkube-amd64:v" + version,
"dockerEngineVersion": k8sComponentVersions["1.6"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.6"]["dashboard"],
"exechealthz": k8sComponentVersions["1.6"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.6"]["addon-resizer"],
"heapster": k8sComponentVersions["1.6"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.6"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v" + version,
"dockerEngineVersion": k8sComponentVersions["1.6"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.6"]["dashboard"],
"exechealthz": k8sComponentVersions["1.6"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.6"]["addon-resizer"],
"heapster": k8sComponentVersions["1.6"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.6"]["metrics-server"],
"dns": k8sComponentVersions["1.6"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.6"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.6"]["dnsmasq"],

Просмотреть файл

@ -11,15 +11,15 @@ func TestGetK8sVersionComponents(t *testing.T) {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
expected := map[string]string{
"hyperkube": "hyperkube-amd64:v1.11.0-alpha.1",
"ccm": "cloud-controller-manager-amd64:v1.11.0-alpha.1",
"windowszip": "v1.11.0-alpha.1-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.11"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.11"]["dashboard"],
"exechealthz": k8sComponentVersions["1.11"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.11"]["addon-resizer"],
"heapster": k8sComponentVersions["1.11"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.11"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v1.11.0-alpha.1",
"ccm": "cloud-controller-manager-amd64:v1.11.0-alpha.1",
"windowszip": "v1.11.0-alpha.1-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.11"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.11"]["dashboard"],
"exechealthz": k8sComponentVersions["1.11"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.11"]["addon-resizer"],
"heapster": k8sComponentVersions["1.11"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.11"]["metrics-server"],
"dns": k8sComponentVersions["1.11"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.11"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.11"]["dnsmasq"],
@ -57,15 +57,15 @@ func TestGetK8sVersionComponents(t *testing.T) {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
expected = map[string]string{
"hyperkube": "hyperkube-amd64:v1.10.0",
"ccm": "cloud-controller-manager-amd64:v1.10.0",
"windowszip": "v1.10.0-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.10"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.10"]["dashboard"],
"exechealthz": k8sComponentVersions["1.10"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.10"]["addon-resizer"],
"heapster": k8sComponentVersions["1.10"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.10"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v1.10.0",
"ccm": "cloud-controller-manager-amd64:v1.10.0",
"windowszip": "v1.10.0-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.10"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.10"]["dashboard"],
"exechealthz": k8sComponentVersions["1.10"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.10"]["addon-resizer"],
"heapster": k8sComponentVersions["1.10"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.10"]["metrics-server"],
"dns": k8sComponentVersions["1.10"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.10"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.10"]["dnsmasq"],
@ -103,15 +103,15 @@ func TestGetK8sVersionComponents(t *testing.T) {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
expected = map[string]string{
"hyperkube": "hyperkube-amd64:v1.9.3",
"ccm": "cloud-controller-manager-amd64:v1.9.3",
"windowszip": "v1.9.3-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.9"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.9"]["dashboard"],
"exechealthz": k8sComponentVersions["1.9"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.9"]["addon-resizer"],
"heapster": k8sComponentVersions["1.9"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.9"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v1.9.3",
"ccm": "cloud-controller-manager-amd64:v1.9.3",
"windowszip": "v1.9.3-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.9"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.9"]["dashboard"],
"exechealthz": k8sComponentVersions["1.9"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.9"]["addon-resizer"],
"heapster": k8sComponentVersions["1.9"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.9"]["metrics-server"],
"dns": k8sComponentVersions["1.9"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.9"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.9"]["dnsmasq"],
@ -148,15 +148,15 @@ func TestGetK8sVersionComponents(t *testing.T) {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
expected = map[string]string{
"hyperkube": "hyperkube-amd64:v1.8.8",
"ccm": "cloud-controller-manager-amd64:v1.8.8",
"windowszip": "v1.8.8-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.8"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.8"]["dashboard"],
"exechealthz": k8sComponentVersions["1.8"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.8"]["addon-resizer"],
"heapster": k8sComponentVersions["1.8"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.8"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v1.8.8",
"ccm": "cloud-controller-manager-amd64:v1.8.8",
"windowszip": "v1.8.8-1int.zip",
"dockerEngineVersion": k8sComponentVersions["1.8"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.8"]["dashboard"],
"exechealthz": k8sComponentVersions["1.8"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.8"]["addon-resizer"],
"heapster": k8sComponentVersions["1.8"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.8"]["metrics-server"],
"dns": k8sComponentVersions["1.8"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.8"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.8"]["dnsmasq"],
@ -190,13 +190,13 @@ func TestGetK8sVersionComponents(t *testing.T) {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
expected = map[string]string{
"hyperkube": "hyperkube-amd64:v1.7.13",
"dockerEngineVersion": k8sComponentVersions["1.7"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.7"]["dashboard"],
"exechealthz": k8sComponentVersions["1.7"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.7"]["addon-resizer"],
"heapster": k8sComponentVersions["1.7"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.7"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v1.7.13",
"dockerEngineVersion": k8sComponentVersions["1.7"]["dockerEngine"],
DefaultDashboardAddonName: k8sComponentVersions["1.7"]["dashboard"],
"exechealthz": k8sComponentVersions["1.7"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.7"]["addon-resizer"],
"heapster": k8sComponentVersions["1.7"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.7"]["metrics-server"],
"dns": k8sComponentVersions["1.7"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.7"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.7"]["dnsmasq"],
@ -230,15 +230,15 @@ func TestGetK8sVersionComponents(t *testing.T) {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
expected = map[string]string{
"hyperkube": "hyperkube-amd64:v1.9.3",
"ccm": "cloud-controller-manager-amd64:v1.9.3",
"windowszip": "v1.9.3-2int.zip",
"dockerEngineVersion": "1.99.*",
DefaultDashboardAddonName: k8sComponentVersions["1.9"]["dashboard"],
"exechealthz": k8sComponentVersions["1.9"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.9"]["addon-resizer"],
"heapster": k8sComponentVersions["1.9"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.9"]["metrics-server"],
"hyperkube": "hyperkube-amd64:v1.9.3",
"ccm": "cloud-controller-manager-amd64:v1.9.3",
"windowszip": "v1.9.3-2int.zip",
"dockerEngineVersion": "1.99.*",
DefaultDashboardAddonName: k8sComponentVersions["1.9"]["dashboard"],
"exechealthz": k8sComponentVersions["1.9"]["exechealthz"],
"addonresizer": k8sComponentVersions["1.9"]["addon-resizer"],
"heapster": k8sComponentVersions["1.9"]["heapster"],
DefaultMetricsServerAddonName: k8sComponentVersions["1.9"]["metrics-server"],
"dns": k8sComponentVersions["1.9"]["kube-dns"],
"addonmanager": k8sComponentVersions["1.9"]["addon-manager"],
"dnsmasq": k8sComponentVersions["1.9"]["dnsmasq"],

Просмотреть файл

@ -1379,7 +1379,7 @@ func TestMasterProfileValidate(t *testing.T) {
DNSPrefix: "dummy",
VnetSubnetID: "testvnetstring",
FirstConsecutiveStaticIP: "10.0.0.1",
Count: 1,
Count: 1,
},
},
{
@ -1612,10 +1612,10 @@ func TestProperties_ValidateVNET(t *testing.T) {
{
name: "Invalid MasterProfile FirstConsecutiveStaticIP",
masterProfile: &MasterProfile{
VnetSubnetID: validVNetSubnetID,
Count: 1,
DNSPrefix: "foo",
VMSize: "Standard_DS2_v2",
VnetSubnetID: validVNetSubnetID,
Count: 1,
DNSPrefix: "foo",
VMSize: "Standard_DS2_v2",
FirstConsecutiveStaticIP: "10.0.0.invalid",
},
agentPoolProfiles: []*AgentPoolProfile{
@ -1632,10 +1632,10 @@ func TestProperties_ValidateVNET(t *testing.T) {
{
name: "Invalid vnetcidr",
masterProfile: &MasterProfile{
VnetSubnetID: validVNetSubnetID,
Count: 1,
DNSPrefix: "foo",
VMSize: "Standard_DS2_v2",
VnetSubnetID: validVNetSubnetID,
Count: 1,
DNSPrefix: "foo",
VMSize: "Standard_DS2_v2",
FirstConsecutiveStaticIP: "10.0.0.1",
VnetCidr: "10.1.0.0/invalid",
},

Просмотреть файл

@ -5,6 +5,7 @@ import (
"crypto/x509"
"encoding/pem"
"math/rand"
"strings"
"testing"
"github.com/Azure/acs-engine/pkg/i18n"
@ -104,61 +105,6 @@ func TestPointerToInt(t *testing.T) {
func TestCreateSSH(t *testing.T) {
rg := rand.New(rand.NewSource(42))
expectedPublicKeyString := "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCyx5MHXjJvJAx5DJ9FZNIDa/QTWorSF+Ra21Tz49DQWfdSESnCGFFVBh/MQUFGv5kCenbmqEjsWF177kFOdv1vOTz4sKRlHg7u3I9uCyyZQrWx4X4RdNk7eX+isQVjFXYw2W1rRDUrnK/82qVTv1f0gu1DV4Z7GoI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
C0YFmKJxG2kYnhc4lVHZNrabwsS2dBEWH5hwtDOXAyGoYTb17dmL6ElAtb1b7aGc
8Cn0fSYAFAp53tLkNe9JNOE+fLtcmb/OQ2ybSRVxzmMZzX82w+37sDetmpFZsxEs
7P5dCwdDAx6vT+q8I6krYy2x9uTJ8aOOGYsCggEAAW9qf3UNuY0IB9kmHF3Oo1gN
s82h0OLpjJkW+5YYC0vYQit4AYNjXw+T+Z6WKOHOG3LIuQVC6Qj4c1+oN6sJi7re
Ey6Zq7/uWmYUpi9C8CbX1clJwany0V2PjGKL94gCIl7vaXS/4ouzzfl8qbF7FjQ4
Qq/HPWSIC9Z8rKtUDDHeZYaLqvdhqbas/drqCXmeLeYM6Om4lQJdP+zip3Ctulp1
EPDesL0rH+3s1CKpgkhYdbJ675GFoGoq+X21QaqsdvoXmmuJF9qq9Tq+JaWloUNq
2FWXLhSX02saIdbIheS1fv/LqekXZd8eFXUj7VZ15tPG3SJqORS0pMtxSAJvLw==
-----END RSA PRIVATE KEY-----
`
translator := &i18n.Translator{
Locale: nil,
}
@ -174,12 +120,20 @@ EPDesL0rH+3s1CKpgkhYdbJ675GFoGoq+X21QaqsdvoXmmuJF9qq9Tq+JaWloUNq
pemBuffer := bytes.Buffer{}
pem.Encode(&pemBuffer, pemBlock)
if pemBuffer.String() != expectedPrivateKeyString {
t.Fatalf("Private Key did not match expected format/value")
if !strings.HasPrefix(pemBuffer.String(), "-----BEGIN RSA PRIVATE KEY-----") {
t.Fatalf("Private Key did not start with expected header")
}
if publicKey != expectedPublicKeyString {
t.Fatalf("Public Key did not match expected format/value")
if privateKey.N.BitLen() != SSHKeySize {
t.Fatalf("Private Key was of length %d but %d was expected", privateKey.N.BitLen(), SSHKeySize)
}
if err := privateKey.Validate(); err != nil {
t.Fatalf("Private Key failed validation: %v", err)
}
if !strings.HasPrefix(publicKey, "ssh-rsa ") {
t.Fatalf("Public Key did not start with expected header")
}
}

Просмотреть файл

@ -106,7 +106,7 @@ func (c *Config) PrepareMasterKubeConfigs() error {
{
Name: externalEndpointName,
Cluster: ClusterInfo{
Server: fmt.Sprintf("https://%s", externalEndpoint),
Server: fmt.Sprintf("https://%s", externalEndpoint),
CertificateAuthorityData: base64.StdEncoding.EncodeToString(cacert),
},
},
@ -139,7 +139,7 @@ func (c *Config) PrepareMasterKubeConfigs() error {
{
Name: localhostEndpointName,
Cluster: ClusterInfo{
Server: fmt.Sprintf("https://%s", localhostEndpoint),
Server: fmt.Sprintf("https://%s", localhostEndpoint),
CertificateAuthorityData: base64.StdEncoding.EncodeToString(cacert),
},
},
@ -172,7 +172,7 @@ func (c *Config) PrepareMasterKubeConfigs() error {
{
Name: endpointName,
Cluster: ClusterInfo{
Server: fmt.Sprintf("https://%s", endpoint),
Server: fmt.Sprintf("https://%s", endpoint),
CertificateAuthorityData: base64.StdEncoding.EncodeToString(cacert),
},
},
@ -231,7 +231,7 @@ func (c *Config) PrepareBootstrapKubeConfig() error {
{
Name: epName,
Cluster: ClusterInfo{
Server: fmt.Sprintf("https://%s", ep),
Server: fmt.Sprintf("https://%s", ep),
CertificateAuthorityData: base64.StdEncoding.EncodeToString(cacert),
},
},

Просмотреть файл

@ -226,7 +226,7 @@ func (c *Config) PrepareMasterCerts() error {
NotAfter: now.AddDate(5, 0, 0),
KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageKeyEncipherment | x509.KeyUsageCertSign,
BasicConstraintsValid: true,
IsCA: true,
IsCA: true,
}
template.Subject = cacert.template.Subject

Просмотреть файл

@ -106,7 +106,7 @@ func (c *Config) PrepareMasterKubeConfigs() error {
{
Name: externalEndpointName,
Cluster: ClusterInfo{
Server: fmt.Sprintf("https://%s", externalEndpoint),
Server: fmt.Sprintf("https://%s", externalEndpoint),
CertificateAuthorityData: base64.StdEncoding.EncodeToString(cacert),
},
},
@ -139,7 +139,7 @@ func (c *Config) PrepareMasterKubeConfigs() error {
{
Name: localhostEndpointName,
Cluster: ClusterInfo{
Server: fmt.Sprintf("https://%s", localhostEndpoint),
Server: fmt.Sprintf("https://%s", localhostEndpoint),
CertificateAuthorityData: base64.StdEncoding.EncodeToString(cacert),
},
},
@ -172,7 +172,7 @@ func (c *Config) PrepareMasterKubeConfigs() error {
{
Name: endpointName,
Cluster: ClusterInfo{
Server: fmt.Sprintf("https://%s", endpoint),
Server: fmt.Sprintf("https://%s", endpoint),
CertificateAuthorityData: base64.StdEncoding.EncodeToString(cacert),
},
},
@ -231,7 +231,7 @@ func (c *Config) PrepareBootstrapKubeConfig() error {
{
Name: epName,
Cluster: ClusterInfo{
Server: fmt.Sprintf("https://%s", ep),
Server: fmt.Sprintf("https://%s", ep),
CertificateAuthorityData: base64.StdEncoding.EncodeToString(cacert),
},
},

Просмотреть файл

@ -226,7 +226,7 @@ func (c *Config) PrepareMasterCerts() error {
NotAfter: now.AddDate(5, 0, 0),
KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageKeyEncipherment | x509.KeyUsageCertSign,
BasicConstraintsValid: true,
IsCA: true,
IsCA: true,
}
template.Subject = cacert.template.Subject

Просмотреть файл

@ -503,7 +503,7 @@ func (ku *Upgrader) upgradeAgentScaleSets(ctx context.Context) error {
ku.logger.Errorf(
"Failed to delete VM %s in VMSS %s",
vmToUpgrade.Name,
vmssToUpgrade)
vmssToUpgrade.Name)
return err
}
@ -512,7 +512,7 @@ func (ku *Upgrader) upgradeAgentScaleSets(ctx context.Context) error {
vmToUpgrade.Name,
vmssToUpgrade.Name)
}
ku.logger.Infof("Completed upgrading VMSS %s", vmssToUpgrade)
ku.logger.Infof("Completed upgrading VMSS %s", vmssToUpgrade.Name)
}
ku.logger.Infoln("Completed upgrading all VMSS")

Просмотреть файл

@ -64,7 +64,7 @@ var _ = Describe("Azure Container Cluster using the OpenShift Orchestrator", fun
},
"compute": {
"node-role.kubernetes.io/compute": "true",
"region": "primary",
"region": "primary",
},
"infra": {
"region": "infra",