Skip to content
Snippets Groups Projects
Commit 1b824cb6 authored by Mariano Cano's avatar Mariano Cano
Browse files

Upgrade controller-gen, crds and golangci-lint.

parent 4ce2997d
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ else ...@@ -16,7 +16,7 @@ else
GOBIN=$(shell go env GOBIN) GOBIN=$(shell go env GOBIN)
endif endif
all: build test lint all: build lint test
.PHONY: all .PHONY: all
...@@ -26,7 +26,7 @@ all: build test lint ...@@ -26,7 +26,7 @@ all: build test lint
bootstra%: bootstra%:
# Using a released version of golangci-lint to take into account custom replacements in their go.mod # Using a released version of golangci-lint to take into account custom replacements in their go.mod
$Q curl -sSfL https://raw.githubusercontent.com/smallstep/cli/master/make/golangci-install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.23.8 $Q curl -sSfL https://raw.githubusercontent.com/smallstep/cli/master/make/golangci-install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.39.0
.PHONY: bootstra% .PHONY: bootstra%
...@@ -77,10 +77,7 @@ GOFLAGS := CGO_ENABLED=0 ...@@ -77,10 +77,7 @@ GOFLAGS := CGO_ENABLED=0
build: $(PREFIX)bin/$(BINNAME) build: $(PREFIX)bin/$(BINNAME)
@echo "Build Complete!" @echo "Build Complete!"
download: $(PREFIX)bin/$(BINNAME): generate $(call rwildcard,*.go)
$Q go mod download
$(PREFIX)bin/$(BINNAME): download generate $(call rwildcard,*.go)
$Q mkdir -p $(@D) $Q mkdir -p $(@D)
$Q $(GOOS_OVERRIDE) $(GOFLAGS) go build -v -o $(PREFIX)bin/$(BINNAME) $(LDFLAGS) $(PKG) $Q $(GOOS_OVERRIDE) $(GOFLAGS) go build -v -o $(PREFIX)bin/$(BINNAME) $(LDFLAGS) $(PKG)
...@@ -96,7 +93,7 @@ generate: controller-gen ...@@ -96,7 +93,7 @@ generate: controller-gen
# download controller-gen if necessary # download controller-gen if necessary
controller-gen: controller-gen:
ifeq (, $(shell which controller-gen)) ifeq (, $(shell which controller-gen))
$Q go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.5 $Q go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0
CONTROLLER_GEN=$(GOBIN)/controller-gen CONTROLLER_GEN=$(GOBIN)/controller-gen
else else
CONTROLLER_GEN=$(shell which controller-gen) CONTROLLER_GEN=$(shell which controller-gen)
......
...@@ -117,7 +117,7 @@ running `make deploy`, but we're going to run the individual steps here: ...@@ -117,7 +117,7 @@ running `make deploy`, but we're going to run the individual steps here:
First we install the CRDs: First we install the CRDs:
```sh ```sh
kubectl apply -f config/crd/bases kubectl apply -f config/crd/bases/certmanager.step.sm_stepissuers.yaml
``` ```
Then we install the controller: Then we install the controller:
......
--- ---
apiVersion: apiextensions.k8s.io/v1beta1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
annotations: annotations:
controller-gen.kubebuilder.io/version: v0.2.5 controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null creationTimestamp: null
name: stepissuers.certmanager.step.sm name: stepissuers.certmanager.step.sm
spec: spec:
...@@ -15,121 +15,121 @@ spec: ...@@ -15,121 +15,121 @@ spec:
plural: stepissuers plural: stepissuers
singular: stepissuer singular: stepissuer
scope: Namespaced scope: Namespaced
subresources: versions:
status: {} - name: v1beta1
validation: schema:
openAPIV3Schema: openAPIV3Schema:
description: StepIssuer is the Schema for the stepissuers API description: StepIssuer is the Schema for the stepissuers API
properties: properties:
apiVersion: apiVersion:
description: 'APIVersion defines the versioned schema of this representation description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string type: string
kind: kind:
description: 'Kind is a string value representing the REST resource this description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string type: string
metadata: metadata:
type: object type: object
spec: spec:
description: StepIssuerSpec defines the desired state of StepIssuer description: StepIssuerSpec defines the desired state of StepIssuer
properties: properties:
caBundle: caBundle:
description: CABundle is a base64 encoded TLS certificate used to verify description: CABundle is a base64 encoded TLS certificate used to
connections to the step certificates server. If not set the system verify connections to the step certificates server. If not set the
root certificates are used to validate the TLS connection. system root certificates are used to validate the TLS connection.
format: byte format: byte
type: string type: string
provisioner: provisioner:
description: Provisioner contains the step certificates provisioner description: Provisioner contains the step certificates provisioner
configuration. configuration.
properties:
kid:
description: KeyID is the kid property of the JWK provisioner.
type: string
name:
description: Names is the name of the JWK provisioner.
type: string
passwordRef:
description: PasswordRef is a reference to a Secret containing the
provisioner password used to decrypt the provisioner private key.
properties:
key:
description: The key of the secret to select from. Must be a
valid secret key.
type: string
name:
description: The name of the secret in the pod's namespace to
select from.
type: string
required:
- name
type: object
required:
- kid
- name
- passwordRef
type: object
url:
description: URL is the base URL for the step certificates instance.
type: string
required:
- provisioner
- url
type: object
status:
description: StepIssuerStatus defines the observed state of StepIssuer
properties:
conditions:
items:
description: StepIssuerCondition contains condition information for
the step issuer.
properties: properties:
lastTransitionTime: kid:
description: LastTransitionTime is the timestamp corresponding description: KeyID is the kid property of the JWK provisioner.
to the last status change of this condition.
format: date-time
type: string
message:
description: Message is a human readable description of the details
of the last transition, complementing reason.
type: string
reason:
description: Reason is a brief machine readable explanation for
the condition's last transition.
type: string
status:
allOf:
- enum:
- "True"
- "False"
- Unknown
- enum:
- "True"
- "False"
- Unknown
description: Status of the condition, one of ('True', 'False',
'Unknown').
type: string type: string
type: name:
description: Type of the condition, currently ('Ready'). description: Names is the name of the JWK provisioner.
enum:
- Ready
type: string type: string
passwordRef:
description: PasswordRef is a reference to a Secret containing
the provisioner password used to decrypt the provisioner private
key.
properties:
key:
description: The key of the secret to select from. Must be
a valid secret key.
type: string
name:
description: The name of the secret in the pod's namespace
to select from.
type: string
required:
- name
type: object
required: required:
- status - kid
- type - name
- passwordRef
type: object type: object
type: array url:
type: object description: URL is the base URL for the step certificates instance.
type: object type: string
version: v1beta1 required:
versions: - provisioner
- name: v1beta1 - url
type: object
status:
description: StepIssuerStatus defines the observed state of StepIssuer
properties:
conditions:
items:
description: StepIssuerCondition contains condition information
for the step issuer.
properties:
lastTransitionTime:
description: LastTransitionTime is the timestamp corresponding
to the last status change of this condition.
format: date-time
type: string
message:
description: Message is a human readable description of the
details of the last transition, complementing reason.
type: string
reason:
description: Reason is a brief machine readable explanation
for the condition's last transition.
type: string
status:
allOf:
- enum:
- "True"
- "False"
- Unknown
- enum:
- "True"
- "False"
- Unknown
description: Status of the condition, one of ('True', 'False',
'Unknown').
type: string
type:
description: Type of the condition, currently ('Ready').
enum:
- Ready
type: string
required:
- status
- type
type: object
type: array
type: object
type: object
served: true served: true
storage: true storage: true
subresources:
status: {}
status: status:
acceptedNames: acceptedNames:
kind: "" kind: ""
......
...@@ -5,10 +5,12 @@ go 1.13 ...@@ -5,10 +5,12 @@ go 1.13
require ( require (
github.com/go-logr/logr v0.3.0 github.com/go-logr/logr v0.3.0
github.com/jetstack/cert-manager v1.3.1 github.com/jetstack/cert-manager v1.3.1
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/onsi/ginkgo v1.14.1 github.com/onsi/ginkgo v1.14.1
github.com/onsi/gomega v1.10.2 github.com/onsi/gomega v1.10.2
github.com/smallstep/certificates v0.14.2 github.com/smallstep/certificates v0.14.2
k8s.io/api v0.20.2 k8s.io/api v0.20.2
k8s.io/apiextensions-apiserver v0.20.2 // indirect
k8s.io/apimachinery v0.20.2 k8s.io/apimachinery v0.20.2
k8s.io/client-go v0.20.2 k8s.io/client-go v0.20.2
k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 k8s.io/utils v0.0.0-20210111153108-fddb29f9d009
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment