Skip to content

Commit

Permalink
Update flytestdlib to 0.3.22 to support byte slices (flyteorg#194)
Browse files Browse the repository at this point in the history
* Update flytestdlib to 0.3.22 to support byte slices

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Update kind version for integration tests

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Attempt to clean up

Signed-off-by: Haytham Abuelfutuh <[email protected]>
  • Loading branch information
EngHabu authored May 20, 2021
1 parent c5e4c86 commit ffdf6fe
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 3 deletions.
7 changes: 7 additions & 0 deletions flyteadmin/.github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ jobs:
- name: Prime docker cache
run: docker load -i /tmp/tmp/docker-images/snapshot-builder.tar || true
- uses: engineerd/[email protected]
with:
version: "v0.10.0"
- name: Integration
run: |
# attempt to clean up some unneeded data: https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
kubectl cluster-info
kubectl get pods -n kube-system
echo "current-context:" $(kubectl config current-context)
Expand Down
34 changes: 34 additions & 0 deletions flyteadmin/auth/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ package config

import (
"context"
"io/ioutil"
"path/filepath"
"testing"

"github.com/flyteorg/flytestdlib/logger"

"github.com/flyteorg/flytestdlib/config"
"github.com/flyteorg/flytestdlib/config/viper"

"github.com/ghodss/yaml"

"github.com/stretchr/testify/assert"

"github.com/ory/fosite"
Expand All @@ -15,3 +24,28 @@ func TestHashFlyteClientSecret(t *testing.T) {
assert.NoError(t, err)
t.Log(string(res))
}

type Secret struct {
Myval []byte `json:"myval"`
}

func TestFromYaml(t *testing.T) {
raw, err := ioutil.ReadFile(filepath.Join("testdata", "secret.yaml"))
assert.NoError(t, err)

s := Secret{}
assert.NoError(t, yaml.Unmarshal(raw, &s))
assert.Equal(t, "$2a$06$pxs1AkG81Kvrhpml1QiLSOQaTk9eePrU/7Yab9y07h3x0TglbaoT6", string(s.Myval))
}

func TestParseClientSecretConfig(t *testing.T) {
assert.NoError(t, logger.SetConfig(&logger.Config{IncludeSourceCode: true}))

accessor := viper.NewAccessor(config.Options{
RootSection: cfgSection,
SearchPaths: []string{filepath.Join("testdata", "config.yaml")},
})

assert.NoError(t, accessor.UpdateConfig(context.Background()))
assert.Equal(t, "my-client", GetConfig().AppAuth.SelfAuthServer.StaticClients["my-client"].ID)
}
8 changes: 8 additions & 0 deletions flyteadmin/auth/config/testdata/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
appAuth:
selfAuthServer:
accessTokenLifespan: 5h
refreshTokenLifespan: 6h
staticClients:
- my-client:
id: my-client
client_secret: JDJhJDA2JHB4czFBa0c4MUt2cmhwbWwxUWlMU09RYVRrOWVlUHJVLzdZYWI5eTA3aDN4MFRnbGJhb1Q2
1 change: 1 addition & 0 deletions flyteadmin/auth/config/testdata/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
myval: "JDJhJDA2JHB4czFBa0c4MUt2cmhwbWwxUWlMU09RYVRrOWVlUHJVLzdZYWI5eTA3aDN4MFRnbGJhb1Q2"
3 changes: 2 additions & 1 deletion flyteadmin/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ require (
github.com/flyteorg/flyteidl v0.18.40
github.com/flyteorg/flyteplugins v0.5.38
github.com/flyteorg/flytepropeller v0.7.8
github.com/flyteorg/flytestdlib v0.3.20
github.com/flyteorg/flytestdlib v0.3.22
github.com/ghodss/yaml v1.0.0
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
Expand Down
4 changes: 2 additions & 2 deletions flyteadmin/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ github.com/flyteorg/flyteplugins v0.5.38/go.mod h1:CxerBGWWEmNYmPxSMHnwQEr9cc1Fb
github.com/flyteorg/flytepropeller v0.7.8 h1:O441kDHJUayS/2rebTj7VG4e1LowrweazQhzTaZ97m4=
github.com/flyteorg/flytepropeller v0.7.8/go.mod h1:2SPJtYS0oM5lN4OCqBDbSRozRWvobFTXXlAC2ygbbWk=
github.com/flyteorg/flytestdlib v0.3.13/go.mod h1:Tz8JCECAbX6VWGwFT6cmEQ+RJpZ/6L9pswu3fzWs220=
github.com/flyteorg/flytestdlib v0.3.20 h1:1BTg02U1dyVZduxuViebHkTrw+4Owc5TI/lPbHiimzE=
github.com/flyteorg/flytestdlib v0.3.20/go.mod h1:VlbQuHTE+z2N5qusfwi+6WEkeJoqr8Q0E4NtBAsdwkU=
github.com/flyteorg/flytestdlib v0.3.22 h1:nJEPaCdxzXBaeg2p4fdo3I3Ua09NedFRaUwuLafLEdw=
github.com/flyteorg/flytestdlib v0.3.22/go.mod h1:1XG0DwYTUm34Yrffm1Qy9Tdr/pWQypEqTq5dUxw3/cM=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=
Expand Down

0 comments on commit ffdf6fe

Please sign in to comment.