Skip to content

Commit

Permalink
Use newer operator-sdk. (#69)
Browse files Browse the repository at this point in the history
* Use newer operator-sdk.

Signed-off-by: Oleksandr Andriienko <[email protected]>
  • Loading branch information
AndrienkoAleksandr authored Sep 29, 2021
1 parent 8561853 commit 0128446
Show file tree
Hide file tree
Showing 74 changed files with 3,020 additions and 1,807 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
# Ignore all files which are not go type
!**/*.go
!**/*.mod
!**/*.sum
172 changes: 13 additions & 159 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,171 +1,25 @@
# Temporary Build Files
build/_output
build/_test
# Created by https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
### Emacs ###
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
projectile-bookmarks.eld
# directory configuration
.dir-locals.el
# saveplace
places
# url cache
url/cache/
# cedet
ede-projects.el
# smex
smex-items
# company-statistics
company-statistics-cache.el
# anaconda-mode
anaconda-mode/
### Go ###

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, build with 'go test -c'
bin
testbin/*

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
### Vim ###
# swap
.sw[a-p]
.*.sw[a-p]
# session
Session.vim
# temporary
.netrwhist
# auto-generated tag files
tags
### VisualStudioCode ###
.vscode/*
.history
# End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode

# Created by https://www.toptal.com/developers/gitignore/api/intellij+all
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+all

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws
# Kubernetes Generated files - skip generated files, except for vendored files

# IntelliJ
out/
!vendor/**/zz_generated.*

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

# Sonarlint plugin
.idea/sonarlint

# End of https://www.toptal.com/developers/gitignore/api/intellij+all
# editor and IDE paraphernalia
.idea
*.swp
*.swo
*~
189 changes: 189 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile code",
"command": "make compile -s",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
{
"label": "Format code",
"command": "go fmt ./...",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
{
"label": "Update golang dependencies",
"command": "go mod tidy",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
{
"label": "Run unit tests",
"command": "make test",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
{
"label": "Update OLM bundle",
"command": "make bundle -s",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
{
"label": "Update CR/CRDs",
"command": "make generate manifests -s",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
{
"label": "Build and push custom operator image: '${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/kubernetes-image-puller-operator:next'",
"command": "make docker-build docker-push IMG=\"${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/kubernetes-image-puller-operator:next\"",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
{
"label": "Install OLM on the cluster",
"command": "operator-sdk olm install",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
{
"label": "Build and push development bundle",
"command": "export BUNDLE_IMG=\"${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/kubernetes-image-puller-operator-bundle:next\"; make bundle IMG=${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/kubernetes-image-puller-operator:next -s; make bundle-build bundle-push -s BUNDLE_IMG=${BUNDLE_IMG}",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
{
"label": "Install operator via OLM",
"command": "kubectl apply -f config/manager/controller-namespace.yaml; operator-sdk run bundle ${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/kubernetes-image-puller-operator-bundle:next --namespace ${NAMESPACE}; kubectl apply -f config/samples/che_v1alpha1_kubernetesimagepuller.yaml -n ${NAMESPACE}",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build",
"options": {
"env": {
"NAMESPACE": "kubernetes-image-puller-operator"
}
}
},
{
"label": "Uninstall operator via OLM",
"command": "operator-sdk cleanup kubernetes-imagepuller-operator --namespace ${NAMESPACE}",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build",
"options": {
"env": {
"NAMESPACE": "kubernetes-image-puller-operator"
}
}
},
{
"label": "Deploy operator",
"command": "make deploy IMG=\"${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/kubernetes-image-puller-operator:next\" -s; kubectl apply -f config/samples/che_v1alpha1_kubernetesimagepuller.yaml -n \"${NAMESPACE}\"",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build",
"options": {
"env": {
"NAMESPACE": "kubernetes-image-puller-operator"
}
}
},
{
"label": "Undeploy operator",
"command": "make undeploy -s",
"type": "shell",
"args": [],
"problemMatcher": [
"$go"
],
"presentation": {
"reveal": "always"
},
"group": "build"
},
]
}
Loading

0 comments on commit 0128446

Please sign in to comment.