-
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.
Signed-off-by: Anurag <anurag.kumar@syself.com>
- Loading branch information
Anurag
committed
Jan 11, 2024
1 parent
8d168d7
commit 6de6c0c
Showing
12 changed files
with
237 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,3 +81,4 @@ main | |
# helm generated yamls | ||
*.tgz.yaml | ||
*.build.yaml | ||
.release |
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 |
---|---|---|
|
@@ -11,4 +11,4 @@ spec: | |
autoSubscribe: false | ||
noProvider: true | ||
versions: | ||
- v1 | ||
- v2 |
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,43 @@ | ||
namespace: cso-system | ||
|
||
namePrefix: cso- | ||
|
||
commonLabels: | ||
cluster.x-k8s.io/provider: "infrastructure-cluster-stack-operator" | ||
|
||
resources: | ||
- ../crd | ||
- ../rbac | ||
- ../manager | ||
- ../certmanager | ||
|
||
patchesStrategicMerge: | ||
- manager_config_patch.yaml | ||
- manager_pull_policy.yaml | ||
# vars: | ||
# - name: CERTIFICATE_NAMESPACE # namespace of the certificate CR | ||
# objref: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # this name should match the one in certificate.yaml | ||
# fieldref: | ||
# fieldpath: metadata.namespace | ||
# - name: CERTIFICATE_NAME | ||
# objref: | ||
# kind: Certificate | ||
# group: cert-manager.io | ||
# version: v1 | ||
# name: serving-cert # this name should match the one in certificate.yaml | ||
# - name: SERVICE_NAMESPACE # namespace of the service | ||
# objref: | ||
# kind: Service | ||
# version: v1 | ||
# name: webhook-service | ||
# fieldref: | ||
# fieldpath: metadata.namespace | ||
# - name: SERVICE_NAME | ||
# objref: | ||
# kind: Service | ||
# version: v1 | ||
# name: webhook-service |
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,15 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: controller-manager | ||
namespace: system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- image: ghcr.io/sovereigncloudstack/cso-staging:dev | ||
name: manager | ||
args: | ||
- --leader-elect=true | ||
- --release-dir=/tmp | ||
- --local=true |
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,11 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: controller-manager | ||
namespace: system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: manager | ||
imagePullPolicy: Always |
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 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: controller-manager | ||
namespace: system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: manager | ||
ports: | ||
- containerPort: 9443 | ||
name: webhook-server | ||
protocol: TCP | ||
volumeMounts: | ||
- mountPath: /tmp/k8s-webhook-server/serving-certs | ||
name: cert | ||
readOnly: true | ||
volumes: | ||
- name: cert | ||
secret: | ||
defaultMode: 420 | ||
secretName: cso-webhook-server-cert |
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,9 @@ | ||
# This patch add annotation to admission webhook config and | ||
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. | ||
--- | ||
apiVersion: admissionregistration.k8s.io/v1 | ||
kind: ValidatingWebhookConfiguration | ||
metadata: | ||
name: validating-webhook-configuration | ||
annotations: | ||
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) |
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,69 @@ | ||
/* | ||
Copyright 2023 The Kubernetes Authors. | ||
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 fake defines a fake Gitub client. | ||
package fake | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
|
||
"github.com/SovereignCloudStack/cluster-stack-operator/pkg/github/client" | ||
"github.com/go-logr/logr" | ||
"github.com/google/go-github/v52/github" | ||
"sigs.k8s.io/controller-runtime/pkg/log" | ||
) | ||
|
||
type fakeClient struct { | ||
log logr.Logger | ||
} | ||
|
||
type factory struct{} | ||
|
||
var _ = client.Client(&fakeClient{}) | ||
|
||
var _ = client.Factory(&factory{}) | ||
|
||
// NewFactory returns a new factory for Github clients. | ||
func NewFactory() client.Factory { | ||
return &factory{} | ||
} | ||
|
||
func (*factory) NewClient(ctx context.Context) (client.Client, error) { | ||
logger := log.FromContext(ctx) | ||
|
||
return &fakeClient{ | ||
log: logger, | ||
}, nil | ||
} | ||
|
||
func (c *fakeClient) ListRelease(_ context.Context) ([]*github.RepositoryRelease, *github.Response, error) { | ||
c.log.Info("WARNING: called ListRelease of fake Github client") | ||
resp := &github.Response{Response: &http.Response{StatusCode: http.StatusOK}} | ||
return nil, resp, nil | ||
} | ||
|
||
func (c *fakeClient) GetReleaseByTag(_ context.Context, _ string) (*github.RepositoryRelease, *github.Response, error) { | ||
c.log.Info("WARNING: called GetReleaseByTag of fake Github client") | ||
resp := &github.Response{Response: &http.Response{StatusCode: http.StatusOK}} | ||
return nil, resp, nil | ||
} | ||
|
||
// DownloadReleaseAssets downloads a list of release assets. | ||
func (c *fakeClient) DownloadReleaseAssets(_ context.Context, _ *github.RepositoryRelease, _ string, _ []string) error { | ||
c.log.Info("WARNING: called DownloadReleaseAssets of fake Github client") | ||
return nil | ||
} |