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

Lip tenant lookup command #304

Merged
merged 7 commits into from
Mar 20, 2024
Merged

Lip tenant lookup command #304

merged 7 commits into from
Mar 20, 2024

Conversation

teasailor
Copy link
Contributor

Description

New hidden command group provisioning is created. This command is needed to provision new tenants to the platform. It should be used only internally by platform admins.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

lubos-svoboda
lubos-svoboda previously approved these changes Mar 12, 2024
cmd/provisioning/lookup.go Outdated Show resolved Hide resolved
cmd/provisioning/lookup.go Outdated Show resolved Hide resolved
cmd/provisioning/provisioning.go Show resolved Hide resolved
cmd/provisioning/lookup.go Outdated Show resolved Hide resolved

log.WithFields(log.Fields{"command": cmd.Name(), "vanityUrl": vanityUrl}).Info("Provisioning group command")

response := callBackend(vanityUrl)
Copy link
Contributor

Choose a reason for hiding this comment

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

note that the cmdkit.FetchAndPrint provides the combined functionality of calling the API and printing the result.

cmd/provisioning/lookup.go Outdated Show resolved Hide resolved
cmd/provisioning/lookup.go Outdated Show resolved Hide resolved
@pnickolov pnickolov marked this pull request as draft March 16, 2024 00:24
"fmt"
"strings"

"github.com/pkg/errors"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"github.com/pkg/errors"
"errors"

"strings"

"github.com/pkg/errors"
"golang.org/x/exp/slices"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"golang.org/x/exp/slices"
"slices"

Copy link
Contributor

Choose a reason for hiding this comment

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

This and the previous ones can just move to use the recent places for these packages, as they are now part of the standard library. I will also correct the uql/api_version.go where the old ones seem to have come from.

package provisioning

import (
"github.com/apex/log"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"github.com/apex/log"
"github.com/apex/log"
"github.com/spf13/cobra"

Copy link
Contributor Author

@teasailor teasailor Mar 19, 2024

Choose a reason for hiding this comment

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

I realised that I missed make go-impi and make pre-commit before 2nd PR so imports were changed.

cmd/provisioning/lookup.go Show resolved Hide resolved
Long: `Check whether tenant exist and return tenant Id if it does.
Tenant lookup doesn't require valid authentication (auth=none) but any configured auth type/tenant will also work.`,
Example: ` fsoc provisioning lookup your-vanity-url.appdynamics.com
or with alias
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
or with alias

Short: "Lookup for a tenant Id by vanity URL",
Long: `Check whether tenant exist and return tenant Id if it does.
Tenant lookup doesn't require valid authentication (auth=none) but any configured auth type/tenant will also work.`,
Example: ` fsoc provisioning lookup your-vanity-url.appdynamics.com
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Example: ` fsoc provisioning lookup your-vanity-url.appdynamics.com
Example: ` fsoc provisioning lookup MYTENANT.observe.appdynamics.com

This is the pattern we use elsewhere, e.g., in config set --help. It will be more consistent to use it this way.

import (
"fmt"
"strings"

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

To accommodate for the changes below, which will make these standard library imports. Please sort (or use make pre-commit to automatically adjust the order) if your editor doesn't.

@pnickolov pnickolov marked this pull request as ready for review March 20, 2024 08:09
@pnickolov pnickolov merged commit a6ab6fa into main Mar 20, 2024
8 checks passed
@pnickolov pnickolov deleted the LIP-tenant-lookup-command branch March 20, 2024 08:09
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.

None yet

4 participants