Skip to content

Commit 05f5788

Browse files
committed
Merge remote-tracking branch 'origin/main' into HEAD
2 parents 1b44f5f + e56ec51 commit 05f5788

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1580
-290
lines changed

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ $(BUILD_DIR)/$(PROJECT): $(STATIK_FILES) $(GO_FILES) $(BUILD_DIR)
7777
$(eval tags = $(GO_BUILD_TAGS_$(GOOS)) $(GO_BUILD_TAGS_$(GOOS)_$(GOARCH)))
7878
GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=1 \
7979
go build -gcflags="all=-N -l" -tags "$(tags)" -ldflags "$(ldflags)" -o $@ $(BUILD_PACKAGE)
80+
ifeq ($(GOOS),darwin)
81+
codesign --force --deep --sign - $@
82+
endif
8083

8184
.PHONY: install
8285
install: $(BUILD_DIR)/$(PROJECT)

cmd/skaffold/app/cmd/cmd.go

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ func NewSkaffoldCommand(out, errOut io.Writer) *cobra.Command {
195195
rootCmd.AddCommand(NewCmdGeneratePipeline())
196196
rootCmd.AddCommand(NewCmdSurvey())
197197
rootCmd.AddCommand(NewCmdInspect())
198+
rootCmd.AddCommand(NewCmdLint())
198199

199200
templates.ActsAsRootCommand(rootCmd, nil, groups...)
200201
rootCmd.PersistentFlags().StringVarP(&v, "verbosity", "v", log.DefaultLogLevel.String(), fmt.Sprintf("Log level: one of %v", log.AllLevels))

cmd/skaffold/app/cmd/flags.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ var flagRegistry = []Flag{
569569
"run": true,
570570
},
571571
IsEnum: true,
572-
}, {
572+
},
573+
{
573574
Name: "load-images",
574575
Usage: "If true, skaffold will force load the container images into the local cluster.",
575576
Value: &opts.ForceLoadImages,

cmd/skaffold/app/cmd/lint.go

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
Copyright 2021 The Skaffold Authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package cmd
18+
19+
import (
20+
"context"
21+
"io"
22+
23+
"github.com/spf13/cobra"
24+
25+
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/lint"
26+
)
27+
28+
var outFormat string
29+
30+
func NewCmdLint() *cobra.Command {
31+
return NewCmd("lint").
32+
WithDescription("Lints skaffold app skaffold.yaml(s) to improve skaffold's - user-experience, performance, etc..").
33+
WithCommonFlags().
34+
WithFlags([]*Flag{
35+
{Value: &outFormat, Name: "format", DefValue: lint.PlainTextOutput,
36+
Usage: "Output format. One of: plain-text(default) or json"}}).
37+
Hidden().
38+
NoArgs(lintCmd)
39+
}
40+
41+
func lintCmd(ctx context.Context, out io.Writer) error {
42+
return lint.Lint(ctx, out, lint.Options{
43+
Filename: opts.ConfigurationFile,
44+
RepoCacheDir: opts.RepoCacheDir,
45+
OutFormat: outFormat,
46+
Modules: opts.ConfigurationFilter,
47+
Profiles: opts.Profiles,
48+
})
49+
}

deploy/skaffold/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# This base image has to be updated manually after running `make build_deps`
16-
FROM gcr.io/k8s-skaffold/build_deps:e34c0c143e9fe6c39a4f119547289d7142afcb0d as build
16+
FROM gcr.io/k8s-skaffold/build_deps:cc22ba3ccc5e3f854b540493fc781f7c5a4f5ece as build
1717
WORKDIR /skaffold
1818

1919
FROM build as builder

deploy/skaffold/Dockerfile.deps

+57-26
Original file line numberDiff line numberDiff line change
@@ -12,76 +12,107 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
ARG ARCH=amd64
16+
1517
# Download kubectl
1618
FROM alpine:3.10 as download-kubectl
17-
# Track default version installed by Google Cloud SDK: 341.0.0 moved to 1.18(.18)
19+
ARG ARCH
20+
# Track default version installed by Google Cloud SDK: 358.0.0 moved to 1.20(.10)
1821
# https://cloud.google.com/sdk/docs/release-notes
19-
ENV KUBECTL_VERSION v1.18.18
20-
ENV KUBECTL_URL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl
21-
RUN wget -O kubectl "${KUBECTL_URL}"
22+
ENV KUBECTL_VERSION v1.20.10
23+
ENV KUBECTL_URL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl
24+
# SHAs at gs://kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/
25+
COPY digests/kubectl.${ARCH}.sha512 .
26+
RUN wget -O kubectl "${KUBECTL_URL}" && sha512sum -c kubectl.${ARCH}.sha512
2227
RUN chmod +x kubectl
2328

2429
# Download helm (see https://github.com/helm/helm/releases/latest)
2530
FROM alpine:3.10 as download-helm
26-
ENV HELM_VERSION v3.6.3
27-
ENV HELM_URL https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz
28-
RUN wget -O helm.tar.gz "${HELM_URL}"
31+
ARG ARCH
32+
RUN echo arch=$ARCH
33+
ENV HELM_VERSION v3.7.1
34+
ENV HELM_URL https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz
35+
COPY digests/helm.${ARCH}.sha256 .
36+
RUN wget -O helm.tar.gz "${HELM_URL}" && sha256sum -c helm.${ARCH}.sha256
2937
RUN tar -xvf helm.tar.gz --strip-components 1
3038

3139
# Download kustomize
3240
FROM alpine:3.10 as download-kustomize
33-
ENV KUSTOMIZE_VERSION 4.2.0
34-
ENV KUSTOMIZE_URL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz
35-
RUN wget -O kustomize.tar.gz "${KUSTOMIZE_URL}"
41+
ARG ARCH
42+
ENV KUSTOMIZE_VERSION 4.4.0
43+
ENV KUSTOMIZE_URL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_${ARCH}.tar.gz
44+
COPY digests/kustomize.${ARCH}.sha256 .
45+
RUN wget -O kustomize.tar.gz "${KUSTOMIZE_URL}" && sha256sum -c kustomize.${ARCH}.sha256
3646
RUN tar -xvf kustomize.tar.gz
3747

3848
# Download kpt
3949
FROM alpine:3.10 as download-kpt
40-
ENV KPT_VERSION 1.0.0-beta.2
50+
ARG ARCH
51+
ENV KPT_VERSION 0.39.3
4152
ENV KPT_URL https://github.com/GoogleContainerTools/kpt/releases/download/v${KPT_VERSION}/kpt_linux_amd64
42-
RUN wget -O kpt "${KPT_URL}"
53+
COPY digests/kpt.${ARCH}.sha256 .
54+
RUN wget -O kpt "${KPT_URL}" && sha256sum -c kpt.${ARCH}.sha256
4355
RUN chmod +x kpt
4456

4557
# Download kompose
4658
FROM alpine:3.10 as download-kompose
47-
ENV KOMPOSE_VERSION v1.23.0
59+
ARG ARCH
60+
ENV KOMPOSE_VERSION v1.24.0
4861
ENV KOMPOSE_URL https://github.com/kubernetes/kompose/releases/download/${KOMPOSE_VERSION}/kompose-linux-amd64
49-
RUN wget -O kompose "${KOMPOSE_URL}"
62+
COPY digests/kompose.${ARCH}.sha256 .
63+
RUN wget -O kompose "${KOMPOSE_URL}" && sha256sum -c kompose.${ARCH}.sha256
5064
RUN chmod +x kompose
5165

5266
# Download container-structure-test (https://github.com/GoogleContainerTools/container-structure-test/releases/latest)
5367
FROM alpine:3.10 as download-container-structure-test
68+
ARG ARCH
5469
ENV CONTAINER_STRUCTURE_TEST_VERSION v1.10.0
55-
ENV CONTAINER_STRUCTURE_TEST_URL https://storage.googleapis.com/container-structure-test/${CONTAINER_STRUCTURE_TEST_VERSION}/container-structure-test-linux-amd64
56-
RUN wget -O container-structure-test "${CONTAINER_STRUCTURE_TEST_URL}"
70+
ENV CONTAINER_STRUCTURE_TEST_URL https://storage.googleapis.com/container-structure-test/${CONTAINER_STRUCTURE_TEST_VERSION}/container-structure-test-linux-${ARCH}
71+
COPY digests/container-structure-test.${ARCH}.sha512 .
72+
RUN wget -O container-structure-test "${CONTAINER_STRUCTURE_TEST_URL}" && sha512sum -c container-structure-test.${ARCH}.sha512
5773
RUN chmod +x container-structure-test
5874

5975
# Download kind
6076
FROM alpine:3.10 as download-kind
77+
ARG ARCH
6178
ENV KIND_VERSION v0.11.1
62-
ENV KIND_URL https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64
63-
RUN wget -O kind "${KIND_URL}"
79+
ENV KIND_URL https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-${ARCH}
80+
COPY digests/kind.${ARCH}.sha512 .
81+
RUN wget -O kind "${KIND_URL}" && sha512sum -c kind.${ARCH}.sha512
6482
RUN chmod +x kind
6583

6684
# Download k3d
6785
FROM alpine:3.10 as download-k3d
68-
ENV K3D_VERSION v4.4.7
86+
ARG ARCH
87+
ENV K3D_VERSION v5.0.1
6988
ENV K3D_URL https://github.com/rancher/k3d/releases/download/${K3D_VERSION}/k3d-linux-amd64
70-
RUN wget -O k3d "${K3D_URL}"
89+
COPY digests/k3d.${ARCH}.sha256 .
90+
RUN wget -O k3d "${K3D_URL}" && sha256sum -c k3d.${ARCH}.sha256
7191
RUN chmod +x k3d
7292

7393
# Download gcloud
7494
FROM alpine:3.10 as download-gcloud
75-
ENV GCLOUD_VERSION 349.0.0
76-
ENV GCLOUD_URL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_VERSION}-linux-x86_64.tar.gz
77-
RUN wget -O gcloud.tar.gz "${GCLOUD_URL}"
95+
ARG ARCH
96+
ENV GCLOUD_VERSION 360.0.0
97+
ENV GCLOUD_URL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_VERSION}-linux-GCLOUDARCH.tar.gz
98+
# SHAs listed at https://cloud.google.com/sdk/docs/downloads-versioned-archives
99+
COPY digests/gcloud.${ARCH}.sha256 .
100+
RUN \
101+
GCLOUDARCH=$(case "${ARCH}" in amd64) echo x86_64;; *) echo ${ARCH};; esac); \
102+
wget -O gcloud.tar.gz $(echo "${GCLOUD_URL}" | sed "s/GCLOUDARCH/${GCLOUDARCH}/g") && \
103+
sha256sum -c gcloud.${ARCH}.sha256
78104
RUN tar -zxf gcloud.tar.gz
79105

