Skip to content

Commit

Permalink
feat: implement list pack registries (#144)
Browse files Browse the repository at this point in the history
* feat: implement list pack registries
* chore: add generate target & generate models
* chore: make reviewable
---------

Signed-off-by: Tyler Gillson <[email protected]>
Co-authored-by: Tyler Gillson <[email protected]>
  • Loading branch information
MGamya and TylerGillson authored Dec 17, 2024
1 parent 62d0673 commit 4b94c84
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: conventional-pre-commit
stages: [commit-msg]
- repo: https://github.com/golangci/golangci-lint
rev: v1.59.1
rev: v1.62.2
hooks:
- id: golangci-lint
entry: golangci-lint run --new-from-rev HEAD --whole-files --fix
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ ERR = echo ${TIME} ${RED}[ ERR ]${CNone} "error:"
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[0m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

##@ Build Targets

generate: ## Generate models
(cd api && ./generate.sh ./)

##@ Static Analysis Targets

check-diff: reviewable ## Execute branch is clean
Expand Down Expand Up @@ -58,7 +63,7 @@ BIN_DIR ?= ./bin
bin-dir:
test -d $(BIN_DIR) || mkdir $(BIN_DIR)

GOLANGCI_VERSION ?= 1.59.1
GOLANGCI_VERSION ?= 1.62.2
.PHONY: golangci-lint
golangci-lint: bin-dir
if ! test -f $(BIN_DIR)/golangci-lint-linux-amd64; then \
Expand Down
3 changes: 0 additions & 3 deletions api/models/v1_iam_roles_anywhere.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions api/models/v1_subnet.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 2 additions & 10 deletions api/spec/palette-apis-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -42593,10 +42593,6 @@
"description": "IamRolesAnywhere specifies the IAM Roles Anywhere configuration for the AWS/EKS cluster",
"type": "object",
"properties": {
"assumeRoleArn": {
"description": "AssumeRoleARN specifies the IAM role ARN to assume",
"type": "string"
},
"profileArn": {
"description": "ProfileARN specifies the IAM profile ARN",
"type": "string"
Expand Down Expand Up @@ -53218,12 +53214,8 @@
"name": {
"type": "string"
},
"networkSecurityGroup": {
"description": "Network security group of the subnet",
"type": "string"
},
"resourceGroup": {
"description": "Resource group associated with a subnet",
"nsgResourceGroup": {
"description": "Resource group associated with a network security group",
"type": "string"
},
"securityGroupName": {
Expand Down
12 changes: 2 additions & 10 deletions api/spec/palette.json
Original file line number Diff line number Diff line change
Expand Up @@ -42610,10 +42610,6 @@
"description": "IamRolesAnywhere specifies the IAM Roles Anywhere configuration for the AWS/EKS cluster",
"type": "object",
"properties": {
"assumeRoleArn": {
"description": "AssumeRoleARN specifies the IAM role ARN to assume",
"type": "string"
},
"profileArn": {
"description": "ProfileARN specifies the IAM profile ARN",
"type": "string"
Expand Down Expand Up @@ -53235,12 +53231,8 @@
"name": {
"type": "string"
},
"networkSecurityGroup": {
"description": "Network security group of the subnet",
"type": "string"
},
"resourceGroup": {
"description": "Resource group associated with a subnet",
"nsgResourceGroup": {
"description": "Resource group associated with a network security group",
"type": "string"
},
"securityGroupName": {
Expand Down
10 changes: 10 additions & 0 deletions client/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ func (h *V1Client) GetPackRegistryByName(registryName string) (*models.V1PackReg
return nil, fmt.Errorf("registry '%s' not found", registryName)
}

// ListPackRegistries retries a list of all Pack registries.
func (h *V1Client) ListPackRegistries() ([]*models.V1PackRegistrySummary, error) {
params := clientv1.NewV1RegistriesPackSummaryListParamsWithContext(h.ctx)
resp, err := h.Client.V1RegistriesPackSummaryList(params)
if err != nil {
return nil, err
}
return resp.Payload.Items, nil
}

// ListHelmRegistries retrieves a list of all Helm registries, filtered by scope.
func (h *V1Client) ListHelmRegistries(scope string) ([]*models.V1HelmRegistrySummary, error) {
params := clientv1.NewV1RegistriesHelmSummaryListParamsWithContext(h.ctx).
Expand Down

0 comments on commit 4b94c84

Please sign in to comment.