Skip to content

Commit

Permalink
chore: bump dependencies; controller-runtime, liberator et al
Browse files Browse the repository at this point in the history
  • Loading branch information
tronghn committed Nov 16, 2021
1 parent 9fcfcff commit 7677e93
Show file tree
Hide file tree
Showing 7 changed files with 902 additions and 364 deletions.
9 changes: 4 additions & 5 deletions controllers/jwker_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (r *JwkerReconciler) purge(ctx context.Context, req ctrl.Request) error {
}

r.logger.Info(fmt.Sprintf("Deleting application %s jwker secrets in namespace %s from cluster", req.Name, req.Namespace))
if err := secret.DeleteClusterSecrets(r, ctx, aid, ""); err != nil {
if err := secret.DeleteClusterSecrets(r.Client, ctx, aid, ""); err != nil {
return fmt.Errorf("deleting secrets from cluster: %s", err)
}
jwkermetrics.JwkerSecretsTotal.Dec()
Expand Down Expand Up @@ -206,7 +206,7 @@ func (r *JwkerReconciler) create(tx transaction) error {
TokenDingsWellKnownUrl: secret.WellKnownUrl(r.TokenDingsUrl),
}

if err := secret.CreateSecret(r, tx.ctx, tx.jwker.Spec.SecretName, secretData); err != nil {
if err := secret.CreateSecret(r.Client, tx.ctx, tx.jwker.Spec.SecretName, secretData); err != nil {
return fmt.Errorf("reconciling secrets: %s", err)
}

Expand All @@ -216,8 +216,7 @@ func (r *JwkerReconciler) create(tx transaction) error {
// +kubebuilder:rbac:groups=nais.io,resources=jwkers,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=nais.io,resources=jwkers/status,verbs=get;update;patch

func (r *JwkerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
ctx := context.Background()
func (r *JwkerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
hash := ""
correlationId := uuid.New().String()
var jwker jwkerv1.Jwker
Expand All @@ -237,7 +236,7 @@ func (r *JwkerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
"correlation_id", correlationId,
)

namespaceValidator := namespaces.NewValidator(r.Reader, r.logger)
namespaceValidator := namespaces.NewValidator(r.Client, r.logger)
inSharedNamespace, err := namespaceValidator.InSharedNamespace(ctx, req.Namespace)
if err != nil {
r.reportError(err, "failed validating namespace")
Expand Down
1 change: 0 additions & 1 deletion controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ func TestReconciler(t *testing.T) {
Client: cli,
ClusterName: "local",
Log: ctrl.Log.WithName("controllers").WithName("Jwker"),
Reader: mgr.GetAPIReader(),
Recorder: mgr.GetEventRecorderFor("jwker"),
Scheme: mgr.GetScheme(),
TokenDingsUrl: "http://" + listener.Addr().String(),
Expand Down
18 changes: 18 additions & 0 deletions doc/jwker-sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: nais.io/v1
kind: Jwker
metadata:
name: app1
namespace: myteam
spec:
accessPolicy:
inbound:
rules:
- application: app2
cluster: balls
namespace: test
outbound:
rules:
- application: app2
cluster: balls
namespace: test
secretName: app1
123 changes: 64 additions & 59 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,78 @@ module github.com/nais/jwker
go 1.17

require (
github.com/go-logr/logr v0.1.0
github.com/go-logr/zapr v0.1.0
github.com/golang-jwt/jwt/v4 v4.0.0
github.com/google/uuid v1.1.1
github.com/nais/liberator v0.0.0-20210217081730-10616faa752c
github.com/prometheus/client_golang v1.0.0
github.com/sirupsen/logrus v1.4.2
github.com/go-logr/logr v0.4.0
github.com/go-logr/zapr v0.4.0
github.com/golang-jwt/jwt/v4 v4.1.0
github.com/google/uuid v1.3.0
github.com/nais/liberator v0.0.0-20211103122448-66b116f3d55a
github.com/prometheus/client_golang v1.11.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.6.1
go.uber.org/zap v1.15.0
gopkg.in/square/go-jose.v2 v2.5.0
k8s.io/api v0.17.2
k8s.io/apimachinery v0.17.2
k8s.io/client-go v0.17.2
sigs.k8s.io/controller-runtime v0.5.0
github.com/stretchr/testify v1.7.0
go.uber.org/zap v1.19.1
gopkg.in/square/go-jose.v2 v2.6.0
k8s.io/api v0.22.3
k8s.io/apimachinery v0.22.3
k8s.io/client-go v0.22.3
sigs.k8s.io/controller-runtime v0.10.2
)

require (
cloud.google.com/go v0.38.0 // indirect
github.com/Azure/go-autorest/autorest v0.9.0 // indirect
github.com/Azure/go-autorest/autorest/adal v0.5.0 // indirect
github.com/Azure/go-autorest/autorest/date v0.1.0 // indirect
github.com/Azure/go-autorest/logger v0.1.0 // indirect
github.com/Azure/go-autorest/tracing v0.5.0 // indirect
github.com/beorn7/perks v1.0.0 // indirect
cloud.google.com/go v0.94.1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/evanphx/json-patch v4.5.0+incompatible // indirect
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d // indirect
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.3.0 // indirect
github.com/google/gofuzz v1.0.0 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/gophercloud/gophercloud v0.1.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/json-iterator/go v1.1.8 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/googleapis/gax-go/v2 v2.1.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/hashstructure v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/onsi/gomega v1.8.1 // indirect
github.com/pkg/errors v0.8.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
github.com/prometheus/common v0.4.1 // indirect
github.com/prometheus/procfs v0.0.2 // indirect
go.uber.org/atomic v1.6.0 // indirect
go.uber.org/multierr v1.5.0 // indirect
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 // indirect
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 // indirect
gomodules.xyz/jsonpatch/v2 v2.0.1 // indirect
google.golang.org/appengine v1.5.0 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.30.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/api v0.56.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 // indirect
google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.2.4 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
k8s.io/apiextensions-apiserver v0.17.2 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a // indirect
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f // indirect
sigs.k8s.io/yaml v1.1.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiextensions-apiserver v0.22.2 // indirect
k8s.io/component-base v0.22.2 // indirect
k8s.io/klog/v2 v2.10.0 // indirect
k8s.io/kube-openapi v0.0.0-20210817084001-7fbd8d59e5b8 // indirect
k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
Loading

0 comments on commit 7677e93

Please sign in to comment.