80106
# Download bazel
81107
FROM alpine:3.10 as download-bazel
82-
ENV BAZEL_VERSION 4.1.0
83-
ENV BAZEL_URL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64
84-
RUN wget -O bazel "${BAZEL_URL}"
108+
ARG ARCH
109+
ENV BAZEL_VERSION 4.2.1
110+
ENV BAZEL_URL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-BAZELARCH
111+
COPY digests/bazel.${ARCH}.sha256 .
112+
RUN \
113+
BAZELARCH=$(case "${ARCH}" in amd64) echo x86_64;; *) echo ${ARCH};; esac); \
114+
wget -O bazel $(echo "${BAZEL_URL}" | sed "s/BAZELARCH/${BAZELARCH}/g") && \
115+
sha256sum -c bazel.${ARCH}.sha256
85116
RUN chmod +x bazel
86117

87118
FROM gcr.io/gcp-runtimes/ubuntu_18_0_4 as runtime_deps
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1a4f3a3ce292307bceeb44f459883859c793436d564b95319aacb8af1f20557c bazel
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
392ce1d4462d55b5c421f83b6be1a22e7e50380f54633d90a963f37155550ebaabf27797877003322938136163fedaec461f44ae7acce1b23b7fd869d35f8d28 container-structure-test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6192cb2791f592da6d372888dbd7ee81d3d91f255d844ab5fc518fc97e453648 gcloud.tar.gz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6cd6cad4b97e10c33c978ff3ac97bb42b68f79766f1d2284cfd62ec04cd177f4 helm.tar.gz
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
84a45821b16df2fb60ab9144bad3d0e67805a2bfee17bee51b09bc1e75c0fc10 k3d
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ce57a5438dcbec1269c583470695d11e5e759ad22a88a1214f0564e6513b912e3ffd380f6be61afc759a66b611bf1d966043cef16059ac096d96d81129281204 kind
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
15684b179756654d7eb6a0360bdf887bed906505dee821927b6f61920b962b83 kompose
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3acf9123f98b0816d86d6abbcdcfbf15c6053a830105233534a14dbbd0387ed7 kpt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
caab85815b7180e5f02c539fef9574aa690ad1ca1a9622f90cce9efe4d00f81739fa53afa084c6e302f0144c13d9375542d163750060a00e70e7ff8a3824b010 kubectl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bf3a0d7409d9ce6a4a393ba61289047b4cb875a36ece1ec94b36924a9ccbaa0f kustomize.tar.gz

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ require (
8383
github.com/spf13/pflag v1.0.5
8484
github.com/tektoncd/pipeline v0.5.1-0.20190731183258-9d7e37e85bf8
8585
github.com/xeipuuv/gojsonschema v1.2.0
86+
go.lsp.dev/protocol v0.11.2 // indirect
8687
go.opentelemetry.io/otel v0.20.0
8788
go.opentelemetry.io/otel/exporters/stdout v0.20.0
8889
go.opentelemetry.io/otel/exporters/trace/jaeger v0.20.0

0 commit comments

Comments
 (0)