Add generated file
This PR adds generated files under pkg/client and vendor folder.
This commit is contained in:
3
vendor/k8s.io/kubernetes/build/pause/.gitignore
generated
vendored
Normal file
3
vendor/k8s.io/kubernetes/build/pause/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/.container-*
|
||||
/.push-*
|
||||
/bin
|
8
vendor/k8s.io/kubernetes/build/pause/CHANGELOG.md
generated
vendored
Normal file
8
vendor/k8s.io/kubernetes/build/pause/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# 3.1
|
||||
|
||||
* The pause container gains a signal handler to clean up orphaned zombie processes. ([#36853](https://prs.k8s.io/36853), [@verb](https://github.com/verb))
|
||||
* `pause -v` will return build information for the pause binary. ([#56762](https://prs.k8s.io/56762), [@verb](https://github.com/verb))
|
||||
|
||||
# 3.0
|
||||
|
||||
* The pause container was rewritten entirely in C. ([#23009](https://prs.k8s.io/23009), [@uluyol](https://github.com/uluyol))
|
18
vendor/k8s.io/kubernetes/build/pause/Dockerfile
generated
vendored
Normal file
18
vendor/k8s.io/kubernetes/build/pause/Dockerfile
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2016 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM scratch
|
||||
ARG ARCH
|
||||
ADD bin/pause-${ARCH} /pause
|
||||
ENTRYPOINT ["/pause"]
|
109
vendor/k8s.io/kubernetes/build/pause/Makefile
generated
vendored
Normal file
109
vendor/k8s.io/kubernetes/build/pause/Makefile
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
# Copyright 2016 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
.PHONY: all push container clean orphan all-push push-manifest
|
||||
|
||||
include ../../hack/make-rules/Makefile.manifest
|
||||
|
||||
REGISTRY ?= staging-k8s.gcr.io
|
||||
IMAGE = $(REGISTRY)/pause
|
||||
IMAGE_WITH_ARCH = $(IMAGE)-$(ARCH)
|
||||
|
||||
TAG = 3.1
|
||||
REV = $(shell git describe --contains --always --match='v*')
|
||||
|
||||
# Architectures supported: amd64, arm, arm64, ppc64le and s390x
|
||||
ARCH ?= amd64
|
||||
|
||||
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
||||
|
||||
CFLAGS = -Os -Wall -Werror -static -DVERSION=v$(TAG)-$(REV)
|
||||
KUBE_CROSS_IMAGE ?= k8s.gcr.io/kube-cross
|
||||
KUBE_CROSS_VERSION ?= $(shell cat ../build-image/cross/VERSION)
|
||||
|
||||
BIN = pause
|
||||
SRCS = pause.c
|
||||
|
||||
ifeq ($(ARCH),amd64)
|
||||
TRIPLE ?= x86_64-linux-gnu
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),arm)
|
||||
TRIPLE ?= arm-linux-gnueabihf
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),arm64)
|
||||
TRIPLE ?= aarch64-linux-gnu
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),ppc64le)
|
||||
TRIPLE ?= powerpc64le-linux-gnu
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),s390x)
|
||||
TRIPLE ?= s390x-linux-gnu
|
||||
endif
|
||||
|
||||
# If you want to build AND push all containers, see the 'all-push' rule.
|
||||
all: all-container
|
||||
|
||||
all-push: all-push-images push-manifest
|
||||
|
||||
push-manifest: manifest-tool
|
||||
manifest-tool push from-args --platforms $(call join_platforms,$(ALL_ARCH)) --template $(IMAGE)-ARCH:$(TAG) --target $(IMAGE):$(TAG)
|
||||
|
||||
sub-container-%:
|
||||
$(MAKE) ARCH=$* container
|
||||
|
||||
sub-push-%:
|
||||
$(MAKE) ARCH=$* push
|
||||
|
||||
all-container: $(addprefix sub-container-,$(ALL_ARCH))
|
||||
|
||||
all-push-images: $(addprefix sub-push-,$(ALL_ARCH))
|
||||
|
||||
build: bin/$(BIN)-$(ARCH)
|
||||
|
||||
bin/$(BIN)-$(ARCH): $(SRCS)
|
||||
mkdir -p bin
|
||||
docker run --rm -u $$(id -u):$$(id -g) -v $$(pwd):/build \
|
||||
$(KUBE_CROSS_IMAGE):$(KUBE_CROSS_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /build && \
|
||||
$(TRIPLE)-gcc $(CFLAGS) -o $@ $^ && \
|
||||
$(TRIPLE)-strip $@"
|
||||
|
||||
container: .container-$(ARCH)
|
||||
.container-$(ARCH): bin/$(BIN)-$(ARCH)
|
||||
docker build --pull -t $(IMAGE_WITH_ARCH):$(TAG) --build-arg ARCH=$(ARCH) .
|
||||
touch $@
|
||||
|
||||
push: .push-$(ARCH)
|
||||
.push-$(ARCH): .container-$(ARCH)
|
||||
docker push $(IMAGE_WITH_ARCH):$(TAG)
|
||||
touch $@
|
||||
|
||||
# Useful for testing, not automatically included in container image
|
||||
orphan: bin/orphan-$(ARCH)
|
||||
bin/orphan-$(ARCH): orphan.c
|
||||
mkdir -p bin
|
||||
docker run -u $$(id -u):$$(id -g) -v $$(pwd):/build \
|
||||
$(KUBE_CROSS_IMAGE):$(KUBE_CROSS_VERSION) \
|
||||
/bin/bash -c "\
|
||||
cd /build && \
|
||||
$(TRIPLE)-gcc $(CFLAGS) -o $@ $^ && \
|
||||
$(TRIPLE)-strip $@"
|
||||
|
||||
clean:
|
||||
rm -rf .container-* .push-* bin/
|
36
vendor/k8s.io/kubernetes/build/pause/orphan.c
generated
vendored
Normal file
36
vendor/k8s.io/kubernetes/build/pause/orphan.c
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/* Creates a zombie to be reaped by init. Useful for testing. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main() {
|
||||
pid_t pid;
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
while (getppid() > 1)
|
||||
;
|
||||
printf("Child exiting: pid=%d ppid=%d\n", getpid(), getppid());
|
||||
return 0;
|
||||
} else if (pid > 0) {
|
||||
printf("Parent exiting: pid=%d ppid=%d\n", getpid(), getppid());
|
||||
return 0;
|
||||
}
|
||||
perror("Could not create child");
|
||||
return 1;
|
||||
}
|
68
vendor/k8s.io/kubernetes/build/pause/pause.c
generated
vendored
Normal file
68
vendor/k8s.io/kubernetes/build/pause/pause.c
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define STRINGIFY(x) #x
|
||||
#define VERSION_STRING(x) STRINGIFY(x)
|
||||
|
||||
#ifndef VERSION
|
||||
#define VERSION HEAD
|
||||
#endif
|
||||
|
||||
static void sigdown(int signo) {
|
||||
psignal(signo, "Shutting down, got signal");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static void sigreap(int signo) {
|
||||
while (waitpid(-1, NULL, WNOHANG) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int i;
|
||||
for (i = 1; i < argc; ++i) {
|
||||
if (!strcasecmp(argv[i], "-v")) {
|
||||
printf("pause.c %s\n", VERSION_STRING(VERSION));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (getpid() != 1)
|
||||
/* Not an error because pause sees use outside of infra containers. */
|
||||
fprintf(stderr, "Warning: pause should be the first process\n");
|
||||
|
||||
if (sigaction(SIGINT, &(struct sigaction){.sa_handler = sigdown}, NULL) < 0)
|
||||
return 1;
|
||||
if (sigaction(SIGTERM, &(struct sigaction){.sa_handler = sigdown}, NULL) < 0)
|
||||
return 2;
|
||||
if (sigaction(SIGCHLD, &(struct sigaction){.sa_handler = sigreap,
|
||||
.sa_flags = SA_NOCLDSTOP},
|
||||
NULL) < 0)
|
||||
return 3;
|
||||
|
||||
for (;;)
|
||||
pause();
|
||||
fprintf(stderr, "Error: infinite loop terminated\n");
|
||||
return 42;
|
||||
}
|
Reference in New Issue
Block a user