Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from using teams backend to nais api #199

Closed
wants to merge 2 commits into from
Closed

Conversation

thokra-nav
Copy link
Contributor

@thokra-nav thokra-nav commented Feb 21, 2024

NAIS-api uses a grpc client for internal communication.

This also upgrades the project to Go 1.22 because nais-api requires Go 1.22.


Denne krever at nais-api er på plass. Så før merging og utrulling, så må tenants utenom ci-nais og dev-nais skru av hookd reconcile i Fasit.

NAIS-api uses a grpc client for internal communication.

This also upgrades the project to Go 1.22 because nais-api requires Go
1.22.
@thokra-nav thokra-nav requested a review from kimtore February 21, 2024 10:01
Copy link
Contributor

@kimtore kimtore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but some names are ambiguous, see comments.
I don't understand why the 1.22 change is needed, nais api is not a code dependency? Afaic - next time, it should be a separate PR, but for now it's fine.

@@ -32,8 +32,8 @@ type Config struct {
LogLinkFormatter string `json:"log-link-formatter"`
MetricsPath string `json:"metrics-path"`
ProvisionKey string `json:"provision-key"`
TeamsAPIKey string `json:"teams-api-key"`
TeamsURL string `json:"teams-url"`
NaisAPITarget string `json:"nais-api-target"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to nais-api-address

TeamsAPIKey string `json:"teams-api-key"`
TeamsURL string `json:"teams-url"`
NaisAPITarget string `json:"nais-api-target"`
NaisAPIInsecure bool `json:"nais-api-insecure"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "insecure" mean?
I don't mind having "insecure" in the name, but I'd prefer if the option reflected what it actually does.

client protoapi.TeamsClient
}

func New(target string, insecureConnection bool) (*Client, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NewClient maybe?

@thokra-nav
Copy link
Contributor Author

The package in ./pkg/naisapi has a dependency on nais/api, which has a dependency on go 1.22.
So if I try to use go 1.21 and add nais/api, I get the following message:

go: github.com/nais/api@v0.0.0-20240221092250-0f2590f0befc requires go >= 1.22; switching to go1.22.0

Copy link
Contributor

@kimtore kimtore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't create dependencies to nais/api only to get the .proto and client code. Better to copy the proto file into this repo on-demand (with a Makefile stanza perhaps) and generate the client code locally.

@thokra-nav thokra-nav closed this Feb 21, 2024
@thokra-nav thokra-nav deleted the use-nais-api branch February 21, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants