Skip to content

Commit

Permalink
Fix linting, change workflows
Browse files Browse the repository at this point in the history
Adustment for new worflow
  • Loading branch information
dodokek committed Oct 19, 2024
1 parent 2d35b8f commit 469d24f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 9 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Push Docker Image of operator

on: [push]
# workflow_run:
# workflows: ["Tests"]
# types:
# - completed
# push:
# tags:
# - 'v*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Create Docker config with auth
run: |
mkdir -p ~/.docker
echo '${{ secrets.DOCKER_AUTH_CONFIG }}' > ~/.docker/config.json
- name: Push docker
run: |
docker build -t docker-picodata.binary.picodata.io/tarantool-operator::${{ github.ref_name }} .
docker --config ~/.docker/ push docker-picodata.binary.picodata.io/tarantool-operator::${{ github.ref_name }}
- name: Delete docker auth config
run: rm -rf ~/.docker/config.json # Clean up Docker auth credentials
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
kubernetes-version: [v1.16.4, v1.19.4, v1.22.4, v1.23.4]
kubernetes-version: [v1.23.4, v1.31.1]

steps:
- uses: actions/checkout@v3
Expand All @@ -34,7 +34,7 @@ jobs:
id: go

- name: Set up Kind Cluster
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.10.0
with:
node_image: kindest/node:${{ matrix.kubernetes-version }}
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
Expand All @@ -56,16 +56,18 @@ jobs:
strategy:
fail-fast: false
matrix:
kubernetes-version: [v1.16.4, v1.19.4, v1.22.4, v1.23.4]
kubernetes-version: [v1.23.4, v1.31.1]

steps:
- uses: actions/checkout@v1

- name: Set up helm
uses: azure/setup-helm@v1
with:
version: v3.15.4

- name: Set up Kind Cluster
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.10.0
with:
node_image: kindest/node:${{ matrix.kubernetes-version }}
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
Expand Down
4 changes: 2 additions & 2 deletions controllers/topology/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (s *BuiltInTopologyService) Expel(pod *corev1.Pod) error {
return err
}

if !resp.Data.ExpelInstance && (resp.Errors == nil || len(resp.Errors) == 0) {
if !resp.Data.ExpelInstance && (len(resp.Errors) == 0) {
return errors.New("something really bad happened")
}

Expand Down Expand Up @@ -500,7 +500,7 @@ func (s *BuiltInTopologyService) BootstrapVshard() error {
if resp.Data.BootstrapVshard {
return nil
}
if resp.Errors != nil && len(resp.Errors) > 0 {
if len(resp.Errors) > 0 {
if strings.Contains(resp.Errors[0].Message, "already bootstrapped") {
return errAlreadyBootstrapped
}
Expand Down
5 changes: 2 additions & 3 deletions controllers/topology/builtin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package topology
import (
"encoding/json"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
Expand Down Expand Up @@ -174,7 +173,7 @@ var setFailoverGQL = `mutation setFailoverMode($mode: String) {

func TestSetFailover(t *testing.T) {
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
b, err := io.ReadAll(r.Body)
if err != nil {
t.Fatalf("%s", err)
}
Expand Down Expand Up @@ -226,7 +225,7 @@ var getFailoverGQL = `query {
func TestGetFailover(t *testing.T) {
var failoverMode string
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
b, err := io.ReadAll(r.Body)
if err != nil {
t.Fatalf("%s", err)
}
Expand Down

0 comments on commit 469d24f

Please sign in to comment.