Skip to content

Commit

Permalink
Merge tag 'v0.9.3' into migration
Browse files Browse the repository at this point in the history
  • Loading branch information
wenwu449 committed Nov 28, 2017
2 parents adbc1cf + bd006fc commit 8ef4f2b
Show file tree
Hide file tree
Showing 5,855 changed files with 1,266,014 additions and 706,936 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
337 changes: 105 additions & 232 deletions .circleci/config.yml

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ test/acs-engine-test/report/TestReport.json
*.swp

# I have no idea why these get generated when I run the e2e test
test/e2e/kubernetes/translations/
test/e2e/kubernetes/translations/

# test outputs
cmd/_test_output

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The Microsoft acs-engine project accepts contributions via GitHub pull requests.
We'd love to accept your patches! Before we can take them, we have to jump a
couple of legal hurdles.

The [Microsoft CLA](https://cla.microsoft.com/) must be signed by all contributors. Please fill out either the individual or corporate Contributor License Agreement (CLA). Once you are CLA'ed, we'll be able to accept your pull requests. Once you are CLA'ed, we'll be able to accept your pull requests.
The [Microsoft CLA](https://cla.microsoft.com/) must be signed by all contributors. Please fill out either the individual or corporate Contributor License Agreement (CLA). Once you are CLA'ed, we'll be able to accept your pull requests.

***NOTE***: Only original source code from you and other people that have
signed the CLA can be accepted into the repository.
Expand Down
28 changes: 13 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,10 @@ RUN apt-get update \
&& apt-get -y install python-pip make build-essential curl openssl vim jq gettext \
&& rm -rf /var/lib/apt/lists/*

ENV GO_VERSION 1.8
RUN mkdir /tmp/godeb \
&& curl "https://godeb.s3.amazonaws.com/godeb-amd64.tar.gz" > /tmp/godeb/godeb.tar.gz \
&& (cd /tmp/godeb; tar zvxf godeb.tar.gz; ./godeb install "${GO_VERSION}") \
&& rm -rf /tmp/godeb

# See: https://github.com/Azure/azure-cli/blob/master/packaged_releases/bundled/README.md#using-the-bundled-installer
ENV AZURE_CLI_BUNDLE_VERSION 0.2.10-1
RUN mkdir /tmp/azurecli \
&& curl "https://azurecliprod.blob.core.windows.net/bundled/azure-cli_bundle_${AZURE_CLI_BUNDLE_VERSION}.tar.gz" > /tmp/azurecli/azure-cli_bundle.tar.gz \
&& (cd /tmp/azurecli \
&& tar -xvzf azure-cli_bundle.tar.gz \
&& azure-cli_bundle_*/installer --bin-dir /usr/local/bin) \
&& rm -rf /tmp/azurecli
ENV GO_VERSION 1.8.3

RUN wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz

RUN curl -fsSL https://get.docker.com/ | sh

Expand All @@ -27,7 +17,7 @@ RUN curl "https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_V
&& chmod +x /usr/local/bin/kubectl

ENV GOPATH /gopath
ENV PATH "${PATH}:${GOPATH}/bin"
ENV PATH "${PATH}:${GOPATH}/bin:/usr/local/go/bin"

RUN git clone https://github.com/akesterson/cmdarg.git /tmp/cmdarg \
&& cd /tmp/cmdarg && make install && rm -rf /tmp/cmdarg
Expand All @@ -46,4 +36,12 @@ RUN echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-releas
&& apt-get update \
&& apt-get -y install dotnet-sdk-2.0.0-preview2-006497

# See: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest#install-on-debianubuntu-with-apt-get
RUN apt-get update \
&& apt-get install apt-transport-https \
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" > /etc/apt/sources.list.d/azure-cli.list \
&& apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893 \
&& apt-get update \
&& apt-get install azure-cli

ADD . /gopath/src/github.com/Azure/acs-engine
22 changes: 22 additions & 0 deletions Dockerfile.k8swin
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM buildpack-deps:xenial

RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install apt-transport-https ca-certificates make gcc gcc-aarch64-linux-gnu rsync python-pip build-essential curl openssl vim jq \
&& rm -rf /var/lib/apt/lists/*

ENV GO_VERSION 1.8.3

RUN wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz

RUN curl -fsSL https://get.docker.com/ | sh

ENV GOPATH /gopath
ENV PATH "${PATH}:${GOPATH}/bin:/usr/local/go/bin"

RUN go get -u github.com/jteeuwen/go-bindata/go-bindata

WORKDIR /gopath/src/k8s.io/kubernetes

ADD . /gopath/src/k8s.io/kubernetes
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,18 @@ BINARY_DEST_DIR ?= bin

all: build

.PHONY: dev
dev:
$(DEV_ENV_CMD_IT) bash

.PHONY: generate
generate: bootstrap
go generate $(GOFLAGS) -v `glide novendor | xargs go list`

.PHONY: generate-azure-constants
generate-azure-constants:
python pkg/acsengine/Get-AzureConstants.py

.PHONY: build
build: generate
GOBIN=$(BINDIR) $(GO) install $(GOFLAGS) -ldflags '$(LDFLAGS)'
Expand Down Expand Up @@ -129,7 +137,8 @@ ifndef HAS_GINKGO
endif

build-vendor:
${DEV_ENV_CMD} rm -f glide.lock && rm -Rf vendor/ && glide --debug install --force
${DEV_ENV_CMD} rm -f glide.lock && rm -Rf vendor/ && glide --debug install --force --strip-vendor
rm -rf vendor/github.com/docker/distribution/contrib/docker-integration/generated_certs.d

ci: bootstrap test-style build test lint
./scripts/coverage.sh --coveralls
Expand Down
8 changes: 4 additions & 4 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (dc *deployCmd) validate(cmd *cobra.Command, args []string) error {
},
}
// skip validating the model fields for now
dc.containerService, dc.apiVersion, err = apiloader.LoadContainerServiceFromFile(dc.apimodelPath, false, nil)
dc.containerService, dc.apiVersion, err = apiloader.LoadContainerServiceFromFile(dc.apimodelPath, false, false, nil)
if err != nil {
return fmt.Errorf(fmt.Sprintf("error parsing the api model: %s", err.Error()))
}
Expand Down Expand Up @@ -192,7 +192,7 @@ func autofillApimodel(dc *deployCmd) {
dc.containerService.Properties.LinuxProfile.SSH.PublicKeys = []api.PublicKey{{KeyData: publicKey}}
}

_, err = dc.client.EnsureResourceGroup(dc.resourceGroup, dc.location)
_, err = dc.client.EnsureResourceGroup(dc.resourceGroup, dc.location, nil)
if err != nil {
log.Fatalln(err)
}
Expand Down Expand Up @@ -239,7 +239,7 @@ func revalidateApimodel(apiloader *api.Apiloader, containerService *api.Containe
if err != nil {
return nil, "", err
}
return apiloader.DeserializeContainerService(rawVersionedAPIModel, true, nil)
return apiloader.DeserializeContainerService(rawVersionedAPIModel, true, false, nil)
}

func (dc *deployCmd) run() error {
Expand All @@ -254,7 +254,7 @@ func (dc *deployCmd) run() error {
log.Fatalln("failed to initialize template generator: %s", err.Error())
}

template, parameters, certsgenerated, err := templateGenerator.GenerateTemplate(dc.containerService)
template, parameters, certsgenerated, err := templateGenerator.GenerateTemplate(dc.containerService, acsengine.DefaultGeneratorCode)
if err != nil {
log.Fatalf("error generating template %s: %s", dc.apimodelPath, err.Error())
os.Exit(1)
Expand Down
4 changes: 2 additions & 2 deletions cmd/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
const ExampleAPIModel = `{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": { "orchestratorType": "Kubernetes", "kubernetesConfig": { "useManagedIdentity": %s } },
"orchestratorProfile": { "orchestratorType": "Kubernetes", "kubernetesConfig": { "useManagedIdentity": %s, "etcdVersion" : "2.5.2" } },
"masterProfile": { "count": 1, "dnsPrefix": "", "vmSize": "Standard_D2_v2" },
"agentPoolProfiles": [ { "name": "linuxpool1", "count": 2, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet" } ],
"windowsProfile": { "adminUsername": "azureuser", "adminPassword": "replacepassword1234$" },
Expand Down Expand Up @@ -52,7 +52,7 @@ func testAutodeployCredentialHandling(t *testing.T, useManagedIdentity bool, cli
}

apimodel := getExampleAPIModel(useManagedIdentity, clientID, clientSecret)
cs, ver, err := apiloader.DeserializeContainerService([]byte(apimodel), false, nil)
cs, ver, err := apiloader.DeserializeContainerService([]byte(apimodel), false, false, nil)
if err != nil {
t.Fatalf("unexpected error deserializing the example apimodel: %s", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (gc *generateCmd) validate(cmd *cobra.Command, args []string) error {
Locale: gc.locale,
},
}
gc.containerService, gc.apiVersion, err = apiloader.LoadContainerServiceFromFile(gc.apimodelPath, true, nil)
gc.containerService, gc.apiVersion, err = apiloader.LoadContainerServiceFromFile(gc.apimodelPath, true, false, nil)
if err != nil {
return fmt.Errorf(fmt.Sprintf("error parsing the api model: %s", err.Error()))
}
Expand Down Expand Up @@ -143,7 +143,7 @@ func (gc *generateCmd) run() error {
log.Fatalln("failed to initialize template generator: %s", err.Error())
}

template, parameters, certsGenerated, err := templateGenerator.GenerateTemplate(gc.containerService)
template, parameters, certsGenerated, err := templateGenerator.GenerateTemplate(gc.containerService, acsengine.DefaultGeneratorCode)
if err != nil {
log.Fatalf("error generating template %s: %s", gc.apimodelPath, err.Error())
os.Exit(1)
Expand Down
6 changes: 3 additions & 3 deletions cmd/orchestrators.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
type orchestratorsCmd struct {
// user input
orchestrator string
release string
version string
}

func newOrchestratorsCmd() *cobra.Command {
Expand All @@ -34,13 +34,13 @@ func newOrchestratorsCmd() *cobra.Command {

f := command.Flags()
f.StringVar(&oc.orchestrator, "orchestrator", "", "orchestrator name (optional) ")
f.StringVar(&oc.release, "release", "", "orchestrator release (optional)")
f.StringVar(&oc.version, "version", "", "orchestrator version (optional)")

return command
}

func (oc *orchestratorsCmd) run(cmd *cobra.Command, args []string) error {
orchs, err := api.GetOrchestratorVersionProfileListVLabs(oc.orchestrator, oc.release)
orchs, err := api.GetOrchestratorVersionProfileListVLabs(oc.orchestrator, oc.version)
if err != nil {
return err
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/orchestrators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,29 @@ var _ = Describe("The orchestrators command", func() {

It("should fail on unprovided orchestrator", func() {
command := &orchestratorsCmd{
release: "1.1",
version: "1.1.1",
}

err := command.run(nil, nil)
Expect(err).NotTo(BeNil())
Expect(err.Error()).To(Equal("Must specify orchestrator for release '1.1'"))
Expect(err.Error()).To(Equal("Must specify orchestrator for version '1.1.1'"))
})

It("should fail on unsupported release", func() {
It("should fail on unsupported version", func() {
command := &orchestratorsCmd{
orchestrator: "kubernetes",
release: "1.1",
version: "1.1.1",
}

err := command.run(nil, nil)
Expect(err).NotTo(BeNil())
Expect(err.Error()).To(Equal("Kubernetes release 1.1 is not supported"))
Expect(err.Error()).To(Equal("Kubernetes version 1.1.1 is not supported"))
})

It("should succeed", func() {
command := &orchestratorsCmd{
orchestrator: "kubernetes",
release: "1.7",
version: "1.7.10",
}

err := command.run(nil, nil)
Expand Down
5 changes: 5 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func NewRootCmd() *cobra.Command {
rootCmd.AddCommand(newDeployCmd())
rootCmd.AddCommand(newOrchestratorsCmd())
rootCmd.AddCommand(newUpgradeCmd())
rootCmd.AddCommand(newScaleCmd())

return rootCmd
}
Expand Down Expand Up @@ -109,6 +110,10 @@ func (authArgs *authArgs) getClient() (*armhelpers.AzureClient, error) {
if err != nil {
return nil, err
}
err = client.EnsureProvidersRegistered(authArgs.SubscriptionID.String())
if err != nil {
return nil, err
}
client.AddAcceptLanguages([]string{authArgs.language})
return client, nil
}

0 comments on commit 8ef4f2b

Please sign in to comment.