github.com/verrazzano/verrazzano@v1.7.0/cluster-operator/hack/add-crd-header.sh (about)

     1  #!/bin/bash
     2  # Copyright (c) 2020, 2022, Oracle and/or its affiliates.
     3  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     4  
     5  # Add YAML boilerplate to generated CRDs - kubebuilder currently does not seem to have a way to
     6  # add boilerplate headers to these - only to generated Go files
     7  
     8  set -o errexit
     9  set -o nounset
    10  set -o pipefail
    11  
    12  SCRIPT_DIR=$(cd $(dirname "$0"); pwd -P)
    13  GENERATED_CRDS_DIR=${SCRIPT_DIR}/../../platform-operator/helm_config/charts/verrazzano-cluster-operator/crds
    14  
    15  # The following two steps are required to handle the cases of running "make manifests" when there
    16  # are and are not api changes.  This is necessary because fix-copyright currently cannot handle both
    17  # cases correctly with the same set of options.
    18  
    19  # First put in the headers from the Git history
    20  go run ${SCRIPT_DIR}/../../tools/fix-copyright/copyright.go -useExistingUpdateYearFromHeader $GENERATED_CRDS_DIR
    21  
    22  # Then fix the updated year for files that were modified this year
    23  go run ${SCRIPT_DIR}/../../tools/fix-copyright/copyright.go  $GENERATED_CRDS_DIR