Skip to content

Commit

Permalink
Remove SelfLink (#106)
Browse files Browse the repository at this point in the history
* go mod tidy

* Change SelfLink --> UID

* Use GetUID()

* Bump KinD to latest

* Remove UID entirely

* Revert overzealous removal

* Set SHELL

Fixes error:
```
failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory
```
Reference: operator-framework/operator-sdk#4432 (comment)

* Generalize Bash location

* Update CRDs

* Update v1 CRD
  • Loading branch information
dhaiducek authored Apr 7, 2021
1 parent 6479a9a commit 1d647ed
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# KinD tags: https://hub.docker.com/r/kindest/node/tags
kind:
- 'v1.18.15'
- 'v1.19.7' # This should be latest, but needs to be fixed by #10364
- 'latest'
name: KinD tests
steps:
- name: Checkout Config Policy Controller
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ ifneq ($(KIND_VERSION), latest)
else
KIND_ARGS =
endif
# KubeBuilder configuration
KBVERSION := 2.3.1

LOCAL_OS := $(shell uname)
ifeq ($(LOCAL_OS),Linux)
Expand Down Expand Up @@ -116,9 +118,8 @@ test:
@go test ${TESTARGS} `go list ./... | grep -v test/e2e`

test-dependencies:
curl -L https://go.kubebuilder.io/dl/2.3.0/$(GOOS)/$(GOARCH) | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.0_$(GOOS)_$(GOARCH) /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin
curl -L https://go.kubebuilder.io/dl/$(KBVERSION)/$(GOOS)/$(GOARCH) | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_$(KBVERSION)_$(GOOS)_$(GOARCH) /usr/local/kubebuilder

############################################################
# coverage section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ spec:
description: ObjectTemplate describes how an object should look
properties:
complianceType:
description: 'ComplianceType specifies wether it is a : //musthave,
description: 'ComplianceType specifies whether it is: musthave,
mustnothave, mustonlyhave'
type: string
objectDefinition:
description: ObjectDefinition defines required fields for the
object
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- complianceType
type: object
Expand Down Expand Up @@ -128,7 +129,6 @@ spec:
Policy resource.
properties:
compliant:
description: Compliant or NonCompliant as determined by the policy for this resource.
type: string
object:
description: ObjectResource is an object identified by the policy
Expand All @@ -149,17 +149,14 @@ spec:
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
selfLink:
description: An unqualified REST API link to the referent.
type: string
type: object
type: object
reason:
description: A description of why the resource is not compliant or compliant.
type: string
type: object
type: array
type: object
type: object
version: v1
versions:
- name: v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: configurationpolicies.policy.open-cluster-management.io
spec:
group: policy.open-cluster-management.io
Expand All @@ -19,13 +16,18 @@ spec:
- name: v1
schema:
openAPIV3Schema:
description: ConfigurationPolicy is the Schema for the configurationpolicies API
description: ConfigurationPolicy is the Schema for the configurationpolicies
API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand Down Expand Up @@ -53,10 +55,12 @@ spec:
description: ObjectTemplate describes how an object should look
properties:
complianceType:
description: 'ComplianceType specifies wether it is a : //musthave, mustnothave, mustonlyhave'
description: 'ComplianceType specifies whether it is: musthave,
mustnothave, mustonlyhave'
type: string
objectDefinition:
description: ObjectDefinition defines required fields for the object
description: ObjectDefinition defines required fields for the
object
type: object
x-kubernetes-preserve-unknown-fields: true
required:
Expand Down Expand Up @@ -90,20 +94,24 @@ spec:
type: object
conditions:
items:
description: Condition is the base struct for representing resource conditions
description: Condition is the base struct for representing
resource conditions
properties:
lastTransitionTime:
description: The last time the condition transitioned from one status to another.
description: The last time the condition transitioned
from one status to another.
format: date-time
type: string
message:
description: A human readable message indicating details about the transition.
description: A human readable message indicating details
about the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
description: Status of the condition, one of True, False,
Unknown.
type: string
type:
description: Type of condition, e.g Complete or Failed.
Expand All @@ -119,12 +127,14 @@ spec:
type: string
relatedObjects:
items:
description: RelatedObject is the list of objects matched by this Policy resource.
description: RelatedObject is the list of objects matched by this
Policy resource.
properties:
compliant:
type: string
object:
description: ObjectResource is an object identified by the policy as a resource that needs to be validated.
description: ObjectResource is an object identified by the policy
as a resource that needs to be validated.
properties:
apiVersion:
description: API version of the referent.
Expand All @@ -139,10 +149,8 @@ spec:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
namespace:
description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
selfLink:
description: An unqualified REST API link to the referent.
description: 'Namespace of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
type: string
type: object
type: object
Expand Down
Loading

0 comments on commit 1d647ed

Please sign in to comment.