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

libvirt: update scripts for libvirt #1671

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

liudalibj
Copy link
Member

  • check golang version, the installed golang version must >= the value from versions.yaml
  • update two default values in install_operator.sh

@liudalibj liudalibj added the test_e2e_libvirt Run Libvirt e2e tests label Jan 22, 2024
- check golang version, the installed golang version must >= the value from versions.yaml
- update two default values in install_operator.sh

Signed-off-by: Da Li Liu <liudali@cn.ibm.com>
Copy link
Member

@stevenhorsman stevenhorsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I've tested this with a number of different scenarios:

  • We already have the same version of go installed as the versions.yaml:
# go version
go version go1.20.12 linux/amd64
root@dali-config-libvirt-go-test1:~/cloud-api-adaptor# ./libvirt/config_libvirt.sh
Installing Go...
Found 1.20.12 at /usr/local/go, good to go
  • We have a newer patch release:
# go version
go version go1.20.13 linux/amd64
root@dali-config-libvirt-go-test1:~/cloud-api-adaptor# ./libvirt/config_libvirt.sh
Installing Go...
Found 1.20.13 at /usr/local/go, good to go
  • We have a newer minor version:
go version go1.21.6 linux/amd64
# ./libvirt/config_libvirt.sh
Installing Go...
Found 1.21.6 at /usr/local/go, good to go
  • We have an older minor version:
go version go1.18.10 linux/amd64
# ./libvirt/config_libvirt.sh
Installing Go...
Warning: Found 1.18.10 at /usr/local/go, is lower than our required 1.20.12
Please run "rm -rf /usr/local/go" and run this script again.
root@dali-config-libvirt-go-test1:~/cloud-api-adaptor# rm -rf /usr/local/go
root@dali-config-libvirt-go-test1:~/cloud-api-adaptor# ./libvirt/config_libvirt.sh
Installing Go...
Installed golang with 1.20.12
root@dali-config-libvirt-go-test1:~/cloud-api-adaptor# go version
go version go1.20.12 linux/amd64
  • We have an older patch version:
# go version
go version go1.20.10 linux/amd64
root@dali-config-libvirt-go-test1:~/cloud-api-adaptor# ./libvirt/config_libvirt.sh
Installing Go...
Warning: Found 1.20.10 at /usr/local/go, is lower than our required 1.20.12
Please run "rm -rf /usr/local/go" and run this script again.
root@dali-config-libvirt-go-test1:~/cloud-api-adaptor# rm -rf /usr/local/go
root@dali-config-libvirt-go-test1:~/cloud-api-adaptor# ./libvirt/config_libvirt.sh
Installing Go...
Installed golang with 1.20.12

and all worked as expected! Thanks @liudalibj!

@huoqifeng
Copy link
Contributor

Did a rough testing, it looks good:

root@c37646v1:~# export installed_go_version=1.18.10
root@c37646v1:~# ret=$(printf '%s\n' "$REQUIRED_GO_VERSION" "$installed_go_version" | sort -V | head -1)
root@c37646v1:~# echo $ret

root@c37646v1:~# export REQUIRED_GO_VERSION=1.20.12
root@c37646v1:~# 
root@c37646v1:~# 
root@c37646v1:~# ret=$(printf '%s\n' "$REQUIRED_GO_VERSION" "$installed_go_version" | sort -V | head -1)
root@c37646v1:~# echo $ret
1.18.10
root@c37646v1:~# export installed_go_version=1.20.12
root@c37646v1:~# ret=$(printf '%s\n' "$REQUIRED_GO_VERSION" "$installed_go_version" | sort -V | head -1)
root@c37646v1:~# echo $ret
1.20.12
root@c37646v1:~# export installed_go_version=1.20.13
root@c37646v1:~# ret=$(printf '%s\n' "$REQUIRED_GO_VERSION" "$installed_go_version" | sort -V | head -1)
root@c37646v1:~# echo $ret
1.20.12
root@c37646v1:~# export installed_go_version=1.21.10
root@c37646v1:~# ret=$(printf '%s\n' "$REQUIRED_GO_VERSION" "$installed_go_version" | sort -V | head -1)
root@c37646v1:~# echo $ret
1.20.12

Copy link
Contributor

@huoqifeng huoqifeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@huoqifeng huoqifeng merged commit 81364b7 into confidential-containers:main Jan 23, 2024
27 checks passed
@huoqifeng
Copy link
Contributor

Another thing I remembered but might be wrong, @lysliu tried to build caa against golang 1.21.x but failed. @liudalibj

@liudalibj liudalibj deleted the libvirt-enhance branch January 23, 2024 01:42
@liudalibj
Copy link
Member Author

liudalibj commented Jan 23, 2024

Another thing I remembered but might be wrong, @lysliu tried to build caa against golang 1.21.x but failed. @liudalibj

It's different issue, I didn't change the go version in go.mod for caa.
Here the config_libvirt.sh is used to config libvirt dev/test env, I tried in my dev machine,

  • I install golang 1.21.2
  • run make test-e2e for libvirt
    The e2e test are passed with good result with the installed golang 1.21.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test_e2e_libvirt Run Libvirt e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants