Only check content of files if both files have zero nanosecond times.
A zero nanosecond time is considered ambiguous as to whether or
not the timestamp has been truncated by tar. Previously the diff
algorithm was attempting to account for comparisons from a source
to a directory with an applied tar. This condition is no longer
relevant since there is no support for recreating tars directories
which have had a tar extracted. In the case where the older directory
has a truncated timestamp and the newer one does not, this may always
be considered a change. In the case where both are zero, treat the
timestamp as ambiguous and compare content.
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This test case should cover the variant field now, as we have
add Variant to default value of spec.platform.
Change-Id: I8359007d40a4b8f6a072510fff2ba604a062afa1
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
Signed-off-by: Penny Zheng <Penny.Zheng@arm.com>
The variant is required for platform match while pulling images
for ARM platforms. Currently, the cpuVariant only would be assigned
on linux/arm|arm64 platforms. Other platforms this variable would
be empty. So we can use this cpuVariant to initialize the Variant
field.
Change-Id: Ic065be9b502f1e662445daa61a0973bf56385b37
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
Signed-off-by: Penny Zheng <Penny.Zheng@arm.com>
In the commit "26329b2b8d7fd4e290b2b0f0163547f2d79bb817",
dmcgowan/fix-pull-multi-arch, PR#1535. The containerd has enabled the pull
multi-arch image support. But the platform.variant field of OCI for ARM
hadn't been ready at that time, so all ARM images could not pull successfully.
"
docker.io/library/hello-world:latest:
resolved |++++++++++++++++++++++++++++++++++++++|
index-sha256:3644c0788e3d3823f9e97f757f01d2ddc6eb5458df9d801:
done |++++++++++++++++++++++++++++++++++++++|
elapsed: 5.1 s
total: 2.7 Ki (533.0 B/s)
unpacking sha256:3d3823f9e97f757f01d2ddc6eb5458df9d801...
ctr: : manifest not found: not found
"
In this patch we'll detect the ARM variants from /proc/cpuinfo. Because Linux
kernel has already detected the ABI, ISA and Features for us. We don't need to
parse them from registers again.
Change-Id: I479b34bf3f52df9f7a6b3c77718b7d316dbf7f69
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
Signed-off-by: Penny Zheng <Penny.Zheng@arm.com>
On ARM platforms, we have to prepare the variant for spec.platform.
Currently, this action would only work on Linux/ARM system. We
introduce these two helpers to check running system's OS and Arch.
Change-Id: Iff14087699219413779dd6caf1bf9524db1cc19e
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
When compiling containerd binaries statically, linker rightfully
complains:
```
+ make BUILDTAGS=static_build 'EXTRA_FLAGS=-buildmode pie'
'EXTRA_LDFLAGS=-extldflags "-fno-PIC -static"'
🇩 bin/ctr
/tmp/go-link-343047789/000000.o: In function
`_cgo_b0c710f30cfd_C2func_getaddrinfo':
/tmp/go-build/net/_obj/cgo-gcc-prolog:46: warning: Using 'getaddrinfo'
in statically linked applications requires at runtime the shared
libraries from the glibc version used for linking
```
The same error appears for ctr, containerd, and containerd-stress
binaries.
The fix is to use Go's own DNS resolver functions, rather than
glibc's getaddrinfo() -- this option is turned on by `netgo` build
tag.
See https://golang.org/pkg/net/ (look for "Name Resolution") for
more details.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>