generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/go_modules/github.com/gardener/ga…
…rdener-1.100.0
- Loading branch information
Showing
28 changed files
with
354 additions
and
42 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
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
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 @@ | ||
FROM golang:1.22.5-alpine AS build | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
WORKDIR /workdir | ||
|
||
COPY go.mod go.mod | ||
COPY go.sum go.sum | ||
RUN go mod download | ||
|
||
COPY cmd/ cmd/ | ||
COPY internal/ internal/ | ||
COPY pkg/ pkg/ | ||
|
||
ARG BIN | ||
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o shoot-comparator cmd/main.go | ||
|
||
FROM gcr.io/distroless/static:nonroot | ||
WORKDIR / | ||
COPY --from=build /workdir/shoot-comparator . | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/shoot-comparator"] |
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
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
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,50 @@ | ||
package extender | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
gardener "github.com/gardener/gardener/pkg/apis/core/v1beta1" | ||
imv1 "github.com/kyma-project/infrastructure-manager/api/v1" | ||
apimachineryRuntime "k8s.io/apimachinery/pkg/runtime" | ||
) | ||
|
||
func ExtendWithCertConfig(_ imv1.Runtime, shoot *gardener.Shoot) error { | ||
certConfig := NewCertConfig() | ||
jsonCertConfig, encodingErr := json.Marshal(certConfig) | ||
if encodingErr != nil { | ||
return encodingErr | ||
} | ||
|
||
certServiceExtension := gardener.Extension{ | ||
Type: "shoot-cert-service", | ||
ProviderConfig: &apimachineryRuntime.RawExtension{Raw: jsonCertConfig}, | ||
} | ||
|
||
shoot.Spec.Extensions = append(shoot.Spec.Extensions, certServiceExtension) | ||
|
||
return nil | ||
} | ||
|
||
type ExtensionProviderConfig struct { | ||
// APIVersion is gardener extension api version | ||
APIVersion string `json:"apiVersion"` | ||
// DnsProviderReplication indicates whether dnsProvider replication is on | ||
DNSProviderReplication *DNSProviderReplication `json:"dnsProviderReplication,omitempty"` | ||
// ShootIssuers indicates whether shoot Issuers are on | ||
ShootIssuers *ShootIssuers `json:"shootIssuers,omitempty"` | ||
// Kind is extension type | ||
Kind string `json:"kind"` | ||
} | ||
|
||
type ShootIssuers struct { | ||
// Enabled indicates whether shoot Issuers are on | ||
Enabled bool `json:"enabled"` | ||
} | ||
|
||
func NewCertConfig() *ExtensionProviderConfig { | ||
return &ExtensionProviderConfig{ | ||
APIVersion: "service.cert.extensions.gardener.cloud/v1alpha1", | ||
ShootIssuers: &ShootIssuers{Enabled: true}, | ||
Kind: "CertConfig", | ||
} | ||
} |
Oops, something went wrong.