Skip to content

Commit

Permalink
Merge pull request #202 from michalbiesek/feat-go-1.21
Browse files Browse the repository at this point in the history
ci: update Go 1.21 support
  • Loading branch information
rhatdan authored Aug 14, 2023
2 parents 37cba3e + cf0b5a9 commit b809725
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 40 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: golangci/golangci-lint-action@v3
with:
version: v1.51
version: v1.54

cross:
runs-on: ubuntu-20.04
Expand All @@ -51,18 +51,18 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: golangci/golangci-lint-action@v3
with:
version: v1.51
version: v1.54
- name: test-stubs
run: make test

test:
strategy:
fail-fast: false
matrix:
go-version: [1.19.x, 1.20.x]
go-version: [1.19.x, 1.20.x, 1.21.x]
race: ["-race", ""]
runs-on: ubuntu-20.04
steps:
Expand Down
5 changes: 1 addition & 4 deletions go-selinux/label/label_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ func Relabel(path string, fileLabel string, shared bool) error {
c["level"] = "s0"
fileLabel = c.Get()
}
if err := selinux.Chcon(path, fileLabel, true); err != nil {
return err
}
return nil
return selinux.Chcon(path, fileLabel, true)
}

// DisableSecOpt returns a security opt that can disable labeling
Expand Down
16 changes: 8 additions & 8 deletions go-selinux/label/label_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ package label
// InitLabels returns the process label and file labels to be used within
// the container. A list of options can be passed into this function to alter
// the labels.
func InitLabels(options []string) (string, string, error) {
func InitLabels([]string) (string, string, error) {
return "", "", nil
}

// Deprecated: The GenLabels function is only to be used during the transition
// to the official API. Use InitLabels(strings.Fields(options)) instead.
func GenLabels(options string) (string, string, error) {
func GenLabels(string) (string, string, error) {
return "", "", nil
}

func SetFileLabel(path string, fileLabel string) error {
func SetFileLabel(string, string) error {
return nil
}

func SetFileCreateLabel(fileLabel string) error {
func SetFileCreateLabel(string) error {
return nil
}

func Relabel(path string, fileLabel string, shared bool) error {
func Relabel(string, string, bool) error {
return nil
}

Expand All @@ -35,16 +35,16 @@ func DisableSecOpt() []string {
}

// Validate checks that the label does not include unexpected options
func Validate(label string) error {
func Validate(string) error {
return nil
}

// RelabelNeeded checks whether the user requested a relabel
func RelabelNeeded(label string) bool {
func RelabelNeeded(string) bool {
return false
}

// IsShared checks that the label includes a "shared" mark
func IsShared(label string) bool {
func IsShared(string) bool {
return false
}
46 changes: 23 additions & 23 deletions go-selinux/selinux_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ func attrPath(string) string {
return ""
}

func readCon(fpath string) (string, error) {
func readCon(string) (string, error) {
return "", nil
}

Expand All @@ -21,27 +21,27 @@ func getEnabled() bool {
return false
}

func classIndex(class string) (int, error) {
func classIndex(string) (int, error) {
return -1, nil
}

func setFileLabel(fpath string, label string) error {
func setFileLabel(string, string) error {
return nil
}

func lSetFileLabel(fpath string, label string) error {
func lSetFileLabel(string, string) error {
return nil
}

func fileLabel(fpath string) (string, error) {
func fileLabel(string) (string, error) {
return "", nil
}

func lFileLabel(fpath string) (string, error) {
func lFileLabel(string) (string, error) {
return "", nil
}

func setFSCreateLabel(label string) error {
func setFSCreateLabel(string) error {
return nil
}

Expand All @@ -53,46 +53,46 @@ func currentLabel() (string, error) {
return "", nil
}

func pidLabel(pid int) (string, error) {
func pidLabel(int) (string, error) {
return "", nil
}

func execLabel() (string, error) {
return "", nil
}

func canonicalizeContext(val string) (string, error) {
func canonicalizeContext(string) (string, error) {
return "", nil
}

func computeCreateContext(source string, target string, class string) (string, error) {
func computeCreateContext(string, string, string) (string, error) {
return "", nil
}

func calculateGlbLub(sourceRange, targetRange string) (string, error) {
func calculateGlbLub(string, string) (string, error) {
return "", nil
}

func peerLabel(fd uintptr) (string, error) {
func peerLabel(uintptr) (string, error) {
return "", nil
}

func setKeyLabel(label string) error {
func setKeyLabel(string) error {
return nil
}

func (c Context) get() string {
return ""
}

func newContext(label string) (Context, error) {
func newContext(string) (Context, error) {
return Context{}, nil
}

func clearLabels() {
}

func reserveLabel(label string) {
func reserveLabel(string) {
}

func isMLSEnabled() bool {
Expand All @@ -103,15 +103,15 @@ func enforceMode() int {
return Disabled
}

func setEnforceMode(mode int) error {
func setEnforceMode(int) error {
return nil
}

func defaultEnforceMode() int {
return Disabled
}

func releaseLabel(label string) {
func releaseLabel(string) {
}

func roFileLabel() string {
Expand All @@ -126,27 +126,27 @@ func initContainerLabels() (string, string) {
return "", ""
}

func containerLabels() (processLabel string, fileLabel string) {
func containerLabels() (string, string) {
return "", ""
}

func securityCheckContext(val string) error {
func securityCheckContext(string) error {
return nil
}

func copyLevel(src, dest string) (string, error) {
func copyLevel(string, string) (string, error) {
return "", nil
}

func chcon(fpath string, label string, recurse bool) error {
func chcon(string, string, bool) error {
return nil
}

func dupSecOpt(src string) ([]string, error) {
func dupSecOpt(string) ([]string, error) {
return nil, nil
}

func getDefaultContextWithLevel(user, level, scon string) (string, error) {
func getDefaultContextWithLevel(string, string, string) (string, error) {
return "", nil
}

Expand Down

0 comments on commit b809725

Please sign in to comment.