Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ COLLECT_PROFILES_CMD := $(addprefix bin/, collect-profiles)
OPM := $(addprefix bin/, opm)
OLM_CMDS := $(shell go list -mod=vendor $(OLM_PKG)/cmd/...)
PSM_CMD := $(addprefix bin/, psm)
LIFECYCLE_CONTROLLER_CMD := $(addprefix bin/, lifecycle-controller)
LIFECYCLE_SERVER_CMD := $(addprefix bin/, lifecycle-server)
REGISTRY_CMDS := $(addprefix bin/, $(shell ls staging/operator-registry/cmd | grep -v opm))

Expand Down Expand Up @@ -78,7 +79,7 @@ build/registry:
$(MAKE) $(REGISTRY_CMDS) $(OPM)

build/olm:
$(MAKE) $(PSM_CMD) $(OLM_CMDS) $(COLLECT_PROFILES_CMD) bin/copy-content $(LIFECYCLE_SERVER_CMD)
$(MAKE) $(PSM_CMD) $(OLM_CMDS) $(COLLECT_PROFILES_CMD) bin/copy-content $(LIFECYCLE_CONTROLLER_CMD) $(LIFECYCLE_SERVER_CMD)

$(OPM): version_flags=-ldflags "-X '$(REGISTRY_PKG)/cmd/opm/version.gitCommit=$(GIT_COMMIT)' -X '$(REGISTRY_PKG)/cmd/opm/version.opmVersion=$(OPM_VERSION)' -X '$(REGISTRY_PKG)/cmd/opm/version.buildDate=$(BUILD_DATE)'"
$(OPM):
Expand All @@ -98,6 +99,9 @@ $(PSM_CMD): FORCE
$(COLLECT_PROFILES_CMD): FORCE
go build $(GO_BUILD_OPTS) $(GO_BUILD_TAGS) -o $(COLLECT_PROFILES_CMD) $(ROOT_PKG)/cmd/collect-profiles

$(LIFECYCLE_CONTROLLER_CMD): FORCE
go build $(GO_BUILD_OPTS) $(GO_BUILD_TAGS) -o $(LIFECYCLE_CONTROLLER_CMD) $(ROOT_PKG)/cmd/lifecycle-controller

$(LIFECYCLE_SERVER_CMD): FORCE
go build $(GO_BUILD_OPTS) $(GO_BUILD_TAGS) -o $(LIFECYCLE_SERVER_CMD) $(ROOT_PKG)/cmd/lifecycle-server

Expand Down Expand Up @@ -140,6 +144,11 @@ unit/psm:
unit/lifecycle-server:
go test $(ROOT_DIR)/pkg/lifecycle-server/...

unit/lifecycle-controller:
go test $(ROOT_DIR)/pkg/lifecycle-controller/...

unit/lifecycle-metadata: unit/lifecycle-controller unit/lifecycle-server

unit: ## Run unit tests
$(ROOT_DIR)/scripts/unit.sh

Expand Down
23 changes: 23 additions & 0 deletions cmd/lifecycle-controller/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
"fmt"
"os"

"github.com/spf13/cobra"
_ "k8s.io/client-go/plugin/pkg/client/auth"
)

func main() {
rootCmd := &cobra.Command{
Use: "lifecycle-controller",
Short: "Lifecycle Metadata Controller for OLM",
}

rootCmd.AddCommand(newStartCmd())

if err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "error running lifecycle-controller: %v\n", err)
os.Exit(1)
}
}
Loading