001/* 002 * VM-Operator 003 * Copyright (C) 2024 Michael N. Lipp 004 * 005 * This program is free software: you can redistribute it and/or modify 006 * it under the terms of the GNU Affero General Public License as 007 * published by the Free Software Foundation, either version 3 of the 008 * License, or (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU Affero General Public License for more details. 014 * 015 * You should have received a copy of the GNU Affero General Public License 016 * along with this program. If not, see <https://www.gnu.org/licenses/>. 017 */ 018 019package org.jdrupes.vmoperator.common; 020 021import io.kubernetes.client.Discovery.APIResource; 022import io.kubernetes.client.openapi.models.V1ConfigMap; 023import io.kubernetes.client.openapi.models.V1ConfigMapList; 024import java.util.List; 025 026/** 027 * A stub for config maps (v1). 028 */ 029public class K8sV1ConfigMapStub 030 extends K8sGenericStub<V1ConfigMap, V1ConfigMapList> { 031 032 public static final APIResource CONTEXT = new APIResource("", List.of("v1"), 033 "v1", "ConfigMap", true, "configmaps", "configmap"); 034 035 /** 036 * Instantiates a new stub. 037 * 038 * @param client the client 039 * @param namespace the namespace 040 * @param name the name 041 */ 042 protected K8sV1ConfigMapStub(K8sClient client, String namespace, 043 String name) { 044 super(V1ConfigMap.class, V1ConfigMapList.class, client, 045 CONTEXT, namespace, name); 046 } 047 048 /** 049 * Gets the stub for the given namespace and name. 050 * 051 * @param client the client 052 * @param namespace the namespace 053 * @param name the name 054 * @return the config map stub 055 */ 056 public static K8sV1ConfigMapStub get(K8sClient client, String namespace, 057 String name) { 058 return new K8sV1ConfigMapStub(client, namespace, name); 059 } 060}