Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split proxy-init into separate repo #2824

Merged
merged 10 commits into from
Jun 3, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Split proxy-init into separate repo
Fixes #2563

The new repo is https://github.com/linkerd/linkerd2-proxy-init, and I
tagged the latest there `stable-2.3.0`. The plan would be to tag it each
time it is updated, using the same tag of the linkerd2 repo that
required that change. I think that helps keeping track of which
proxy-init version is required by which linkerd2 version. Let me know if
you have a different opinion!

Here, I've removed the `/proxy-init` dir and pinned the injected
proxy-init version to `stable-2.3.0` in the injector code and tests.

`/cni-plugin` depends on proxy-init, so I updated the import paths
there, and could verify CNI is still working (there is some flakiness
but unrelated to this PR).

For consistency, I added a `--init-image-version` flag to `linkerd
inject` along with its corresponding override config annotation. If
deemed too much, we can hide it (along with `--init-image`).

Signed-off-by: Alejandro Pedraza <alejandro@buoyant.io>
alpeb committed Jun 3, 2019
commit 9f057848877faffac31f61a876d06f3b12e504df
2 changes: 1 addition & 1 deletion Dockerfile-proxy
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ RUN (proxy=$(bin/fetch-proxy $PROXY_VERSION) && \
echo "$version" >version.txt)

## compile proxy-identity agent
FROM gcr.io/linkerd-io/go-deps:f364cab7 as golang
FROM gcr.io/linkerd-io/go-deps:2f1a6eb3 as golang
WORKDIR /go/src/github.com/linkerd/linkerd2
ENV CGO_ENABLED=0 GOOS=linux
COPY pkg/flags pkg/flags
13 changes: 13 additions & 0 deletions Gopkg.lock
Original file line number Diff line number Diff line change
@@ -429,6 +429,17 @@
revision = "be7667cfd0cca15b55724949f4e625ddf49f740f"
version = "v0.1.7"

[[projects]]
digest = "1:ee5461d303279aa5cab1f39aa1fd977bcd6072418e343563aa338ec83d5b1491"
name = "github.com/linkerd/linkerd2-proxy-init"
packages = [
"cmd",
"iptables",
]
pruneopts = ""
revision = "458ed04ebd1d23db106200b49afb65fc7f6db47b"
version = "stable-2.3.0"

