mirror of
https://github.com/kairos-io/osbuilder.git
synced 2025-04-27 03:01:06 +00:00
parent
7e4846785d
commit
93769cf295
2
.github/workflows/image.yml
vendored
2
.github/workflows/image.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
||||
- name: Prepare
|
||||
id: prep
|
||||
run: |
|
||||
DOCKER_IMAGE=quay.io/c3os/osbuilder
|
||||
DOCKER_IMAGE=quay.io/kairos/osbuilder
|
||||
VERSION=latest
|
||||
SHORTREF=${GITHUB_SHA::8}
|
||||
# If this is git tag, use the tag name as a docker tag
|
||||
|
2
.github/workflows/tool-image.yml
vendored
2
.github/workflows/tool-image.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
||||
- name: Prepare
|
||||
id: prep
|
||||
run: |
|
||||
DOCKER_IMAGE=quay.io/c3os/osbuilder-tools
|
||||
DOCKER_IMAGE=quay.io/kairos/osbuilder-tools
|
||||
VERSION=latest
|
||||
SHORTREF=${GITHUB_SHA::8}
|
||||
# If this is git tag, use the tag name as a docker tag
|
||||
|
8
Makefile
8
Makefile
@ -4,8 +4,8 @@
|
||||
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
|
||||
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
|
||||
VERSION ?= 0.0.1
|
||||
IMG ?= quay.io/c3os/osbuilder:test
|
||||
CLUSTER_NAME?="c3os-osbuilder-e2e"
|
||||
IMG ?= quay.io/kairos/osbuilder:test
|
||||
CLUSTER_NAME?="kairos-osbuilder-e2e"
|
||||
export ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
# CHANNELS define the bundle channels used in the bundle.
|
||||
@ -31,8 +31,8 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
|
||||
# This variable is used to construct full image tags for bundle and catalog images.
|
||||
#
|
||||
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
|
||||
# c3os-x.io/osbuilder-operator-bundle:$VERSION and c3os-x.io/osbuilder-operator-catalog:$VERSION.
|
||||
IMAGE_TAG_BASE ?= c3os-x.io/osbuilder-operator
|
||||
# kairos.io/osbuilder-bundle:$VERSION and kairos.io/osbuilder-catalog:$VERSION.
|
||||
IMAGE_TAG_BASE ?= kairos.io/osbuilder
|
||||
|
||||
# BUNDLE_IMG defines the image:tag used for the bundle.
|
||||
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
|
||||
|
8
PROJECT
8
PROJECT
@ -1,19 +1,19 @@
|
||||
domain: c3os-x.io
|
||||
domain: kairos.io
|
||||
layout:
|
||||
- go.kubebuilder.io/v3
|
||||
plugins:
|
||||
manifests.sdk.operatorframework.io/v2: {}
|
||||
scorecard.sdk.operatorframework.io/v2: {}
|
||||
projectName: osartifactbuilder-operator
|
||||
repo: github.com/c3os-io/osbuilder-operator
|
||||
repo: github.com/kairos-io/osbuilder
|
||||
resources:
|
||||
- api:
|
||||
crdVersion: v1
|
||||
namespaced: true
|
||||
controller: true
|
||||
domain: c3os-x.io
|
||||
domain: kairos.io
|
||||
group: build
|
||||
kind: OSArtifact
|
||||
path: github.com/c3os-io/osbuilder-operator/api/v1alpha1
|
||||
path: github.com/kairos-io/osbuilder/api/v1alpha1
|
||||
version: v1alpha1
|
||||
version: "3"
|
||||
|
@ -15,8 +15,8 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha1 contains API Schema definitions for the build v1alpha1 API group
|
||||
//+kubebuilder:object:generate=true
|
||||
//+groupName=build.c3os-x.io
|
||||
// +kubebuilder:object:generate=true
|
||||
// +groupName=build.kairos.io
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
@ -26,7 +26,7 @@ import (
|
||||
|
||||
var (
|
||||
// GroupVersion is group version used to register these objects
|
||||
GroupVersion = schema.GroupVersion{Group: "build.c3os-x.io", Version: "v1alpha1"}
|
||||
GroupVersion = schema.GroupVersion{Group: "build.kairos.io", Version: "v1alpha1"}
|
||||
|
||||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
|
||||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
|
||||
|
@ -5,9 +5,9 @@ metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.9.0
|
||||
creationTimestamp: null
|
||||
name: osartifacts.build.c3os-x.io
|
||||
name: osartifacts.build.kairos.io
|
||||
spec:
|
||||
group: build.c3os-x.io
|
||||
group: build.kairos.io
|
||||
names:
|
||||
kind: OSArtifact
|
||||
listKind: OSArtifactList
|
||||
|
@ -2,7 +2,7 @@
|
||||
# since it depends on service name and namespace that are out of this kustomize package.
|
||||
# It should be run by config/default
|
||||
resources:
|
||||
- bases/build.c3os-x.io_osartifacts.yaml
|
||||
- bases/build.kairos.io_osartifacts.yaml
|
||||
#+kubebuilder:scaffold:crdkustomizeresource
|
||||
|
||||
patchesStrategicMerge:
|
||||
|
@ -4,4 +4,4 @@ kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
|
||||
name: osartifacts.build.c3os-x.io
|
||||
name: osartifacts.build.kairos.io
|
||||
|
@ -2,7 +2,7 @@
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
name: osartifacts.build.c3os-x.io
|
||||
name: osartifacts.build.kairos.io
|
||||
spec:
|
||||
conversion:
|
||||
strategy: Webhook
|
||||
|
@ -8,7 +8,7 @@ webhook:
|
||||
port: 9443
|
||||
leaderElection:
|
||||
leaderElect: true
|
||||
resourceName: 98ca89ca.c3os-x.io
|
||||
resourceName: 98ca89ca.kairos.io
|
||||
# leaderElectionReleaseOnCancel defines if the leader should step down volume
|
||||
# when the Manager ends. This requires the binary to immediately end when the
|
||||
# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
|
||||
|
@ -12,5 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
images:
|
||||
- name: controller
|
||||
newName: quay.io/c3os/osbuilder
|
||||
newName: quay.io/kairos/osbuilder
|
||||
newTag: test
|
||||
|
@ -5,7 +5,7 @@ metadata:
|
||||
name: osartifact-editor-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts
|
||||
verbs:
|
||||
@ -17,7 +17,7 @@ rules:
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts/status
|
||||
verbs:
|
||||
|
@ -5,7 +5,7 @@ metadata:
|
||||
name: osartifact-viewer-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts
|
||||
verbs:
|
||||
@ -13,7 +13,7 @@ rules:
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts/status
|
||||
verbs:
|
||||
|
@ -6,7 +6,7 @@ metadata:
|
||||
name: manager-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts
|
||||
verbs:
|
||||
@ -18,13 +18,13 @@ rules:
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts/status
|
||||
verbs:
|
||||
|
@ -6,7 +6,7 @@ metadata:
|
||||
name: manager-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts
|
||||
verbs:
|
||||
@ -18,13 +18,13 @@ rules:
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts/status
|
||||
verbs:
|
||||
@ -32,7 +32,7 @@ rules:
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- build.c3os-x.io
|
||||
- build.kairos.io
|
||||
resources:
|
||||
- osartifacts/finalizers
|
||||
verbs:
|
||||
|
@ -1,4 +1,4 @@
|
||||
apiVersion: build.c3os-x.io/v1alpha1
|
||||
apiVersion: build.kairos.io/v1alpha1
|
||||
kind: OSArtifact
|
||||
metadata:
|
||||
name: osartifact-sample
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
package controllers
|
||||
|
||||
import (
|
||||
buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1"
|
||||
buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@ -19,7 +19,7 @@ package controllers
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1"
|
||||
buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1"
|
||||
buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1"
|
||||
"github.com/pkg/errors"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@ -53,9 +53,9 @@ func genOwner(artifact buildv1alpha1.OSArtifact) []metav1.OwnerReference {
|
||||
}
|
||||
}
|
||||
|
||||
//+kubebuilder:rbac:groups=build.c3os-x.io,resources=osartifacts,verbs=get;list;watch;create;update;patch;delete
|
||||
//+kubebuilder:rbac:groups=build.c3os-x.io,resources=osartifacts/status,verbs=get;update;patch
|
||||
//+kubebuilder:rbac:groups=build.c3os-x.io,resources=osartifacts/finalizers,verbs=update
|
||||
//+kubebuilder:rbac:groups=build.kairos.io,resources=osartifacts,verbs=get;list;watch;create;update;patch;delete
|
||||
//+kubebuilder:rbac:groups=build.kairos.io,resources=osartifacts/status,verbs=get;update;patch
|
||||
//+kubebuilder:rbac:groups=build.kairos.io,resources=osartifacts/finalizers,verbs=update
|
||||
|
||||
// Reconcile is part of the main kubernetes reconciliation loop which aims to
|
||||
// move the current state of the cluster closer to the desired state.
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
package controllers
|
||||
|
||||
import (
|
||||
buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1"
|
||||
buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
@ -30,7 +30,7 @@ import (
|
||||
logf "sigs.k8s.io/controller-runtime/pkg/log"
|
||||
"sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||
|
||||
buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1"
|
||||
buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1"
|
||||
//+kubebuilder:scaffold:imports
|
||||
)
|
||||
|
||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
||||
module github.com/c3os-io/osbuilder-operator
|
||||
module github.com/kairos-io/osbuilder
|
||||
|
||||
go 1.18
|
||||
|
||||
|
8
main.go
8
main.go
@ -31,8 +31,8 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/healthz"
|
||||
"sigs.k8s.io/controller-runtime/pkg/log/zap"
|
||||
|
||||
buildv1alpha1 "github.com/c3os-io/osbuilder-operator/api/v1alpha1"
|
||||
"github.com/c3os-io/osbuilder-operator/controllers"
|
||||
buildv1alpha1 "github.com/kairos-io/osbuilder/api/v1alpha1"
|
||||
"github.com/kairos-io/osbuilder/controllers"
|
||||
//+kubebuilder:scaffold:imports
|
||||
)
|
||||
|
||||
@ -56,7 +56,7 @@ func main() {
|
||||
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
|
||||
flag.StringVar(&serveImage, "serve-image", "nginx", "Serve image.")
|
||||
// It needs luet inside
|
||||
flag.StringVar(&toolImage, "tool-image", "quay.io/c3os/osbuilder-tools:latest", "Tool image.")
|
||||
flag.StringVar(&toolImage, "tool-image", "quay.io/kairos/osbuilder-tools:latest", "Tool image.")
|
||||
|
||||
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
|
||||
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
|
||||
@ -76,7 +76,7 @@ func main() {
|
||||
Port: 9443,
|
||||
HealthProbeBindAddress: probeAddr,
|
||||
LeaderElection: enableLeaderElection,
|
||||
LeaderElectionID: "98ca89ca.c3os-x.io",
|
||||
LeaderElectionID: "98ca89ca.kairos.io",
|
||||
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
|
||||
// when the Manager ends. This requires the binary to immediately end when the
|
||||
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
KUBE_VERSION=${KUBE_VERSION:-v1.22.7}
|
||||
CLUSTER_NAME="${CLUSTER_NAME:-c3os-osbuilder-e2e}"
|
||||
CLUSTER_NAME="${CLUSTER_NAME:-kairos-osbuilder-e2e}"
|
||||
|
||||
if ! kind get clusters | grep "$CLUSTER_NAME"; then
|
||||
cat << EOF > kind.config
|
||||
|
@ -13,7 +13,7 @@ var _ = Describe("ISO build test", func() {
|
||||
Context("registration", func() {
|
||||
|
||||
AfterEach(func() {
|
||||
kubectl.New().Delete("osartifacts", "-n", "default", "hello-c3os")
|
||||
kubectl.New().Delete("osartifacts", "-n", "default", "hello-kairos")
|
||||
})
|
||||
|
||||
It("creates a simple iso", func() {
|
||||
@ -21,16 +21,16 @@ var _ = Describe("ISO build test", func() {
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
Eventually(func() string {
|
||||
b, _ := kubectl.GetData("default", "osartifacts", "hello-c3os", "jsonpath={.spec.imageName}")
|
||||
b, _ := kubectl.GetData("default", "osartifacts", "hello-kairos", "jsonpath={.spec.imageName}")
|
||||
return string(b)
|
||||
}, 2*time.Minute, 2*time.Second).Should(Equal("quay.io/c3os/c3os:opensuse-latest"))
|
||||
}, 2*time.Minute, 2*time.Second).Should(Equal("quay.io/kairos/kairos:opensuse-latest"))
|
||||
|
||||
Eventually(func() string {
|
||||
b, _ := kubectl.GetData("default", "deployments", "hello-c3os", "jsonpath={.spec.template.metadata.labels.osbuild}")
|
||||
b, _ := kubectl.GetData("default", "deployments", "hello-kairos", "jsonpath={.spec.template.metadata.labels.osbuild}")
|
||||
return string(b)
|
||||
}, 2*time.Minute, 2*time.Second).Should(Equal("workloadhello-c3os"))
|
||||
}, 2*time.Minute, 2*time.Second).Should(Equal("workloadhello-kairos"))
|
||||
Eventually(func() string {
|
||||
b, _ := kubectl.GetData("default", "deployments", "hello-c3os", "jsonpath={.spec.status.unavailableReplicas}")
|
||||
b, _ := kubectl.GetData("default", "deployments", "hello-kairos", "jsonpath={.spec.status.unavailableReplicas}")
|
||||
return string(b)
|
||||
}, 15*time.Minute, 2*time.Second).ShouldNot(Equal("1"))
|
||||
})
|
||||
|
@ -9,5 +9,5 @@ import (
|
||||
|
||||
func TestE2e(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "c3os-operator e2e test Suite")
|
||||
RunSpecs(t, "kairos-operator e2e test Suite")
|
||||
}
|
||||
|
8
tests/fixtures/simple.yaml
vendored
8
tests/fixtures/simple.yaml
vendored
@ -1,12 +1,12 @@
|
||||
apiVersion: build.c3os-x.io/v1alpha1
|
||||
apiVersion: build.kairos.io/v1alpha1
|
||||
kind: OSArtifact
|
||||
metadata:
|
||||
name: hello-c3os
|
||||
name: hello-kairos
|
||||
spec:
|
||||
imageName: "quay.io/c3os/c3os:opensuse-latest"
|
||||
imageName: "quay.io/kairos/core-opensuse:latest"
|
||||
iso: true
|
||||
bundles:
|
||||
- quay.io/c3os/packages:goreleaser-utils-1.11.1
|
||||
- quay.io/kairos/packages:goreleaser-utils-1.11.1
|
||||
grubConfig: |
|
||||
search --file --set=root /boot/kernel.xz
|
||||
set default=0
|
||||
|
Loading…
Reference in New Issue
Block a user