feat(provider/kubernetes): v2 Add support for storage class kind
MODIFY
clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/description/manifest/KubernetesKind.java
clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/description/manifest/KubernetesKind.java
@@ -55,6 +55,7 @@ public class KubernetesKind {
public static KubernetesKind SERVICE = new KubernetesKind("service", "svc");
public static KubernetesKind SERVICE_ACCOUNT = new KubernetesKind("serviceAccount", "sa");
public static KubernetesKind STATEFUL_SET = new KubernetesKind("statefulSet", null, true, true);
+ public static KubernetesKind STORAGE_CLASS = new KubernetesKind("storageClass", "sc", false, false);
// special kind that should never be assigned to a manifest, used only to represent objects whose kind is not in spinnaker's registry
public static KubernetesKind NONE = new KubernetesKind("none", null, true, false);

MODIFY
clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/op/handler/KubernetesHandler.java
clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/op/handler/KubernetesHandler.java
@@ -150,6 +150,7 @@ public abstract class KubernetesHandler implements CanDeploy, CanDelete, CanPatc
MOUNTABLE_DATA_PRIORITY(50),
MOUNTABLE_DATA_BACKING_RESOURCE_PRIORITY(40),
SERVICE_ACCOUNT_PRIORITY(40),
+ STORAGE_CLASS_PRIORITY(40),
RESOURCE_DEFINITION_PRIORITY(30),
ROLE_BINDING_PRIORITY(30),
ROLE_PRIORITY(20),

ADD
clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/op/handler/KubernetesStorageClassHandler.java
+/*
+ * Copyright 2018 Joel Wilsson
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.netflix.spinnaker.clouddriver.kubernetes.v2.op.handler;
+
+import com.netflix.spinnaker.clouddriver.kubernetes.v2.caching.agent.KubernetesCoreCachingAgent;
+import com.netflix.spinnaker.clouddriver.kubernetes.v2.caching.agent.KubernetesV2CachingAgent;
+import com.netflix.spinnaker.clouddriver.kubernetes.v2.description.KubernetesSpinnakerKindMap;
+import com.netflix.spinnaker.clouddriver.kubernetes.v2.description.manifest.KubernetesKind;
+import com.netflix.spinnaker.clouddriver.kubernetes.v2.description.manifest.KubernetesManifest;
+import com.netflix.spinnaker.clouddriver.model.Manifest.Status;
+import org.springframework.stereotype.Component;
+
+import static com.netflix.spinnaker.clouddriver.kubernetes.v2.op.handler.KubernetesHandler.DeployPriority.STORAGE_CLASS_PRIORITY;
+
+@Component
+public class KubernetesStorageClassHandler extends KubernetesHandler {
+ @Override
+ public int deployPriority() {
+ return STORAGE_CLASS_PRIORITY.getValue();
+ }
+
+ @Override
+ public KubernetesKind kind() {
+ return KubernetesKind.STORAGE_CLASS;
+ }
+
+ @Override
+ public boolean versioned() {
+ return false;
+ }
+
+ @Override
+ public KubernetesSpinnakerKindMap.SpinnakerKind spinnakerKind() {
+ return KubernetesSpinnakerKindMap.SpinnakerKind.UNCLASSIFIED;
+ }
+
+ @Override
+ public Status status(KubernetesManifest manifest) { return new Status(); }
+
+ @Override
+ public Class<? extends KubernetesV2CachingAgent> cachingAgentClass() {
+ return KubernetesCoreCachingAgent.class;
+ }
+}

feat(provider/kubernetes): v2 Add support for storage class kind (#2779)