Skip to content
This repository was archived by the owner on Nov 18, 2020. It is now read-only.

Commit 7a511ca

Browse files
upgrade to 0.19.2 (#143)
1 parent e6a43a1 commit 7a511ca

File tree

7 files changed

+33
-5
lines changed

7 files changed

+33
-5
lines changed

go/kubebuilder/memcached-operator/Makefile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# Current Operator version
2+
VERSION ?= 0.0.1
3+
# Default bundle image tag
4+
BUNDLE_IMG ?= controller-bundle:$(VERSION)
5+
# Options for 'bundle-build'
6+
ifneq ($(origin CHANNELS), undefined)
7+
BUNDLE_CHANNELS := --channels=$(CHANNELS)
8+
endif
9+
ifneq ($(origin DEFAULT_CHANNEL), undefined)
10+
BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
11+
endif
12+
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
113

214
# Image URL to use all building/pushing image targets
315
IMG ?= controller:latest
@@ -35,7 +47,7 @@ uninstall: manifests kustomize
3547

3648
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
3749
deploy: manifests kustomize
38-
cd config/manager && kustomize edit set image controller=${IMG}
50+
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
3951
$(KUSTOMIZE) build config/default | kubectl apply -f -
4052

4153
# UnDeploy controller from the configured Kubernetes cluster in ~/.kube/config
@@ -99,3 +111,13 @@ KUSTOMIZE=$(GOBIN)/kustomize
99111
else
100112
KUSTOMIZE=$(shell which kustomize)
101113
endif
114+
115+
# Generate bundle manifests and metadata, then validate generated files.
116+
bundle: manifests
117+
operator-sdk generate kustomize manifests -q
118+
kustomize build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
119+
operator-sdk bundle validate ./bundle
120+
121+
# Build the bundle image.
122+
bundle-build:
123+
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
domain: example.com
2-
layout: go.kubebuilder.io/v2.0.0
2+
layout: go.kubebuilder.io/v2
33
repo: github.com/example-inc/memcached-operator
44
resources:
55
- group: cache
66
kind: Memcached
77
version: v1alpha1
88
version: 3-alpha
99
plugins:
10-
go.operator-sdk.io/v2.0.0: {}
10+
go.operator-sdk.io/v2-alpha: {}

go/kubebuilder/memcached-operator/api/v1alpha1/memcached_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ type MemcachedStatus struct {
4242
}
4343

4444
// +kubebuilder:object:root=true
45+
// +kubebuilder:subresource:status
4546

4647
// Memcached is the Schema for the memcacheds API
47-
// +kubebuilder:subresource:status
4848
type Memcached struct {
4949
metav1.TypeMeta `json:",inline"`
5050
metav1.ObjectMeta `json:"metadata,omitempty"`

go/kubebuilder/memcached-operator/config/rbac/leader_election_role.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ rules:
3030
- events
3131
verbs:
3232
- create
33+
- patch
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## This file is auto-generated, do not modify ##
2+
resources:
3+
- cache_v1alpha1_memcached.yaml

go/kubebuilder/memcached-operator/controllers/memcached_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/*
2+
3+
24
Licensed under the Apache License, Version 2.0 (the "License");
35
you may not use this file except in compliance with the License.
46
You may obtain a copy of the License at

go/kubebuilder/memcached-operator/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func main() {
6060
MetricsBindAddress: metricsAddr,
6161
Port: 9443,
6262
LeaderElection: enableLeaderElection,
63-
LeaderElectionID: "f1c5ece8.example.com",
63+
LeaderElectionID: "633a7a3c.example.com",
6464
})
6565
if err != nil {
6666
setupLog.Error(err, "unable to start manager")

0 commit comments

Comments
 (0)