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

fix: release pipeline #104

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Conversation

FrankYang0529
Copy link
Member

@FrankYang0529 FrankYang0529 commented Sep 18, 2024

  • change actions/checkout to v4
  • change actions/setup-go to v5
  • change go-version to v1.22
  • change goreleaser/goreleaser-action to v6
  • add "version: 2" to .goreleaser.yml
  • remove darwin from .goreleaser.yml, because we import
    longhorn/go-common-libs which uses unix.CLONE_NEWNET

* change actions/checkout to v4
* change actions/setup-go to v5
* change go-version to v1.22
* change goreleaser/goreleaser-action to v6
* add "version: 2" to .goreleaser.yml
* remove darwin from .goreleaser.yml, because we import
longhorn/go-common-libs which uses unix.CLONE_NEWNET

Signed-off-by: PoAn Yang <[email protected]>
Copy link
Contributor

@Yu-Jack Yu-Jack left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@FrankYang0529 FrankYang0529 merged commit 0e169a9 into harvester:master Sep 18, 2024
3 checks passed
@FrankYang0529 FrankYang0529 deleted the fix-release branch September 18, 2024 06:23
@rvdh
Copy link

rvdh commented Sep 18, 2024

@FrankYang0529 @Yu-Jack I think this change cause the provider to be not available for me on macos:

│ Provider registry.terraform.io/harvester/harvester v0.6.5 does not have a package available for your current platform, darwin_amd64.

:(

@bk201
Copy link
Member

bk201 commented Sep 18, 2024

@FrankYang0529 Can we see if we can enable darwin platform again?

@FrankYang0529
Copy link
Member Author

Yeah, @Yu-Jack and I are checking on it.

@Yu-Jack
Copy link
Contributor

Yu-Jack commented Sep 18, 2024

@FrankYang0529 I think we need to modify longhorn/go-common-libs by creating different system go files. Here are two examples you could try that.

Example

This example works with different builds.

  • GOOS=linux go build .
  • GOOS=darwin go build .
// main.go
package main

import "fmt"

func main() {
	a := Namespace("test")
	fmt.Println(a.Flag())
}
// namespace_linux.go
// go:build linux

package main

import (
	"fmt"

	"golang.org/x/sys/unix"
)

type Namespace string

const (
	NamespaceNet = Namespace("net")
)

func (ns Namespace) Flag() uintptr {
	fmt.Println("linux")
	switch ns {
	case NamespaceNet:
		return unix.CLONE_NEWNET
	default:
		return 0
	}
}
// namespace_darwin.go
// go:build darwin

package main

import (
	"fmt"
)

type Namespace string

const (
	NamespaceNet = Namespace("net")
)

func (ns Namespace) Flag() uintptr {
	fmt.Println("darwin")
	return 0
}

Example 2

This is a wrong example. It complains the error which is undefined: unix.CLONE_NEWNET same as we have.

// namespace_darwin.go
// go:build darwin

package main

import (
	"fmt"

	"golang.org/x/sys/unix"
)

type Namespace string

const (
	NamespaceNet = Namespace("net")
)

func (ns Namespace) Flag() uintptr {
	fmt.Print(unix.CLONE_NEWNET)
	fmt.Println("darwin")
	return 0
}

So, we need to add namespace_linux.go and namespace_darwin.go for longhorn/go-common-libs.

@moio
Copy link

moio commented Sep 26, 2024

@FrankYang0529 @Yu-Jack I think this change cause the provider to be not available for me on macos:

│ Provider registry.terraform.io/harvester/harvester v0.6.5 does not have a package available for your current platform, darwin_amd64.

:(

harvester/harvester#6655 tracks that

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

Successfully merging this pull request may close these issues.

5 participants