I tried following the instructions from the official documentation page of "Operator SDK". The device I'm trying to install it on is running on Windows 10, AMD64. I installed GNU Make via Chocolatey.
make --version
GNU Make 4.4.1
Built for Windows32
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
As per the "Command and install from master" section of the official documentation:
git clone https://github.com/operator-framework/operator-sdk
cd operator-sdk
git checkout master
make install
The last line "make install" fails:
make install
go install -gcflags "all=-trimpath=C:/Users/erjan/Downloads/operator_k8s_sdk" -asmflags "all=-trimpath=C:/Users/erjan/Downloads/operator_k8s_sdk" -ldflags " -X 'github.com/operator-framework/operator-sdk/internal/version.Version=v1.31.0+git' -X 'github.com/operator-framework/operator-sdk/internal/version.GitVersion=v1.31.0-3-gd21ed649' -X 'github.com/operator-framework/operator-sdk/internal/version.GitCommit=d21ed6499ebfc8ecdb4508e1c2a2a0cfd2a151f3' -X 'github.com/operator-framework/operator-sdk/internal/version.KubernetesVersion=v1.26.0' -X 'github.com/operator-framework/operator-sdk/internal/version.ImageVersion=v1.31.0' " ./cmd/# github.com/containerd/containerd/archive
..\..\..\go\pkg\mod\github.com\containerd\[email protected]\archive\tar_windows.go:234:19: cannot use syscall.NsecToFiletime(hdr.AccessTime.UnixNano()) (value of type syscall.Filetime) as "golang.org/x/sys/windows".Filetime value in struct literal
..\..\..\go\pkg\mod\github.com\containerd\[email protected]\archive\tar_windows.go:235:19: cannot use syscall.NsecToFiletime(hdr.ModTime.UnixNano()) (value of type syscall.Filetime) as "golang.org/x/sys/windows".Filetime value in struct literal
..\..\..\go\pkg\mod\github.com\containerd\[email protected]\archive\tar_windows.go:236:19: cannot use syscall.NsecToFiletime(hdr.ChangeTime.UnixNano()) (value of type syscall.Filetime) as "golang.org/x/sys/windows".Filetime value in struct literal
..\..\..\go\pkg\mod\github.com\containerd\[email protected]\archive\tar_windows.go:239:17: cannot use syscall.NsecToFiletime(hdr.ModTime.UnixNano()) (value of type syscall.Filetime) as "golang.org/x/sys/windows".Filetime value in struct literal
..\..\..\go\pkg\mod\github.com\containerd\[email protected]\archive\tar_windows.go:257:27: cannot use syscall.NsecToFiletime(createTime.UnixNano()) (value of type syscall.Filetime) as "golang.org/x/sys/windows".Filetime value in assignment
make: *** [Makefile:75: install] Error 1
What could be the reason for this error?
I see there are several lines where Go is complaining about a type mismatch. Specifically, it is mentioning that
syscall.Filetimecannot be used as"golang.org/x/sys/windows".Filetime.A value of type
syscall.Filetimeis being used where a value of type"golang.org/x/sys/windows".Filetimeis expected. This is a type mismatch issue. The filetar_windows.gowithin thegithub.com/containerd/containerdpackage seems to be the source of these errors, and it appears to be related to how file timestamps are being handled on Windows.containerd/containerdv1.4.11 seems quite old, considering the operator-framework/operator-sdk project itself needscontainerdv1.7.0Since I got the same error through
make install, I tried firstgo build -a -v ..., which does not trigger errors. The Makefile fails ongo install ./cmd/{operator-sdk,helm-operator}go install ./cmd/helm-operatorworks.go install ./cmd/operator-sdkhas the errorThat bug is confirmed with your issue
operator-framework/operator-sdkissue 6585