Skip to content

Commit

Permalink
add some env vars, fix controller import, wrangler v2 import
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Dec 1, 2023
1 parent e377d3b commit 126db5d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ RUN \
go build -o bin/fides main.go

FROM base AS goreleaser
ENTRYPOINT ["/usr/local/bin/fides"]
CMD ["controller"]
COPY fides /usr/local/bin/fides
USER fides

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/ekristen/fides
go 1.19

require (
github.com/rancher/wrangler v1.1.1
github.com/rancher/wrangler/v2 v2.1.1-0.20231012210714-3032665ca561
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
github.com/urfave/cli/v2 v2.25.7
Expand Down
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
Expand Down Expand Up @@ -63,8 +63,8 @@ github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rancher/wrangler v1.1.1 h1:wmqUwqc2M7ADfXnBCJTFkTB5ZREWpD78rnZMzmxwMvM=
github.com/rancher/wrangler v1.1.1/go.mod h1:ioVbKupzcBOdzsl55MvEDN0R1wdGggj8iNCYGFI5JvM=
github.com/rancher/wrangler/v2 v2.1.1-0.20231012210714-3032665ca561 h1:5tIFBO5r+DWXm638DtBsQP9VdZD+OVDi9K7qryyx60M=
github.com/rancher/wrangler/v2 v2.1.1-0.20231012210714-3032665ca561/go.mod h1:2pCXUgRUaiiIZYqFe/nK2xwujNs6JK+SgAcyB+xs+Tg=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import (
"os"
"path"

"github.com/rancher/wrangler/pkg/signals"
"github.com/rancher/wrangler/v2/pkg/signals"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"

"github.com/ekristen/fides/pkg/common"

_ "github.com/ekristen/fides/pkg/commands/controllers"
)

func main() {
Expand Down
26 changes: 15 additions & 11 deletions pkg/commands/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,21 @@ func Execute(c *cli.Context) error {
func init() {
flags := []cli.Flag{
&cli.BoolFlag{
Name: "agree-tos",
Usage: "Agree to the Terms of Service https://fides.ekristen.dev/terms, by using this option you agree.",
Name: "agree-tos",
Usage: "Agree to the Terms of Service https://fides.ekristen.dev/terms, by using this option you agree.",
EnvVars: []string{"FIDES_AGREE_TOS"},
},
&cli.StringFlag{
Name: "namespace",
Usage: "namespace for fides",
Value: "fides-system",
Name: "namespace",
Usage: "namespace for fides",
Value: "fides-system",
EnvVars: []string{"FIDES_NAMESPACE"},
},
&cli.StringFlag{
Name: "secret-name",
Usage: "custom name for the fides secret",
Value: "fides",
Name: "secret-name",
Usage: "custom name for the fides secret",
Value: "fides",
EnvVars: []string{"FIDES_SECRET_NAME"},
},
&cli.StringFlag{
Name: "metrics-port",
Expand All @@ -55,9 +58,10 @@ func init() {
Hidden: true,
},
&cli.StringFlag{
Name: "base-url",
Value: "https://fides.ekristen.dev",
Hidden: true,
Name: "base-url",
Value: "https://fides.ekristen.dev",
Hidden: true,
EnvVars: []string{"FIDES_BASE_URL"},
},
&cli.StringFlag{
Name: "cluster-key",
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/rancher/wrangler/pkg/kubeconfig"
"github.com/rancher/wrangler/pkg/leader"
"github.com/rancher/wrangler/v2/pkg/kubeconfig"
"github.com/rancher/wrangler/v2/pkg/leader"
"github.com/sirupsen/logrus"
"io"
"io/ioutil"
Expand Down

0 comments on commit 126db5d

Please sign in to comment.