Skip to content

Commit 429ad62

Browse files
m1kolaankitathomas
authored andcommitted
Remove unused pull secret configuration (#1180)
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
1 parent 8d16b39 commit 429ad62

File tree

870 files changed

+5329
-138838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

870 files changed

+5329
-138838
lines changed

.goreleaser.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ builds:
99
asmflags: "{{ .Env.GO_BUILD_ASMFLAGS }}"
1010
gcflags: "{{ .Env.GO_BUILD_GCFLAGS }}"
1111
ldflags: "{{ .Env.GO_BUILD_LDFLAGS }}"
12+
tags:
13+
- "{{ .Env.GO_BUILD_TAGS }}"
1214
goos:
1315
- linux
1416
goarch:

Makefile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ help-extended: #HELP Display extended help.
9191

9292
.PHONY: lint
9393
lint: $(GOLANGCI_LINT) #HELP Run golangci linter.
94-
$(GOLANGCI_LINT) run $(GOLANGCI_LINT_ARGS)
94+
$(GOLANGCI_LINT) run --build-tags $(GO_BUILD_TAGS) $(GOLANGCI_LINT_ARGS)
9595

9696
.PHONY: tidy
9797
tidy: #HELP Update dependencies.
@@ -111,15 +111,15 @@ verify: tidy fmt vet generate manifests #HELP Verify all generated code is up-to
111111

112112
.PHONY: fix-lint
113113
fix-lint: $(GOLANGCI_LINT) #EXHELP Fix lint issues
114-
$(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_ARGS)
114+
$(GOLANGCI_LINT) run --fix --build-tags $(GO_BUILD_TAGS) $(GOLANGCI_LINT_ARGS)
115115

116116
.PHONY: fmt
117117
fmt: #EXHELP Formats code
118118
go fmt ./...
119119

120120
.PHONY: vet
121121
vet: #EXHELP Run go vet against code.
122-
go vet ./...
122+
go vet -tags '$(GO_BUILD_TAGS)' ./...
123123

124124
.PHONY: test
125125
test: manifests generate fmt vet test-unit test-e2e #HELP Run all tests.
@@ -148,10 +148,17 @@ UNIT_TEST_DIRS := $(shell go list ./... | grep -v /test/)
148148
COVERAGE_UNIT_DIR := $(ROOT_DIR)/coverage/unit
149149
test-unit: $(SETUP_ENVTEST) #HELP Run the unit tests
150150
rm -rf $(COVERAGE_UNIT_DIR) && mkdir -p $(COVERAGE_UNIT_DIR)
151-
eval $$($(SETUP_ENVTEST) use -p env $(ENVTEST_VERSION) $(SETUP_ENVTEST_BIN_DIR_OVERRIDE)) && CGO_ENABLED=1 go test -count=1 -race -short $(UNIT_TEST_DIRS) -cover -coverprofile ${ROOT_DIR}/coverage/unit.out -test.gocoverdir=$(ROOT_DIR)/coverage/unit
152-
151+
eval $$($(SETUP_ENVTEST) use -p env $(ENVTEST_VERSION) $(SETUP_ENVTEST_BIN_DIR_OVERRIDE)) && \
152+
CGO_ENABLED=1 go test \
153+
-tags '$(GO_BUILD_TAGS)' \
154+
-cover -coverprofile ${ROOT_DIR}/coverage/unit.out \
155+
-count=1 -race -short \
156+
$(UNIT_TEST_DIRS) \
157+
-test.gocoverdir=$(ROOT_DIR)/coverage/unit
158+
159+
E2E_REGISTRY_CERT_REF := ClusterIssuer/olmv1-ca # By default, we'll use a trusted CA for the registry.
153160
image-registry: ## Setup in-cluster image registry
154-
./hack/test/image-registry.sh $(E2E_REGISTRY_NAMESPACE) $(E2E_REGISTRY_NAME)
161+
./hack/test/image-registry.sh $(E2E_REGISTRY_NAMESPACE) $(E2E_REGISTRY_NAME) $(E2E_REGISTRY_CERT_REF)
155162

156163
build-push-e2e-catalog: ## Build the testdata catalog used for e2e tests and push it to the image registry
157164
./hack/test/build-push-e2e-catalog.sh $(E2E_REGISTRY_NAMESPACE) $(LOCAL_REGISTRY_HOST)/$(E2E_TEST_CATALOG_V1)
@@ -166,6 +173,7 @@ build-push-e2e-catalog: ## Build the testdata catalog used for e2e tests and pus
166173
test-e2e: KIND_CLUSTER_NAME := operator-controller-e2e
167174
test-e2e: KUSTOMIZE_BUILD_DIR := config/overlays/e2e
168175
test-e2e: GO_BUILD_FLAGS := -cover
176+
test-e2e: E2E_REGISTRY_CERT_REF := Issuer/selfsigned-issuer
169177
test-e2e: run image-registry build-push-e2e-catalog registry-load-bundles e2e e2e-coverage kind-clean #HELP Run e2e test suite on local kind cluster
170178

171179
.PHONY: extension-developer-e2e
@@ -236,6 +244,7 @@ export CGO_ENABLED
236244

237245
export GIT_REPO := $(shell go list -m)
238246
export VERSION_PATH := ${GIT_REPO}/internal/version
247+
export GO_BUILD_TAGS := containers_image_openpgp
239248
export GO_BUILD_ASMFLAGS := all=-trimpath=$(PWD)
240249
export GO_BUILD_GCFLAGS := all=-trimpath=$(PWD)
241250
export GO_BUILD_FLAGS :=

Tiltfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ repo = {
1818

1919
for r in repos:
2020
if r == 'operator-controller':
21-
deploy_repo('operator-controller', repo)
21+
deploy_repo('operator-controller', repo, '-tags containers_image_openpgp')
2222
else:
2323
include('../{}/Tiltfile'.format(r))

cmd/manager/main.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"path/filepath"
2626
"time"
2727

28+
"github.com/containers/image/v5/types"
2829
"github.com/spf13/pflag"
2930
"go.uber.org/zap/zapcore"
3031
apiextensionsv1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1"
@@ -194,11 +195,13 @@ func main() {
194195
setupLog.Error(err, "unable to create CA certificate pool")
195196
os.Exit(1)
196197
}
197-
unpacker := &source.ImageRegistry{
198+
199+
unpacker := &source.ContainersImageRegistry{
198200
BaseCachePath: filepath.Join(cachePath, "unpack"),
199-
// TODO: This needs to be derived per extension via ext.Spec.InstallNamespace
200-
AuthNamespace: systemNamespace,
201-
CertPoolWatcher: certPoolWatcher,
201+
SourceContext: &types.SystemContext{
202+
DockerCertPath: caCertDir,
203+
OCICertPath: caCertDir,
204+
},
202205
}
203206

204207
clusterExtensionFinalizers := crfinalizer.NewFinalizers()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: kustomize.config.k8s.io/v1alpha1
2+
kind: Component
3+
namespace: olmv1-system
4+
resources:
5+
- registries_conf_configmap.yaml
6+
patches:
7+
- path: manager_e2e_registries_conf_patch.yaml
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: controller-manager
5+
namespace: system
6+
spec:
7+
template:
8+
spec:
9+
containers:
10+
- name: kube-rbac-proxy
11+
- name: manager
12+
volumeMounts:
13+
- name: e2e-registries-conf
14+
mountPath: /etc/containers
15+
volumes:
16+
- name: e2e-registries-conf
17+
configMap:
18+
name: e2e-registries-conf
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: e2e-registries-conf
5+
namespace: system
6+
data:
7+
registries.conf: |
8+
[[registry]]
9+
prefix = "docker-registry.operator-controller-e2e.svc.cluster.local:5000"
10+
insecure = true
11+
location = "docker-registry.operator-controller-e2e.svc.cluster.local:5000"

config/overlays/e2e/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ resources:
77
components:
88
- ../../components/tls
99
- ../../components/coverage
10+
- ../../components/registries-conf
1011
# ca must be last or (tls|coverage) will overwrite the namespaces
1112
- ../../components/ca

config/samples/olm_v1alpha1_clusterextension.yaml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,23 @@ rules:
4040
- applications.argoproj.io
4141
- argocdexports.argoproj.io
4242
- applicationsets.argoproj.io
43+
# Manage ArgoCD ClusterRoles and ClusterRoleBindings
4344
- apiGroups: [rbac.authorization.k8s.io]
4445
resources: [clusterroles]
45-
verbs: [get, list, watch, create, update, patch, delete]
46+
verbs: [create, list, watch]
47+
- apiGroups: [rbac.authorization.k8s.io]
48+
resources: [clusterroles]
49+
verbs: [get, update, patch, delete]
4650
resourceNames:
4751
- argocd-operator.v0-1dhiybrldl1gyksid1dk2dqjsc72psdybc7iyvse5gpx
4852
- argocd-operator-metrics-reader
4953
- argocd-operator.v0-22gmilmgp91wu25is5i2ec598hni8owq3l71bbkl7iz3
5054
- apiGroups: [rbac.authorization.k8s.io]
5155
resources: [clusterrolebindings]
52-
verbs: [get, list, watch, create, update, patch, delete]
56+
verbs: [create, list, watch]
57+
- apiGroups: [rbac.authorization.k8s.io]
58+
resources: [clusterrolebindings]
59+
verbs: [get, update, patch, delete]
5360
resourceNames:
5461
- argocd-operator.v0-1dhiybrldl1gyksid1dk2dqjsc72psdybc7iyvse5gpx
5562
- argocd-operator.v0-22gmilmgp91wu25is5i2ec598hni8owq3l71bbkl7iz3
@@ -62,19 +69,31 @@ metadata:
6269
rules:
6370
- apiGroups: [""]
6471
resources: [serviceaccounts]
65-
verbs: [get, list, watch, create, update, patch, delete]
72+
verbs: [create, list, watch]
73+
- apiGroups: [""]
74+
resources: [serviceaccounts]
75+
verbs: [get, update, patch, delete]
6676
resourceNames: [argocd-operator-controller-manager]
6777
- apiGroups: [""]
6878
resources: [configmaps]
69-
verbs: [get, list, watch, create, update, patch, delete]
79+
verbs: [create, list, watch]
80+
- apiGroups: [""]
81+
resources: [configmaps]
82+
verbs: [get, update, patch, delete]
7083
resourceNames: [argocd-operator-manager-config]
7184
- apiGroups: [""]
7285
resources: [services]
73-
verbs: [get, list, watch, create, update, patch, delete]
86+
verbs: [create, list, watch]
87+
- apiGroups: [""]
88+
resources: [services]
89+
verbs: [get, update, patch, delete]
7490
resourceNames: [argocd-operator-controller-manager-metrics-service]
7591
- apiGroups: [apps]
7692
resources: [deployments]
77-
verbs: [get, list, watch, create, update, patch, delete]
93+
verbs: [create, list, watch]
94+
- apiGroups: [apps]
95+
resources: [deployments]
96+
verbs: [get, update, patch, delete]
7897
resourceNames: [argocd-operator-controller-manager]
7998
---
8099
apiVersion: rbac.authorization.k8s.io/v1

0 commit comments

Comments
 (0)