diff --git a/go.mod b/go.mod index c936466..024fcb7 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/SovereignCloudStack/csctl-plugin-openstack go 1.21 require ( - github.com/SovereignCloudStack/csctl v0.0.3 + github.com/SovereignCloudStack/csctl v0.0.4 github.com/goccy/go-yaml v1.12.0 - github.com/gophercloud/gophercloud v1.14.0 + github.com/gophercloud/gophercloud v1.14.1 github.com/minio/minio-go/v7 v7.0.76 github.com/spf13/cobra v1.8.1 ) diff --git a/go.sum b/go.sum index 435a47e..9acf95e 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/SovereignCloudStack/cluster-stack-operator v0.1.0-alpha.5 h1:jONI0j2BVpL6ubQt9nT8LxWwtHQ1kyrvt1X/1+Hrea8= github.com/SovereignCloudStack/cluster-stack-operator v0.1.0-alpha.5/go.mod h1:zrwUudq/JQae24/yzS5exA1ZwaXxIL2ZtKIQVrYuPqY= -github.com/SovereignCloudStack/csctl v0.0.3 h1:OVR5pkoa2JBJWenvQM3KeboGIPPnFATgEPUrABfbmcU= -github.com/SovereignCloudStack/csctl v0.0.3/go.mod h1:RzJ62+gjKyWjAMvHD+xoou5ZDZ3KDHTHxzmAlmOBr7Y= +github.com/SovereignCloudStack/csctl v0.0.4 h1:G8Y5xj/su7ghQ4WPD2gzyQv3cYuUZTKAduY/0C2z6jM= +github.com/SovereignCloudStack/csctl v0.0.4/go.mod h1:WE4TuFZcPLgR/sAsqOhptCr60Uj88mig2xk9tKGe1W4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -26,8 +26,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gophercloud/gophercloud v1.14.0 h1:Bt9zQDhPrbd4qX7EILGmy+i7GP35cc+AAL2+wIJpUE8= -github.com/gophercloud/gophercloud v1.14.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gophercloud/gophercloud v1.14.1 h1:DTCNaTVGl8/cFu58O1JwWgis9gtISAFONqpMKNg/Vpw= +github.com/gophercloud/gophercloud v1.14.1/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= diff --git a/vendor/github.com/SovereignCloudStack/csctl/pkg/clusterstack/config.go b/vendor/github.com/SovereignCloudStack/csctl/pkg/clusterstack/config.go index 56cb078..4d991bb 100644 --- a/vendor/github.com/SovereignCloudStack/csctl/pkg/clusterstack/config.go +++ b/vendor/github.com/SovereignCloudStack/csctl/pkg/clusterstack/config.go @@ -131,3 +131,15 @@ func GetClusterStackReleaseDirectoryName(metadata *MetaData, config *CsctlConfig return clusterStackReleaseDirName, nil } + +// GetClusterStackReleaseName return the cluster stack release name. +// e.g. - docker-ferrol-1-27-v0-sha.uxumi7s . +func GetClusterStackReleaseName(metada *MetaData, config *CsctlConfig) (string, error) { + kubernetesVerion, err := config.ParseKubernetesVersion() + if err != nil { + return "", fmt.Errorf("failed to parse kubernetes version: %w", err) + } + + clusterStackReleaseName := fmt.Sprintf("%s-%s-%s-%s", config.Config.Provider.Type, config.Config.ClusterStackName, kubernetesVerion.String(), metada.Versions.ClusterStack) + return clusterStackReleaseName, nil +} diff --git a/vendor/github.com/SovereignCloudStack/csctl/pkg/hash/hash.go b/vendor/github.com/SovereignCloudStack/csctl/pkg/hash/hash.go index a5ba160..1b43269 100644 --- a/vendor/github.com/SovereignCloudStack/csctl/pkg/hash/hash.go +++ b/vendor/github.com/SovereignCloudStack/csctl/pkg/hash/hash.go @@ -20,6 +20,7 @@ package hash import ( "crypto/sha256" "encoding/base64" + "encoding/json" "fmt" "io" "os" @@ -43,6 +44,21 @@ type ReleaseHash struct { NodeImageDir string `json:"nodeImageDir,omitempty"` } +// ParseReleaseHash parses the cluster-stack release hash. +func ParseReleaseHash(path string) (ReleaseHash, error) { + latestGitHubReleaseHashData, err := os.ReadFile(filepath.Clean(path)) + if err != nil { + return ReleaseHash{}, fmt.Errorf("failed to read hash: %q: %w", path, err) + } + + var releaseHash ReleaseHash + if err := json.Unmarshal(latestGitHubReleaseHashData, &releaseHash); err != nil { + return ReleaseHash{}, fmt.Errorf("failed to unmarshal json: %q: %w", path, err) + } + + return releaseHash, nil +} + // GetHash returns the release hash. func GetHash(path string) (ReleaseHash, error) { entries, err := os.ReadDir(path) diff --git a/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md b/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md index dc38bf5..b19b5e7 100644 --- a/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md +++ b/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.14.1 (2024-09-18) + +* [GH-3162](https://github.com/gophercloud/gophercloud/pull/3162) Fix security group rule "any protocol" + ## v1.14.0 (2024-07-24) * [GH-3095](https://github.com/gophercloud/gophercloud/pull/3095) [neutron]: introduce Description argument for the portforwarding diff --git a/vendor/github.com/gophercloud/gophercloud/provider_client.go b/vendor/github.com/gophercloud/gophercloud/provider_client.go index 6e57f48..7e25882 100644 --- a/vendor/github.com/gophercloud/gophercloud/provider_client.go +++ b/vendor/github.com/gophercloud/gophercloud/provider_client.go @@ -14,7 +14,7 @@ import ( // DefaultUserAgent is the default User-Agent string set in the request header. const ( - DefaultUserAgent = "gophercloud/v1.14.0" + DefaultUserAgent = "gophercloud/v1.14.1" DefaultMaxBackoffRetries = 60 ) diff --git a/vendor/modules.txt b/vendor/modules.txt index 65efc59..7a342b9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2,7 +2,7 @@ ## explicit; go 1.21 github.com/SovereignCloudStack/cluster-stack-operator/pkg/kubernetesversion github.com/SovereignCloudStack/cluster-stack-operator/pkg/version -# github.com/SovereignCloudStack/csctl v0.0.3 +# github.com/SovereignCloudStack/csctl v0.0.4 ## explicit; go 1.21 github.com/SovereignCloudStack/csctl/pkg/clusterstack github.com/SovereignCloudStack/csctl/pkg/hash @@ -39,7 +39,7 @@ github.com/goccy/go-yaml/token # github.com/google/uuid v1.6.0 ## explicit github.com/google/uuid -# github.com/gophercloud/gophercloud v1.14.0 +# github.com/gophercloud/gophercloud v1.14.1 ## explicit; go 1.14 github.com/gophercloud/gophercloud github.com/gophercloud/gophercloud/openstack/imageservice/v2/images