mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-04 07:49:35 +00:00 
			
		
		
		
	Merge pull request #41146 from shiywang/apply-view1
Automatic merge from submit-queue (batch tested with PRs 41146, 41486, 41482, 41538, 41784) Add apply view-last-applied subcommand reopen pr https://github.com/kubernetes/kubernetes/pull/40984, implement part of https://github.com/kubernetes/community/pull/287 for now unit test all pass, the output looks like: ```console shiywang@dhcp-140-33 template $ ./kubectl apply view last-applied deployment nginx-deployment apiVersion: extensions/v1beta1 kind: Deployment metadata: creationTimestamp: null name: nginx-deployment spec: strategy: {} template: metadata: creationTimestamp: null labels: app: nginx spec: containers: - image: nginx:1.12.10 name: nginx ports: - containerPort: 80 resources: {} status: {} ``` ```release-note Support new kubectl apply view-last-applied command for viewing the last configuration file applied ``` not sure if there is any flag I should updated or the some error handling I should changed. will generate docs when you guys think is ok. cc @pwittrock @jessfraz @AdoHe @ymqytw
This commit is contained in:
		
							
								
								
									
										21
									
								
								test/fixtures/pkg/kubectl/cmd/apply/rc-lastapplied.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								test/fixtures/pkg/kubectl/cmd/apply/rc-lastapplied.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: ReplicationController
 | 
			
		||||
metadata:
 | 
			
		||||
  annotations:
 | 
			
		||||
    kubectl.kubernetes.io/last-applied-configuration: |
 | 
			
		||||
      {"test":1234}
 | 
			
		||||
  name: test-rc
 | 
			
		||||
  labels:
 | 
			
		||||
    name: test-rc
 | 
			
		||||
spec:
 | 
			
		||||
  replicas: 1
 | 
			
		||||
  template:
 | 
			
		||||
    metadata:
 | 
			
		||||
      labels:
 | 
			
		||||
        name: test-rc
 | 
			
		||||
    spec:
 | 
			
		||||
      containers:
 | 
			
		||||
        - name: test-rc
 | 
			
		||||
          image: nginx
 | 
			
		||||
          ports:
 | 
			
		||||
          - containerPort: 80
 | 
			
		||||
		Reference in New Issue
	
	Block a user