operator-registry icon indicating copy to clipboard operation
operator-registry copied to clipboard

Can `configmap-server` support v1 crd?

Open AllenZMC opened this issue 1 year ago • 2 comments

Can configmap-server continue to be used in the next few versions?

I see that crd only supports v1beta1, can it support v1?

func (c *ConfigMapLoader) Populate() error {
	c.log.Info("loading CRDs")

	// first load CRDs into memory; these will be added to the bundle that owns them
	crdListYaml, ok := c.configMapData[ConfigMapCRDName]
	if !ok {
		return fmt.Errorf("couldn't find expected key %s in configmap", ConfigMapCRDName)
	}

	crdListJson, err := yaml.YAMLToJSON([]byte(crdListYaml))
	if err != nil {
		c.log.WithError(err).Debug("error loading CRD list")
		return err
	}

      
	var parsedCRDList []v1beta1.CustomResourceDefinition
	if err := json.Unmarshal(crdListJson, &parsedCRDList); err != nil {
		c.log.WithError(err).Debug("error parsing CRD list")
		return err
	}

AllenZMC avatar Jun 08 '23 14:06 AllenZMC