Skip to content

Commit

Permalink
Refactor resource names and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
aureamunoz committed Nov 27, 2023
1 parent cb76a5c commit d69b62d
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 47 deletions.
15 changes: 15 additions & 0 deletions operator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
bin
target

# editor and IDE paraphernalia
.idea
*.swp
*.swo
*~
6 changes: 3 additions & 3 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,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
# halkyon.io/primaza-operator-bundle:$VERSION and halkyon.io/primaza-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= halkyon.io/primaza-operator
# halkyon.io/expose-bundle:$VERSION and halkyon.io/expose-catalog:$VERSION.
IMAGE_TAG_BASE ?= halkyon.io/expose

# 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>)
Expand Down Expand Up @@ -78,7 +78,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
.PHONY: bundle
bundle: ## Generate bundle manifests and metadata, then validate generated files.
## marker
cat target/kubernetes/primazaoperators.halkyon.io-v1alpha1.yml target/kubernetes/primazas.halkyon.io-v1alpha1.yml target/kubernetes/kubernetes.yml | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
cat target/kubernetes/claims.halkyon.io-v1alpha1.yml target/kubernetes/kubernetes.yml | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
operator-sdk bundle validate ./bundle

.PHONY: bundle-build
Expand Down
8 changes: 1 addition & 7 deletions operator/PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ resources:
crdVersion: v1
namespaced: true
domain: halkyon.io
kind: PrimazaOperator
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
domain: halkyon.io
kind: Primaza
kind: Claim
version: v1alpha1
version: "3"
7 changes: 0 additions & 7 deletions operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,12 @@
<description>Watches for Claim resources</description>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
</properties>

<dependencies>
<dependency>
<groupId>io.quarkiverse.operatorsdk</groupId>
<artifactId>quarkus-operator-sdk</artifactId>
</dependency>
<!-- Needed to generate OLM bundle. If you're not interested in this, you can remove this dependency -->
<dependency>
<groupId>io.quarkiverse.operatorsdk</groupId>
<artifactId>quarkus-operator-sdk-bundle-generator</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

@Version("v1alpha1")
@Group("halkyon.io")
public class Primaza extends CustomResource<PrimazaSpec, PrimazaStatus> implements Namespaced {}

public class Claim extends CustomResource<ClaimSpec, ClaimStatus> implements Namespaced {
}
23 changes: 23 additions & 0 deletions operator/src/main/java/io/halkyon/ClaimReconciler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.halkyon;

import io.fabric8.kubernetes.client.KubernetesClient;
import io.javaoperatorsdk.operator.api.reconciler.Context;
import io.javaoperatorsdk.operator.api.reconciler.Reconciler;
import io.javaoperatorsdk.operator.api.reconciler.UpdateControl;

public class ClaimReconciler implements Reconciler<Claim> {
private final KubernetesClient client;

public ClaimReconciler(KubernetesClient client) {
this.client = client;
}

// TODO Fill in the rest of the reconciler

@Override
public UpdateControl<Claim> reconcile(Claim resource, Context context) {
// TODO: fill in logic

return UpdateControl.noUpdate();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.halkyon;

public class PrimazaSpec {
public class ClaimSpec {

// Add Spec information here
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.halkyon;

public class PrimazaStatus {
public class ClaimStatus {

// Add Status information here
}
24 changes: 0 additions & 24 deletions operator/src/main/java/io/halkyon/PrimazaReconciler.java

This file was deleted.

4 changes: 2 additions & 2 deletions operator/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
quarkus.container-image.build=true
#quarkus.container-image.group=
quarkus.container-image.name=primaza-operator-operator
quarkus.container-image.name=expose-operator
# set to true to automatically apply CRDs to the cluster when they get regenerated
quarkus.operator-sdk.crd.apply=true
quarkus.operator-sdk.crd.apply=false
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@

<modules>
<module>app</module>
<module>operator</module>
</modules>

<profiles>
Expand Down

0 comments on commit d69b62d

Please sign in to comment.