-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add config type boilerplate (#6)
* refactor: Tidy up static credentials test * feat: Add config type boilerplate
- Loading branch information
1 parent
4cfce1b
commit 4756a19
Showing
12 changed files
with
727 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
ginkgo 2.4.0 | ||
ginkgo 2.5.0 | ||
golang 1.19.3 | ||
golangci-lint 1.50.1 | ||
goreleaser 1.12.3 | ||
golang 1.19.2 | ||
helm 3.10.1 | ||
kube-controller-tools 0.10.0 | ||
kubebuilder 3.7.0 | ||
pre-commit 2.20.0 | ||
upx 3.96 | ||
upx 4.0.0 | ||
shfmt 3.5.1 | ||
kube-code-generator 0.25.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
domain: kubeletimagecredentialprovidershim.d2iq.com | ||
layout: | ||
- go.kubebuilder.io/v3 | ||
multigroup: true | ||
projectName: project | ||
repo: github.com/mesosphere/kubelet-image-credential-provider-shim | ||
resources: | ||
- api: | ||
crdVersion: v1 | ||
namespaced: true | ||
domain: kubeletimagecredentialprovidershim.d2iq.com | ||
group: config | ||
kind: KubeletImageCredentialProviderShimConfig | ||
path: github.com/mesosphere/kubelet-image-credential-provider-shim/apis/config/v1alpha1 | ||
version: v1alpha1 | ||
version: "3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2022 D2iQ, Inc. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Package v1alpha1 contains API Schema definitions for the config v1alpha1 API group | ||
// +kubebuilder:object:generate=true | ||
// +groupName=config.kubeletimagecredentialprovidershim.d2iq.com | ||
package v1alpha1 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects. | ||
GroupVersion = schema.GroupVersion{ | ||
Group: "config.kubeletimagecredentialprovidershim.d2iq.com", | ||
Version: "v1alpha1", | ||
} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme. | ||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} | ||
|
||
// AddToScheme adds the types in this group-version to the given scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
) |
23 changes: 23 additions & 0 deletions
23
apis/config/v1alpha1/kubeletimagecredentialprovidershimconfig_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2022 D2iQ, Inc. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package v1alpha1 | ||
|
||
//go:generate controller-gen object paths=. | ||
//go:generate bash -ec "cd ../../.. && defaulter-gen -h hack/boilerplate.go.txt -i ./apis/config/v1alpha1 -o ." | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
//nolint:gochecknoinits // init is the convention for registering API types. | ||
func init() { | ||
SchemeBuilder.Register(&KubeletImageCredentialProviderShimConfig{}) | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
type KubeletImageCredentialProviderShimConfig struct { | ||
//nolint:revive // inline is not an official json struct tag value, but is required bu Kubernetes. | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.