From 8eb4b66b23695d0f1962724e988a5f789952bdb4 Mon Sep 17 00:00:00 2001 From: Fredrik Hatletvedt Date: Tue, 19 Dec 2023 13:29:23 +0100 Subject: [PATCH 1/2] fix typo --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bca17f61..0ffa1dbc 100644 --- a/Makefile +++ b/Makefile @@ -69,14 +69,14 @@ docker-push: $(addsuffix -push,$(IMAGES)) HAS_SWAGGER := $(shell command -v swagger;) HAS_STATICCHECK := $(shell command -v staticcheck;) HAS_GOLANGCI_LINT := $(shell command -v golangci-lint;) -HAS_MOCKGEN := $(shell command -v golangci-lint;) +HAS_MOCKGEN := $(shell command -v mockgen;) bootstrap: ifndef HAS_SWAGGER go install github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5 endif ifndef HAS_GOLANGCI_LINT - go install github.com/golangci/golangci-lint/cmd/golangci-lint@1.55.2 + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 endif ifndef HAS_STATICCHECK go install honnef.co/go/tools/cmd/staticcheck@v0.4.6 From 70498b9f7831c62be3cf781dae29fe114798b131 Mon Sep 17 00:00:00 2001 From: Fredrik Hatletvedt Date: Tue, 19 Dec 2023 13:31:03 +0100 Subject: [PATCH 2/2] fix SecretType swagger definition --- api/secrets/models/secret.go | 2 +- api/secrets/models/secret_parameters.go | 1 - swaggerui/html/swagger.json | 36 ++++++++++++++++++++----- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/api/secrets/models/secret.go b/api/secrets/models/secret.go index 98014428..b3d7aba3 100644 --- a/api/secrets/models/secret.go +++ b/api/secrets/models/secret.go @@ -20,7 +20,6 @@ type Secret struct { // Type of the secret // // required: false - // enum: generic,client-cert,azure-blob-fuse-volume,csi-azure-blob-volume,csi-azure-key-vault-creds,csi-azure-key-vault-item,client-cert-auth,oauth2-proxy // example: client-cert Type SecretType `json:"type,omitempty"` @@ -64,6 +63,7 @@ type Secret struct { TLSCertificates []TLSCertificate `json:"tlsCertificates,omitempty"` } +// swagger:enum SecretType type SecretType string const ( diff --git a/api/secrets/models/secret_parameters.go b/api/secrets/models/secret_parameters.go index 6d35b323..1e79cfe2 100644 --- a/api/secrets/models/secret_parameters.go +++ b/api/secrets/models/secret_parameters.go @@ -12,7 +12,6 @@ type SecretParameters struct { // Type of the secret // // required: false - // enum: generic,client-cert,azure-blob-fuse-volume,csi-azure-blob-volume,csi-azure-key-vault-creds,csi-azure-key-vault-item,client-cert-auth,oauth2-proxy // example: azure-blob-fuse-volume Type SecretType `json:"type,omitempty"` } diff --git a/swaggerui/html/swagger.json b/swaggerui/html/swagger.json index 96c53f36..5374a0e0 100644 --- a/swaggerui/html/swagger.json +++ b/swaggerui/html/swagger.json @@ -7180,7 +7180,21 @@ "x-go-name": "TLSCertificates" }, "type": { - "$ref": "#/definitions/SecretType" + "description": "Type of the secret\ngeneric SecretTypeGeneric\nclient-cert SecretTypeClientCert\nazure-blob-fuse-volume SecretTypeAzureBlobFuseVolume\ncsi-azure-blob-volume SecretTypeCsiAzureBlobVolume\ncsi-azure-key-vault-creds SecretTypeCsiAzureKeyVaultCreds\ncsi-azure-key-vault-item SecretTypeCsiAzureKeyVaultItem\nclient-cert-auth SecretTypeClientCertificateAuth\noauth2-proxy SecretTypeOAuth2Proxy", + "type": "string", + "enum": [ + "generic", + "client-cert", + "azure-blob-fuse-volume", + "csi-azure-blob-volume", + "csi-azure-key-vault-creds", + "csi-azure-key-vault-item", + "client-cert-auth", + "oauth2-proxy" + ], + "x-go-enum-desc": "generic SecretTypeGeneric\nclient-cert SecretTypeClientCert\nazure-blob-fuse-volume SecretTypeAzureBlobFuseVolume\ncsi-azure-blob-volume SecretTypeCsiAzureBlobVolume\ncsi-azure-key-vault-creds SecretTypeCsiAzureKeyVaultCreds\ncsi-azure-key-vault-item SecretTypeCsiAzureKeyVaultItem\nclient-cert-auth SecretTypeClientCertificateAuth\noauth2-proxy SecretTypeOAuth2Proxy", + "x-go-name": "Type", + "example": "client-cert" } }, "x-go-package": "github.com/equinor/radix-api/api/secrets/models" @@ -7199,15 +7213,25 @@ "example": "p4$sW0rDz" }, "type": { - "$ref": "#/definitions/SecretType" + "description": "Type of the secret\ngeneric SecretTypeGeneric\nclient-cert SecretTypeClientCert\nazure-blob-fuse-volume SecretTypeAzureBlobFuseVolume\ncsi-azure-blob-volume SecretTypeCsiAzureBlobVolume\ncsi-azure-key-vault-creds SecretTypeCsiAzureKeyVaultCreds\ncsi-azure-key-vault-item SecretTypeCsiAzureKeyVaultItem\nclient-cert-auth SecretTypeClientCertificateAuth\noauth2-proxy SecretTypeOAuth2Proxy", + "type": "string", + "enum": [ + "generic", + "client-cert", + "azure-blob-fuse-volume", + "csi-azure-blob-volume", + "csi-azure-key-vault-creds", + "csi-azure-key-vault-item", + "client-cert-auth", + "oauth2-proxy" + ], + "x-go-enum-desc": "generic SecretTypeGeneric\nclient-cert SecretTypeClientCert\nazure-blob-fuse-volume SecretTypeAzureBlobFuseVolume\ncsi-azure-blob-volume SecretTypeCsiAzureBlobVolume\ncsi-azure-key-vault-creds SecretTypeCsiAzureKeyVaultCreds\ncsi-azure-key-vault-item SecretTypeCsiAzureKeyVaultItem\nclient-cert-auth SecretTypeClientCertificateAuth\noauth2-proxy SecretTypeOAuth2Proxy", + "x-go-name": "Type", + "example": "azure-blob-fuse-volume" } }, "x-go-package": "github.com/equinor/radix-api/api/secrets/models" }, - "SecretType": { - "type": "string", - "x-go-package": "github.com/equinor/radix-api/api/secrets/models" - }, "SlackConfig": { "description": "SlackConfig configuration options for Slack", "type": "object",