[[projects]]
branch = "master"
digest = "1:212bebc561f4f654a653225868b2a97353cd5e160dc0b0bbc7232b06608474ec"
@@ -1277,6 +1288,8 @@
"github.com/linkerd/linkerd2-proxy-api/go/identity",
"github.com/linkerd/linkerd2-proxy-api/go/net",
"github.com/linkerd/linkerd2-proxy-api/go/tap",
"github.com/linkerd/linkerd2-proxy-init/cmd",
"github.com/linkerd/linkerd2-proxy-init/iptables",
"github.com/mattn/go-isatty",
"github.com/mattn/go-runewidth",
"github.com/nsf/termbox-go",
4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -11,6 +11,10 @@ required = [
name = "github.com/linkerd/linkerd2-proxy-api"
version = "v0.1.7"

[[constraint]]
name = "github.com/linkerd/linkerd2-proxy-init"
version = "stable-2.3.0"
alpeb marked this conversation as resolved.
Show resolved Hide resolved

[[constraint]]
name = "google.golang.org/grpc"
version = "1.7.0"
1 change: 0 additions & 1 deletion bin/docker-build
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ bindir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$bindir/docker-build-proxy
$bindir/docker-build-controller
$bindir/docker-build-web
$bindir/docker-build-proxy-init
$bindir/docker-build-cni-plugin
$bindir/docker-build-debug
if [ -z "${LINKERD_LOCAL_BUILD_CLI:-}" ]; then
25 changes: 0 additions & 25 deletions bin/docker-build-proxy-init

This file was deleted.

2 changes: 1 addition & 1 deletion cli/Dockerfile-bin
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## compile binaries
FROM gcr.io/linkerd-io/go-deps:f364cab7 as golang
FROM gcr.io/linkerd-io/go-deps:2f1a6eb3 as golang
WORKDIR /go/src/github.com/linkerd/linkerd2
COPY cli cli
COPY chart chart
5 changes: 5 additions & 0 deletions cli/cmd/inject.go
Original file line number Diff line number Diff line change
@@ -366,6 +366,11 @@ func (options *proxyConfigOptions) overrideConfigs(configs *cfg.All, overrideAnn
overrideAnnotations[k8s.ProxyInitImageAnnotation] = configs.Proxy.ProxyInitImage.ImageName
}

if options.initImageVersion != "" {
configs.Proxy.ProxyInitImageVersion = options.initImageVersion
overrideAnnotations[k8s.ProxyInitImageVersionAnnotation] = configs.Proxy.ProxyInitImageVersion
}

if options.imagePullPolicy != "" {
configs.Proxy.ProxyImage.PullPolicy = options.imagePullPolicy
configs.Proxy.ProxyInitImage.PullPolicy = options.imagePullPolicy
2 changes: 2 additions & 0 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
@@ -178,6 +178,7 @@ type proxyConfigOptions struct {
proxyVersion string
proxyImage string
initImage string
initImageVersion string
dockerRegistry string
imagePullPolicy string
ignoreInboundPorts []uint
@@ -269,6 +270,7 @@ func (options *proxyConfigOptions) flagSet(e pflag.ErrorHandling) *pflag.FlagSet
flags.StringVarP(&options.proxyVersion, "proxy-version", "v", options.proxyVersion, "Tag to be used for the Linkerd proxy images")
flags.StringVar(&options.proxyImage, "proxy-image", options.proxyImage, "Linkerd proxy container image name")
flags.StringVar(&options.initImage, "init-image", options.initImage, "Linkerd init container image name")
flags.StringVar(&options.initImageVersion, "init-image-version", options.initImageVersion, "Linkerd init container image version")
alpeb marked this conversation as resolved.
Show resolved Hide resolved
flags.StringVar(&options.dockerRegistry, "registry", options.dockerRegistry, "Docker registry to pull images from")
flags.StringVar(&options.imagePullPolicy, "image-pull-policy", options.imagePullPolicy, "Docker image pull policy")
flags.UintVar(&options.proxyInboundPort, "inbound-port", options.proxyInboundPort, "Proxy port to use for inbound traffic")
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:install-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:install-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
@@ -264,7 +264,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:install-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:install-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
8 changes: 4 additions & 4 deletions cli/cmd/testdata/inject_emojivoto_already_injected.golden.yml
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
@@ -286,7 +286,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
@@ -442,7 +442,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
@@ -598,7 +598,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
2 changes: 1 addition & 1 deletion cli/cmd/testdata/inject_emojivoto_deployment.golden.yml
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ spec:
- 7777,8888,4190,9998
- --outbound-ports-to-ignore
- "9999"
image: gcr.io/linkerd-io/proxy-init:install-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
@@ -286,7 +286,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -136,7 +136,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:dev-undefined
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,1234
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
4 changes: 2 additions & 2 deletions cli/cmd/testdata/inject_emojivoto_list.golden.yml
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ items:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
@@ -282,7 +282,7 @@ items:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ items:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
@@ -282,7 +282,7 @@ items:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
2 changes: 1 addition & 1 deletion cli/cmd/testdata/inject_emojivoto_pod.golden.yml
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:install-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
2 changes: 1 addition & 1 deletion cli/cmd/testdata/inject_emojivoto_statefulset.golden.yml
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:test-inject-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
4 changes: 2 additions & 2 deletions cli/cmd/testdata/inject_gettest_deployment.good.golden.yml
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:install-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
@@ -290,7 +290,7 @@ spec:
- "2102"
- --inbound-ports-to-ignore
- 4190,4191
image: gcr.io/linkerd-io/proxy-init:install-control-plane-version
image: gcr.io/linkerd-io/proxy-init:stable-2.3.0
imagePullPolicy: IfNotPresent
name: linkerd-init
resources:
Loading
Oops, something went wrong.