diff --git a/Makefile b/Makefile index 0f787448..72bb7fd4 100644 --- a/Makefile +++ b/Makefile @@ -67,14 +67,14 @@ docker-push: $(addsuffix -push,$(IMAGES)) HAS_SWAGGER := $(shell command -v swagger;) 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_MOCKGEN go install github.com/golang/mock/mockgen@v1.6.0 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",