-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21de985
commit 537faac
Showing
42 changed files
with
1,931 additions
and
87 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
repos: | ||
- repo: https://github.com/zricethezav/gitleaks | ||
rev: v8.18.0 | ||
hooks: | ||
- id: gitleaks | ||
- repo: https://github.com/compilerla/conventional-pre-commit | ||
rev: v2.4.0 | ||
hooks: | ||
- id: conventional-pre-commit | ||
stages: [commit-msg] |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Build the manager binary | ||
FROM golang:alpine3.17 AS builder | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
RUN apk add --no-cache bash curl git | ||
|
||
# Install Delve for debugging | ||
RUN go install github.com/go-delve/delve/cmd/dlv@latest | ||
|
||
WORKDIR /workspace | ||
# Copy the Go Modules manifests | ||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
# cache deps before building and copying source so that we don't need to re-download as much | ||
# and so that source changes don't invalidate our downloaded layer | ||
RUN go mod download | ||
|
||
# Copy the go source | ||
COPY cmd/main.go cmd/main.go | ||
COPY api/ api/ | ||
COPY internal/ internal/ | ||
|
||
RUN curl -s https://get.helm.sh/helm-v3.10.1-linux-amd64.tar.gz | tar -xzf - && \ | ||
mv linux-amd64/helm . && rm -rf linux-amd64 | ||
|
||
# Build | ||
# the GOARCH has not a default value to allow the binary be built according to the host where the command | ||
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO | ||
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, | ||
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.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
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
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,104 @@ | ||
/* | ||
Copyright 2023. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// Valid8orConfigSpec defines the desired state of Valid8orConfig | ||
type Valid8orConfigSpec struct { | ||
Plugins []HelmRelease `json:"plugins,omitempty"` | ||
} | ||
|
||
type HelmRelease struct { | ||
Chart HelmChart `json:"chart"` | ||
Values string `json:"values"` | ||
} | ||
|
||
type HelmChart struct { | ||
Name string `json:"name"` | ||
Repository string `json:"repository"` | ||
Version string `json:"version"` | ||
} | ||
|
||
// Valid8orConfigStatus defines the observed state of Valid8orConfig | ||
type Valid8orConfigStatus struct { | ||
// +optional | ||
// +patchMergeKey=type | ||
// +patchStrategy=merge | ||
Conditions []Valid8orPluginCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` | ||
} | ||
|
||
type Valid8orPluginCondition struct { | ||
// Type of condition in CamelCase or in foo.example.com/CamelCase. | ||
// Many .condition.type values are consistent across resources like Available, but because arbitrary conditions | ||
// can be useful (see .node.status.conditions), the ability to deconflict is important. | ||
// +required | ||
Type ConditionType `json:"type"` | ||
|
||
// Name of the Valid8or plugin. | ||
// +required | ||
PluginName string `json:"pluginName"` | ||
|
||
// Status of the condition, one of True, False, Unknown. | ||
// +required | ||
Status corev1.ConditionStatus `json:"status"` | ||
|
||
// A human readable message indicating details about the transition. | ||
// This field may be empty. | ||
// +optional | ||
Message string `json:"message,omitempty"` | ||
|
||
// Last time the condition transitioned from one status to another. | ||
// This should be when the underlying condition changed. If that is not known, then using the time when | ||
// the API field changed is acceptable. | ||
// +required | ||
LastTransitionTime metav1.Time `json:"lastUpdatedTime"` | ||
} | ||
|
||
// ConditionType is a valid value for Condition.Type. | ||
type ConditionType string | ||
|
||
// HelmChartDeployedCondition defines the helm chart deployed condition type that defines if the helm chart was deployed correctly. | ||
const HelmChartDeployedCondition ConditionType = "HelmChartDeployed" | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// Valid8orConfig is the Schema for the valid8orconfigs API | ||
type Valid8orConfig struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec Valid8orConfigSpec `json:"spec,omitempty"` | ||
Status Valid8orConfigStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// Valid8orConfigList contains a list of Valid8orConfig | ||
type Valid8orConfigList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Valid8orConfig `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Valid8orConfig{}, &Valid8orConfigList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.